Link to the working site, here.
Video Demo Link - Click on Image
The base code model is based on a post by Adrian Rosebrock. His post can be found here. I have modified the code as per need and deployed it on Heroku. The Heroku deployment was a hideous task as there were some pathblocks with OpenCV.
The images are hosted on 'https://in.000webhost.com' and PhP is used for image upload and management. This was helped by [@JJ0023].(https://github.com/JJ0023)
- static/style.css - for css of flask rendered webpage
- template/index.html - flask rendered webpage
- Aptfile - some files are needed to be installed through apt
- Procfile - needed for gunicorn web deployment
- TrainModel.ipynb - Train and save the model for deployment
- covid19-webapp.ipynb - Deplyment pynb file. This is exported as .py which is deployed in the server
- covid-wxpython.ipynb - Model deployed through WxPython
-
__init__.py
- Used to deploy in the server - requirements.txt - Dependencies/Libraries that need to be installed in the server
-
First Step is to run the flask model in local system
-
If everything is working correctly plan for deployment.
-
Create a
Procfile
file and add the following code. This is needed as we are using gunicorn for deployment.web: gunicorn __init__:app
-
__init__
is the name of the pythonfile and app is the flask object
-
-
Create a
requirements.txt
file and add the required libraries -
Create a file named
Aptfile
if you use opencv and add the followinglibsm6
libxrender1
libfontconfig1
libice6
- These dependencies will be installed using apt in heroku
-
create a heroku app
heroku create covid19testing
-
git create, add, commit your repo
-
Set git to heroku app
heroku git:remote -a covid19testing
-
Add buildpacks as opencv causes trouble - one for apt download, one for python dependencies
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-python
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-apt
-
Push Git
git push heroku master
-
Deployed