This master's thesis project develops a machine learning model by fine-tuning the YOLO (You Only Look Once) model specifically for the detection of howler monkeys in video footage. This project is designed to assist the "Primatas Urbanos" research group at UFRGS by automating the detection of howler monkeys in urban environments. The goal is to facilitate the study of these primates by providing valuable metrics on their behavior, thereby contributing to both academic research and urban wildlife management.
Before installing the project, ensure you have the following prerequisites installed:
Docker is used to containerize your application, ensuring it runs the same in any environment.
- Download Docker Desktop from the official Docker website.
- Run the installer and follow the on-screen instructions.
- Once installed, open Docker Desktop to complete the setup.
- Update your package index and install Docker using your distribution's package manager. For example, on Ubuntu, run:
$ sudo apt update && sudo apt upgrade -y $ sudo apt install docker.io - To ensure Docker runs on startup, enable the Docker service:
$ sudo systemctl enable --now docker - Verify the installation by running:
$ docker --version
setup vs code with dev container
To set up this project locally, follow these steps:
Start by forking the repository to your own GitHub account. This creates a personal copy of the project that you can modify freely without affecting the original codebase.
- Navigate to the GitHub page of the project.
- In the top-right corner of the page, click the "Fork" button.
Once you have forked the repository, you can clone it to your local machine to start working on it.
- On your GitHub fork, click the "Clone or download" button and copy the URL provided.
- Open your terminal and run the following command, replacing
YOUR_USERNAMEwith your GitHub username:
$ git clone https://github.com/YOUR_USERNAME/howler-monkey-detection.git- Navigate into the project directory:
cd howler-monkey-detectionTo keep your fork up to date with the original project, add the original repository as a remote:
git remote add upstream https://github.com/original-developer/howler-monkey-detection.gitYou can fetch updates from the original repository and merge them into your fork with:
git fetch upstream
git merge upstream/main mainThis project is structured to streamline the process of downloading the necessary dataset files from Google Drive, fine-tuning the YOLO model with these files, and logging the training process using MLflow. To facilitate version control and reproducibility, we use DVC (Data Version Control).
To initiate the process, ensure you are in the project's root directory and follow these steps:
You need to setup your dataset on the dataset as the example that dir.
You need to adjust the config/config.yaml file with the traning configuration for the test you'll run.
The training pipeline is configured to run on the main file, the data setup, model training and loggin will be executed on that script
$ python main.pyThis command triggers the following actions in order:
- Creates a K-fold document with the train/val splits for the training;
- Loads the assistant dataset on the train and val folders respecting the number of images used;
- Runs the model training for every fold on the kfold file;
If you need help or have questions, feel free to reach out to the project maintainers. We're more than happy to assist you.