This project aims to detect forest fires using the FireNet and IEEE datasets. Follow the steps below to set up the project and run the detection.
Main file: Yolo.ipynb
Trained model: https://drive.google.com/file/d/1hgCh8dzRz1yjUsNQ6wNCZNxq01TY9vhs/view?usp=drive_link
- Download the FireNet and IEEE data
- Upload the FireNet data to Roboflow to obtain the data image API for faster data and annotation reading. Roboflow is basically an interface where we could upload our object detetcion datasets and get a corresposnding code key to read that data for training.
- With respeoct to pre-processing, we basically do horizontal fipping and rotation for the augmentation process
- Copy the annotation API from Roboflow and paste it/ replace in the cell in "Yolo.ipynb".
- For instance, Open "Yolo.ipynb" and paste the data reading code that you got from RoboflowAPI and replace it in the
!pip install roboflow
from roboflow import Roboflow
rf_ieee = Roboflow(api_key="ilXvK9f3xwRvE63aY9cK")
project_ieee = rf_ieee.workspace("new-workspace-ilks2").project("large_det")
dataset_ieee = project_ieee.version(1).download("yolov5")
Just replace it with the API key that you get from roboflow
- Once the data is read is done, follow the instructions in the notebook to train. Basically the subsequent cells willguide you to the training process.
- To test, upload the videos/frames or images to a location in the drive or any other custom location. Also, upload the best_ieee.pt model to any custom location. In the Yolo.ipynb, run the cell that contains the below code. Make sure the paths have been changed accordingly. Sample inference videos are avaialble at the sample_vids folder.
!python detect.py --weights /content/drive/MyDrive/best_ieee.pt --img 640 --conf 0.4 --source /content/drive/MyDrive/field14.mp4 --save-txt
A detailed video explaining the same has been uploaded at demmo.webm
https://drive.google.com/file/d/1HXwqWGpAJjrvxGD0MmzPzoi6w3SRrcj6/view?usp=drive_link