Build and train a custom model to identify birds visiting bird feeders.
- First, fork the repository.
- Enable workflows in your fork:
- Then, click on and enable all the workflows that are highlighted wuth a red square in the image below.
- On your machine, run:
git clone https://github.com/bird-feeder/BirdFSD-YOLOv5.git
cd BirdFSD-YOLOv5
# Recommended: create a conda/pyenv environment
pip install -r requirements.txt
poetry build
pip install dist/*.whl
git clone https://github.com/ultralytics/yolov5.git
mv .env.example .env
nano .env # or with any other editor
# See `🌱 Environment Variables` section for details about the environment variables.
Name | Value |
---|---|
TOKEN | Label-Studio Access Token . |
LS_HOST | The URL of the label-studio app (e.g., https://label-studio.example.com) – make sure you include https:// in the URL. |
DB_CONNECTION_STRING | MongoDB connection string (e.g., mongodb://mongodb0.example.com:27017 ). See this article for details. |
DB_NAME | Name of the main MongoDB database (default: label_studio ). |
S3_ACCESS_KEY | (Optional) The S3 bucket's Access Key ID . |
S3_SECRET_KEY | (Optional) The S3 bucket's Secret Key . |
S3_REGION | (Optional) The S3 bucket's region (default: us-east-1 ). |
S3_ENDPOINT | (Optional) The S3 bucket's endpoint/URL server. |
EXCLUDE_LABELS | (Optional) Comma-separated list of labels to exclude from processing (e.g., label a,label b). |
- To use the GitHub Actions workflows (recommended!), you will need to add every environment variable and its value from
.env
to theSecrets
of your fork (you can findSecrets
underSettings
).
-
Option 1: Run the
JSON to YOLOv5 (data preprocessing)
workflow under githubActions
. -
Option 2: Run it locally with:
python birdfsd_yolov5/preprocessing/json2yolov5.py mv dataset-YOLO/dataset_config.yml . python birdfsd_yolov5/model_utils/relative_to_abs.py
⚡ Training1
Use the Colab notebook:
docker pull alyetama/birdfsd-yolov5:latest
docker run -it --env-file .env alyetama/birdfsd-yolov5 python birdfsd_yolov5/preprocessing/json2yolov5.py