0% found this document useful (0 votes)
118 views6 pages

Machine Mastermind

Uploaded by

Mohan Mass
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views6 pages

Machine Mastermind

Uploaded by

Mohan Mass
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Machine Mastermind

1. ABSTRACT:

In the quest to unravel the mysteries of visual perception and empower computers
to comprehend images, "Machine Mastermind: Teaching a Computer to See" embarks
on an exhilarating adventure into the realm of image classification. This journey delves
deep into the heart of artificial intelligence, where cutting-edge techniques converge
with profound insights from cognitive science.

The abstract of this odyssey intertwines the threads of innovation, cognition, and
computation, painting a vivid picture of the challenges and triumphs that accompany
the endeavor to unlock the secrets of visual perception. Through a meticulous
exploration of neural networks, convolutional architectures, and deep learning
algorithms, the narrative illuminates the intricate pathways through which machines
learn to decipher the rich tapestry of visual stimuli. As the narrative unfolds, it
traverses the landscape of image recognition, from the rudimentary stages of pattern
recognition to the sophisticated realms of object detection and semantic segmentation.
Along the way, the reader encounters a diverse cast of characters, from pioneering
researchers to intrepid engineers, each contributing their unique insights and expertise
to the collective quest for machine enlightenment.

Amidst the labyrinthine corridors of neural networks and the ever-shifting


landscapes of computer vision, the narrative uncovers the underlying principles that
govern the process of image classification, shedding light on the mechanisms by which
machines perceive, interpret, and understand the visual world. Through a blend of
technical exposition and narrative intrigue, "Machine Mastermind" offers both novice
enthusiasts and seasoned practitioners a captivating glimpse into the transformative
power of artificial intelligence in unraveling the mysteries of visual perception. As the
journey unfolds, it transcends the boundaries of mere computation, inviting the reader
to contemplate the profound implications of a world where machines not only see but
truly understand.
2. SYSTEM REQUIREMENTS:
2.1 HARDWARE REQUIREMENTS
1. High-performance computing hardware (e.g., multi-core
CPU, GPU, or specialized AI accelerators like TPUs) for
training and inference tasks.
2. RAM-8 GB or higher

2.2 SOFTWARE REQUIREMENTS

1. Operating System- Windows, Linux.


2. Development Environment- TensorFlow, FastAi, Keras.

3. TOOLS AND VERSIONS

1. TensorFlow- Version: 2.7.0


2. Flask-Version: 2.0.2
3. Fast-AI-Version : 2.5.2
FLOWCHART :
CODE IMPLEMENTATION:

from flask import Flask


from pyngrok import ngrok
ngrok.set_auth_token("2eFxMqTVvUZndKyklc0UgROSu8l_62WXZweJRm
R7eYyvS4JSw")
public_url=ngrok.connect(5000).public_url

from flask import Flask, render_template, request


import cv2
from PIL import Image as PILImage
from fastai.vision.all import load_learner, PILImage as FastaiPILImage
import matplotlib.pyplot as plt
from base64 import b64decode
import os

app = Flask(__name__)
run_with_ngrok(app)
app.static_folder = 'static'
# Load the saved model using fastai
model_path = '/content/drive/MyDrive/fastai_model_resnet50_final.pkl'
learn = load_learner(model_path)

@app.route('/')
def index():
return render_template('index.html')

@app.route('/capture', methods=['POST'])
def capture():
data = request.form['data']
binary = b64decode(data.split(',')[1])

# Save the captured image


filename = 'captured_photo.jpg'
with open(filename, 'wb') as f:
f.write(binary)

# Perform object detection on the captured image


image = PILImage.open(filename).convert("RGB")

# Apply transformations
input_image = FastaiPILImage.create(image)
input_dl = learn.dls.test_dl([input_image])

# Get the first batch


input_tensor = input_dl.one_batch()[0]

# Perform inference
pred = learn.get_preds(dl=input_dl)

# Get predicted class and label


predicted_class = pred[0].argmax().item()
predicted_label = learn.dls.vocab[predicted_class]

# Clean up the saved image


os.remove(filename)

return predicted_label

if __name__ == "__main__":
app.run()

PROJECT HURDLES :

Integrating Ngrok with Google Colab presents a formidable challenge.


Configuring Ngrok initially resembles deciphering cryptic code, with
numerous parameters to adjust. Compatibility issues and authentication hurdles
further complicate the process. Even after overcoming these obstacles,
maintaining a stable connection proves elusive, often disrupted by mysterious
errors. It's a relentless battle against chaos, demanding perseverance and
strategic troubleshooting. Despite the challenges, the potential to unlock
Colab's full capabilities through Ngrok's tunneling features motivates
continued efforts to conquer this complex integration.
OUTPUT :

You might also like