As I am waiting for the second part of this course, I have been working on a little system to make it very easy to productionize vision models trained with the fastai library.
The backend is a starlette-python application and corresponding dockerfile, all you need to do is add your export.pkl.
You can find it here: https://github.com/gdoteof/fastai-vision-uvicorn-gunicorn-starlette-docker
In my limited testing, it can easily handle thousands of requests per hour on a cheap VPS from digital ocean. (with a resnet 34 model)
There are two front ends.
- A no-dependency html/js single page application that is shipped with, and, served by, the same application that handles the API requests.
- A minimal-dependency ReactJS single page application that is able to run on githup pages available in this repo: https://github.com/gdoteof/fastai-vision-model-inference--react-gh-pages/tree/master
You can see a demo hooked up to a “Mickey Mouse, Animal Mouse, Computer Mouse” classifier here: https://gdoteof.github.io/fastai-vision-model-inference--react-gh-pages/