nogigen / yolov5

fine-tuning YOLOv5 to detect baseball balls.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Baseball Ball Detection with yolov5

preprocessing.ipynb script allows me to create the desired data/folder structure to use train.py

├── train_data                  
  ├── images                    
     ├── train                    
     └── val                 

  ├── labels                    
     ├── train
     └── val

I saved the google colab that I worked as a .ipynb, you can check baseball_ball_detection_w_yolov5.ipynb for that.

Here are some of the results of fine-tuning yolov5.

14.jpg
Ball Detection 1
22.jpg
Ball Detection 2
43.jpg
Ball Detection 3
9.jpg
Ball Detection 4
metrics.png
Results

More results at results.zip

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt

Tutorials

Environments

  • Google Colab and Kaggle notebooks with free GPU: Open In Colab Open In Kaggle

Training

Training times for YOLOv5s/m/l/x are 2/4/6/8 days on a single V100 (multi-GPU times faster). Use the largest --batch-size your GPU allows (batch sizes shown for 16 GB devices).

$ python train.py --img 640 --batch 16 --epochs 50 --data baseball.yaml --weights yolov5s.pt --nosave --cache

More information about inference, exporting, plotting results & metrics can be found at ultralytics/yolov5. The ultralyrics's shared google colab makes everything so much easier, it's easy to follow.

Citation

DOI

About

fine-tuning YOLOv5 to detect baseball balls.

License:GNU General Public License v3.0


Languages

Language:Python 95.1%Language:Shell 3.9%Language:Dockerfile 1.0%