Final project of McGill AI Society Intro to ML Bootcamp (Winter 2022). Demo hosted on Heroku.
This project is a web application that classifies birdcall recordings of twenty different species using mel spectrograms and a convolutional neural network. The classifier utilized the efficientnet_pytorch
implementation of EfficientNet-B7
and was trained on a subset of the Cornell Birdcall Identification dataset. The model was built using PyTorch, and the web app using Flask. Data preprocessing and augmentation was done through the torchvision
package.
Clone or otherwise download the repository. You may need to install Git Large File Storage.
Using a terminal, navigate to the /app
subdirectory and run
docker build -t birdcall-recognition .
Start the app container with
docker run -dp 8080:8080 birdcall-recognition -e PORT="8080"
Using a terminal, navigate to the /app
subdirectory and run
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
waitress-serve app:app
py -m venv .venv
.\.venv\Scripts\activate
py -m pip install -r requirements.txt
waitress-serve app:app
To use the Flask development server, instead of waitress-serve app:app
, run python3 app.py
on Linux/Unix/MacOS, or py app.py
on Windows.
Using a web browser, navigate to http://localhost:8080 to view the application.
This repository contains the source code used to train the model and build the web application.
app/
- The source code for the web applicationstatic/
- Static CSS and JavaScript filestemplates/
- Jinja2 template for landing page.dockerignore
- Files/directories to ignore when building Docker imagesDockerfile
- Commands used to build Docker imageapp.py
- The Flask web applicationaudio_utils.py
- Audio preprocessing functionspredictor.py
- The classification modelrequirements.txt
- Python dependenciesweights.py
- Pretrained model weights
deliverables/
- Deliverables submitted to bootcamp organizerstraining/
- Contains the Jupyter notebook used to train the model