This drone detection system uses YOLOv5 which is a family of object detection architectures and we have trained the model on Drone Dataset.
Install
Python >= 3.6.0 required with all requirements.txt dependencies installed:
$ git clone https://github.com/tusharsarkar3/Detect_Drone.git
$ pip install -r requirements.txt
Training
The structure of the file system is of great importance here so these images will show you the correct way of organizing it. The main folder named datasets should be on the same level as this repository. The next steps are elaborated in the images:
- The two folders with images and labels respectively should be inside the dataset folder.
- The images directory should contain the training images and the validation images respectively.
- The labels directory should contain the training labels and the validation labels respectively.
Run commands below to reproduce results on Drone Dataset dataset..
$ $ python train.py --img 640 --batch 16 --epochs 15 --data coco128.yaml --weights yolov5s.pt
Check out YOLOv5 for more information.
Inference
$ python detect.py --weights 'path to the best set of weights' --source 0 # webcam
file.jpg # image
file.mp4 # video
path/ # directory
path/*.jpg # glob
'https://youtu.be/NUsoVlDFqZg' # YouTube video
'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
The results will be stored in a new directory named run which will be on the same level as the root directory.
Check out YOLOv5 for more information.