This project aims to train the YOLOv7 object detection model on a custom dataset comprising diverse aquarium images containing fish and aquatic creatures.
- Download Dataset: Aquarium Dataset on Roboflow
- API Download:
!pip install roboflow from roboflow import Roboflow rf = Roboflow(api_key="YOUR_API_KEY") project = rf.workspace("roboflow-100").project("aquarium-qlnqy") dataset = project.version(2).download("yolov7")
- Model Used: YOLOv7 with 100 epochs
- Pretrained Weights: YOLOv7.pt
- Training Command:
!python train.py --workers 1 --device 0 --batch-size 16 --epochs 100 --img 640 640 --data /content/drive/MyDrive/aquarium_dataset/data.yaml --hyp data/hyp.scratch.custom.yaml --name yolov7-custom --weights yolov7.pt
Model | Test Size | APtest | AP50test | AP75test | Batch 1 FPS | Batch 32 Avg. Time |
---|---|---|---|---|---|---|
YOLOv7 | 640 | 51.4% | 69.7% | 55.9% | 161 fps | 2.8 ms |
YOLOv7-X | 640 | 53.1% | 71.2% | 57.8% | 114 fps | 4.3 ms |
YOLOv7-W6 | 1280 | 54.9% | 72.6% | 60.1% | 84 fps | 7.6 ms |
YOLOv7-E6 | 1280 | 56.0% | 73.5% | 61.2% | 56 fps | 12.3 ms |
YOLOv7-D6 | 1280 | 56.6% | 74.0% | 61.8% | 44 fps | 15.0 ms |
YOLOv7-E6E | 1280 | 56.8% | 74.4% | 62.1% | 36 fps | 18.7 ms |
- Detecting using Best Model:
!python detect.py --weights /content/drive/MyDrive/yolov7/runs/train/yolov7-custom2/weights/best.pt --conf 0.2 --img-size 640 --source /content/drive/MyDrive/aquarium_dataset/test/images/
- LinkedIn: Samunder Singh