A python script to train a YOLO model on Vedai dataset and Detection script that detects the bounding box and use SORT algorithm for tracking.
pip install -r requirements.txt
1.1 Download VEDAI dataset for our training from VEDAI
1.2 Unzip the dataset and arrange the files in provided order for transforming script to work :
├── dataset
│ ├── VEDAI
│ │ ├── images
│ │ ├── labels
│ │ ├── fold01.txt
│ │ ├── fold01test.txt
│ │ ├── fold02.txt
│ │ ├── .....
│ ├── VEDAI_1024
│ │ ├── images
│ │ ├── labels
1.3 Run the transform.py script to convert the annotation format from PascalVOC to YOLO Horizontal Boxes.
1.4 Classify the images in train, val and test with the following folder structure :
├── data
│ ├── train
│ │ ├── images
│ │ ├── labels
│ ├── val
│ │ ├── images
│ │ ├── labels
│ ├── test
│ │ ├── images
│ │ ├── labels
Note : Adjust the path='dataset' before running the script.
2.1 Update data.yaml with the location of dataset 2.2 Run the following CLI command
yolo task=detect mode=train epochs=100 data=data.yaml model=yolov8m.pt imgsz=512 batch=8
- The trained weight would be stored in runs/detect/train/weights/
- Run Detection.py with the updated location of the weight
Note : Update the location for video file