Live Demo : Heroku App
- PyTorch (DL Model)
- OpenCV
- Flask (Backend)
- Gunicorn Server
- Heroku (PaaS)
I have added a detailed notes on the training and inference model in this repository.
In this repo, I will only have instructions to build front end and deploy.
- Clone this repository with
git clone
. - Open a terminal inside the project directory.
- Install dependencies using
pip install -r requirements.txt
- Run
python app.py
to open the app onlocalhost:5000
.
Deploying in heroku is bit of a hectic process involves a lot of bug fixing. I hope I can guide you through it. Since I used PyTorch and OpenCV in my app, heroku needs some pre-configuration.
- Make sure you have all the requirements in
requirements.py
I assume you have already created heroku account and Heroku CLI on your machine. If not, follow this tutorial.
- Open a terminal on the project directory and create a heroku application using
heroku create covid19-xray-detector
- Since I use OpenCV Contrib Library, it requires
libsm6 libxender1
and it can be installed only thoughapt-get
. So we import buildpack in heroku, useheroku buildpacks:add --index 1 heroku-community/apt
. - Create Aptfile, refer this
- Now you are all set to go, deploy with a single command
git push heroku master
.
If you any problem with deploying your flask or django app in heroku, contact me.
I am grateful for the many community and forums online that helped me to find solutions.