DonaNet is a neural network designed to detect and classify the mammals that inhabit Doñana National Park (Spain).
This repository contains the weights file produced by a training process of a YOLO network specifically adapted to Doñana National Park. The dataset used during this training process is available at XXXXX.
The repository also includes the donanet.py application, which allows retraining this network
with new image datasets.
- Interactive CLI powered by Typer and Rich
- Automatic dataset splitting into
train / val / testpartitions with configurable ratios - Fine-tune any Ultralytics YOLO model and save weights under
weights/ - Run inference or evaluation on the test partition with a chosen weight file
- Inspect dataset statistics and available weights at a glance
- Designed for seamless integration with the WildINTEL image storage
- Python 3.11+
- uv (for dependency management and packaging)
- CUDA-capable GPU recommended for training (CPU fallback supported)
donanet.py exposes a set of Typer sub-commands that drive Ultralytics YOLO:
| Command | Description |
|---|---|
prepare-dataset |
Split images + labels into train / val / test |
train |
Fine-tune a YOLO model and write weights to weights/ |
test |
Run inference or evaluation on the test partition |
list-datasets |
Show dataset partitions and their image counts |
info |
Show available weights and dataset summary |
dataset/
├── train/
│ ├── images/ ← training images (.jpg / .png)
│ └── labels/ ← YOLO-format .txt annotations
├── val/
│ ├── images/
│ └── labels/
└── test/
├── images/
└── labels/
Each label file follows the YOLO format — one row per object:
<class_id> <x_center> <y_center> <width> <height>
All values are normalised to [0, 1] relative to the image dimensions.
git clone <your-repo-url>
cd donanetuv sync # or: pip install -e .Place raw images inside a source directory, then split them:
python donanet.py prepare-dataset --source /path/to/raw --train 0.7 --val 0.2 --test 0.1python donanet.py train --model yolov8n.pt --epochs 50 --name my_runWeights are saved to weights/my_run/best.pt and weights/my_run/last.pt.
python donanet.py test --weights weights/my_run/best.pt --conf 0.25python donanet.py info
python donanet.py list-datasetspython donanet.py prepare-dataset --source /data/raw --train 0.7 --val 0.2 --test 0.1
python donanet.py train --model yolov8n.pt --epochs 100 --name wildlife_v1
python donanet.py train --model yolov8s.pt --epochs 100 --resume --name wildlife_v1
python donanet.py test --weights weights/wildlife_v1/best.pt
python donanet.py test --weights weights/wildlife_v1/best.pt --save-images
python donanet.py list-datasets
python donanet.py infoFull documentation — installation guide, user guide and administrator guide — is available under
the docs/ directory:
- Installation guide:
docs/installation-guide.md - User guide:
docs/user-guide.md - Administrator guide:
docs/admin-guide.md
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GNU General Public License v3.0 or later - see the LICENSE file for details.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This work is part of the WildINTEL project, funded by the Biodiversa+ Joint Research Call 2022-2023 "Improved transnational monitoring of biodiversity and ecosystem change for science and society (BiodivMon)". Biodiversa+ is the European co-funded biodiversity partnership supporting excellent research on biodiversity with an impact for policy and society. Biodiversa+ is part of the European Biodiversity Strategy for 2030 that aims to put Europe's biodiversity on a path to recovery by 2030 and is co-funded by the European Commission.
