Flask API that uses a computer vision model to tell whether an image has something fluffy in it. Go to...
- here for the live site
- here to see how the model was built
- here for info and source code on the frontend that uses this API
The API is a simple Flask project with a single entry point. It takes an image as an input, and predicts to whether it has something fluffy with a confidence %. The prediction is based on a computer vision model that is stored in the fluffy-model.pkl
file.
The app is only used by a single React frontend and hosted on a free Heroku service.
I've set up CORS such that it can only be accessed from 2 origins:
localhost
if run locallymihailthebuilder.github.io
, which is the base URL for all the frontends I host with GitHub Pages
Set up the frontend and run it locally.
Set up the Python environment.
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Run this command:
export FLASK_ENV=development
It enables debug mode with hot reload feature, and it enables CORS to localhost.
Start the app:
flask run