- Create anaconda environment
conda create -n fire_detector python=3.8
conda activate fire_detector
- Clone the code
git clone https://github.com/tiruss/Fire_Detector.git
cd Fire_Detector
git clone https://github.com/ultralytics/yolov5.git
cd yolov5
pip install -r requirements.txt
pip install pytube # for downloading youtube video
- Download Fire Dataset [Download]
- Run xml2yolo_text.py
python xml2yolo_text.py
- Then put the dataset into 'yolov5/data/fire_dataset'
- Run train.py with proper dataset path
- You can change the hyperparameters in train.py [YOLOv5]
python train.py --data fire.yaml --cfg yolov5s.yaml --weights '' --batch-size 16 --epochs 100
- Track your training process on the tensorboard
tensorboard --logdir runs/train
- Download youtube video
python youtube_download.py
- Run detect.py
python detect.py --source [YOUR VIDEO] --weights [YOUR WEIGHT] --conf 0.4