I just wanted to share my approach on how to create a simple bear prediction app (or any other image prediction app) on a free hosting service.
I mean the app that is thoroughly explained in Lesson 2: https://course.fast.ai/videos/?lesson=2
I found that Heroku allows set up one app for free, so I decided to take advantage of that.
ALERT: I do not know Python, so if you see silly things in my code, just let me know.
I will happily accept any suggestions.
Essentially my approach was to combine these two guides:
The second app was based on Flask, which is much easier to understand, especially considering my lack of Python knowledge.
However, it used fastai2, which I did not know how to get to work.
The render app is based on Starlette, which I couldn’t really grasp (remember my Python arrogance), but the part related to prediction was based on fastai, so I have incorporated its logic into Flask app and made it work on Heroku.
OK, let’s see how to get it working. There are several steps:
- Create an account on Heroku.com and choose the free option there.
- You need an account on GitHub.com, so you could fork my repo to your own account.
My repo is here: https://github.com/tony-sologubov/bear-detector-on-heroku
- Fork my repo to your GitHub account and set up Heroku to use this repo for the server.
For that choose ‘Deployment method’ as ‘GitHub’. Specify the ‘Connect to GitHub’ setting as your GitHub account and then find your repository there.
- Finally, scroll down to the ‘Manual deploy’ button and click the ‘Deploy Branch’ button. It will take quite a bit of time, but the app will finally be launched. If not, check logs and let me know what went wrong.
I hope you find this simple tutorial useful and if you have any comments, I will happy to hear from you.