Docker/Flask version of application deployed on Heroku: https://github.com/VincentLu91/airplanes-or-cars-docker-flask
The simple binary image classification application distinguishes between two popular types of transport: airplanes or autombiles.
It uses a VGG16 pre-trained model from the Keras library and replaces the fully connected layers of the trained VGG model with the new classifier part to interpret the output with a stochastic gradient descent optimizer. As well, the classification app runs a test harness to estimate the performance of the custom-trained model.
The application is written in streamlit for the front-end. Accompanying libraries include Pillow for loading/processing images, and keras for defining and configuring the deep learning image classification model.
Limitation: it can only resize images of certain sizes to 224 * 224 * 3
I have written up a blog post on the IG Content Generator in great detail here: https://vincentlu91.github.io/2020/07/06/Image-Classification-Planes-or-Automobiles.html
You can use the following link here: https://airplanes-or-cars.herokuapp.com
(October 8 2022): Starting November, Heroku's free dynos will no longer be available therefore the application can no longer run on Heroku. YouTube demo can be seen below with the application demonstration:
You can pull the docker image from the Docker Hub repository: https://hub.docker.com/r/vincelu299/airplanes_or_cars
Then:
docker run -p 8501:8501 airplanes_or_cars_stapp:v1
You may see the suggested Network and External URLs. Ignore those - go to the browser and enter:
http://localhost:8501/
You should be able to view the containerized application.
Libraries and their versions are included in requirements.txt. To install the virtual environment, run the following:
python3 -m venv env # or python -m venv env
source env/bin/activate
pip3 install -r requirements.txt # or pip install -r requirements.txt
At this point the environment should be set up with required libraries to run the application. To run the app, enter:
streamlit run app.py
Then in the browser, enter localhost:8501/
.
Upload an image or drag and drop it to the file picker:
Example images:
Click "Process". The image uploaded will be displayed, along with the result that it is either a plane, automobile, or neither.