An API for identifying cougars v.s. bobcats v.s. other USA cat species
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 3 commits ahead of simonw:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.ipynb_checkpoints
.vscode
Dockerfile
README.md
cougar.py
hummingbird.py
hummingbird_custom_2-resnet34.ipynb
inaturalist-cats.ipynb
now.json
stage-2-34.pth
stage-2-34_3.pth

README.md

cougar-or-not

My first attempt at a machine learning API, using a pre-calculated model trained using iNaturalist data.

The resulting API is used by the @critter_vision Twitter bot, the source code for which can be found at https://github.com/natbat/CritterVision

The model is usa-inaturalist-cats.pth - an 83MB file.

The notebook 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

The Dockerfile means the entire thing can be deployed to Zeit Now or any other container hosting service.

Examples

Cougar: https://cougar-or-not.now.sh/classify-url?url=https://upload.wikimedia.org/wikipedia/commons/9/9a/Oregon_Cougar_ODFW.JPG

Bobcat: https://cougar-or-not.now.sh/classify-url?url=https://upload.wikimedia.org/wikipedia/commons/thumb/d/dc/Bobcat2.jpg/1200px-Bobcat2.jpg