This was a micro project I did with my friend Warren with the intent of understanding the basics of the how the frontend and the backend interracts.
Introduction
As mentioned above, this was intended as a learning project, with the frontend being written by Warren and the backend by me. The project was a simple web app, where you upload an image and get a list of 10 guesses about what the picture contains.
The project contains both the client and the server components, and can be run locally. You can host the server side with wiht appropriate front end. This client for this project can’t be hosted due to some minor issue and thus needs to be loded locally, but dragging and dropping in the browser or using the file path to it.
Tech Stack
-
Python - Python is an interpreted, high-level and general-purpose programming language, it is the language I used for the used for the backend of the project.
-
HTML, CSS and JavaScript - The frontend of the project was written using HTML, CSS and JavaScript.
-
Flask - The framework I used for the backend. It is a microweb framework, and is really easy to use.
-
Tensorflow - Tensorflow is an end-to-end open source platform for machine learning. I used it to import the ResNet50 model, which is used to make the predictions.
-
ResNet50 - The model used for prediction.
Run
Client
To run the client you don’t need to require any installation. Just open the index.html
file in your browser.
Server
The server is a flask app that uses a tensorflow model to make predictions.
To install the server, you need to install the requirements in a virtual environment.
It is suggested that you create a virtual environment using the python venv
module.
1python3 -m venv venv
Then activate the virtual environment
bash1source venv/bin/activate
Then install the requirements from the ‘requirements.txt’ file.
bash1pip install -r requirements.txt
To start the server, navigate to the server
directory and use the flask run
command.
1cd server
2flask run
The server will start on port 5000 by default. Ensure that no other process is using that port.