To run this locally:
-
Download the model weights and put them in the
app/weights
. First create aweights
directory in theapp
directory, then place the downloaded weights into this folder on your machine - these are the model weights, the app will not run without them. If you've successfully done this then you would have the following directory and file presentapp/weights/yolov3.weights
. -
In the terminal:
- run the package dependencies
pip install -r requirements.txt
- We want to run the flask app in development mode so run the following
export FLASK_ENV=development
export FLASK_APP=run.py
- To run the flask app
flask run
- run the package dependencies
-
Go to
http://127.0.0.1:5000/uploadfile
to use the flask app -
Run
Ctrl+ C
in the terminal to kill the flask app -
To run this via Docker:
- Build the Docker image specified in the Dockerfile:
docker build -t <name of image> .
where<name of image>
can be whatever you name the image - I suggestflask_yolo
as an image name. - To run the docker image (that doesn't persist):
docker run --rm -p 5000:5000 <name of image>
- Build the Docker image specified in the Dockerfile:
-
My Docker commands cheatsheet
-
Warning: The Docker image may crash due to memory issues - to avoid this you can increase the docker memory. The instructions for Mac are here