Train YOLO26 Object Detection Model on a Custom Dataset
This project demonstrates how to fine-tune a YOLO26m checkpoint on a custom object detection dataset using Ultralytics, download datasets directly from Roboflow Universe, and track experiments with Comet ML. The full workflow — from pre-trained inference to validation and test-set visualization — is covered in a single Jupyter notebook.
Setup and installations
Get API Keys:
- Roboflow — needed to download the dataset. Store it as
ROBOFLOW_API_KEYin a.envfile. - Comet ML — needed for experiment tracking. Store it as
api_keyin a.comet.configfile.
Refer to .env.example and .comet.config.example files for the structure of the files.
Install Dependencies:
Ensure you have Python 3.12 or later installed.
uv syncSelect the above python virtual environment as kernel in the notebook.
Run the notebook:
Open and run train_yolo26_object_detection.ipynb end-to-end. The notebook covers:
- Pre-trained YOLO26 inference on a sample image
- Dataset download from Roboflow Universe (boxing-punch detection)
- Fine-tuning YOLO26 with Comet ML logging
- Validation on the best checkpoint
- Inference and annotated prediction on the test set
📬 Stay Updated with Our Newsletter!
Get a FREE Data Science eBook 📖 with 150+ essential lessons in Data Science when you subscribe to our newsletter! Stay in the loop with the latest tutorials, insights, and exclusive resources. Subscribe now!
