My first attempt at a machine learning API, using a pre-calculated model trained using iNaturalist data.
The model is
usa-inaturalist-cats.pth - an 83MB file.
inaturalist-cats.ipynb shows how I trained the model, using fastai.
cougar.py is a very tiny Starlette API server which simply accepts file image uploads and runs them against the pre-calculated model.
It also accepts a URL to an image, e.g. https://cougar-or-not.now.sh/classify-url?url=https://upload.wikimedia.org/wikipedia/commons/9/9a/Oregon_Cougar_ODFW.JPG
Dockerfile means the entire thing can be deployed to Zeit Now or any other container hosting service.