- author is leilei
- fire-smoke-detection qq-group(full): 980489677, qq-group2: 710514100
- If this project is helpful to you, please give a star, your star is an encouragement to me!
- Note: yolov4 only supports fire detection, yolov5s supports smoke-fire type 2 detection!
python: 3.6+
ubuntu16.04 or 18.04
darknet (cuda10.0 docker)
pytorch 1.6+ (cuda10.2 docker)
- Workwear Reflective Clothing-Safety Helmet Data Set: reflective-clothes-detect-dataset
- It can be used for detection of designated areas such as construction areas or dangerous areas.
- eg:Smoke is further subdivided into white smoke, black smoke, and gray smoke, and fires can also be further refined
- smoke-fire (10827's images,no labels)-BaiDuYunPanDownLoadLink Code->(hhwq)
- fire-smoke (2059's images,include labels)-BaiDuYunPanDownLoadLink Code->(3q4r)
- fire-smoke (2059's images,include labels)-GoogleDrive DownLoadLink
- yolov4 fire-detect's weight-BaiDuYunPanDownLoadLink Code->(w3ip)
- yolov5 fire-smoke-detect's weight is in yolov5 folder!
- darknet-yolov4-install-tutorial
- yolov4.conv.137
- If you want to use the latest version of darknet prediction function, please refer to latest_darknet_API.py.
- We annotate the fire-detection-dataset as Pascal VOC format:
--VOC2020 --Annotations (xml_num: 2059) --ImageSets(Main) --JPEGImages (image_num: 2059) --label_name: fire
- Unzip **.tar file command
tar -xzvf ***.tar (win or linux: Git Bash) or 7zip (win: 7zip; 360zip need 2 time unzip)
- If you want to convert VOC to YOLO format:
Call yolov4's scripts voc_label.py
- Fire scene:
vehicle-fire、grassland-fire、forest-fire、building-fire、Big and small fire、Day and night fire;
- Crawl fire-smoke images
* crawl baidu-Bing images: crawl_baidu.py or crawl_baidu_bing.py
- Data pre-labeling ############### Key ###################
(1)Download 10827 smoke-fire detection data set (2)Use my open source yolov5 fire-smoke detection model to pre-label unlabeled images (3)Manual correction of fire-smoke detection pre-labeling, retraining yolov4, yolov5 (4)Come on!!!
-
yolov4's test:
- First of all, according to yolov4, I have uploaded the darknet compiled by myself, so you do not need to compile twice; unzip yolov4's libdarknet.zip -> libdarknet.so!
- Download the yolov4 fire detection model in Baidu cloud disk and put it in the backup_fire folder;
- Call the darknet_API.py function;
from darknet_API import Detect detect = Detect(metaPath=r'./cfg/fire.data', configPath=r'./cfg/yolov4-fire.cfg',\ weightPath=r'./backup_fire/yolov4-fire_best.weights',\ namesPath=r'./cfg/fire.names') image = cv2.imread(r'/home/Datasets/20200714085948.jpg', -1) draw_img = detect.predict_image(image, save_path='./pred.jpg')
-
yolov4 to onnx:
- yolov4 to onnx refer ./yolov4/yolov4_to_onnx/yolov4_to_onnx.py
- onnx to trt engine refer ./yolov4/yolov4_to_onnx/onnx_to_trt7.py
-
yolov4's train:
- Convert VOC format data to YOLO format data
- Configure file information such as cfg
- Call the darknet command:
./darknet detector train cfg/fire.data cfg/yolov4-fire.cfg yolov4.conv.137 -gpus 0 -map -dont_show If there is insufficient gpu memory, you can modify the batch size and cancel the random multi-scale. By default, random=1, cancel will be random=0
-
yolov5's test:
- cd yolov5, and excuting an order:
python detect.py --source ***/aaa.jpg --weights ./best.pt
- ./result: fire-smoke-detect demos
- ./xml_lab: fire-detection image annotations
- train_data contain 1-2-3-4:
- train_data1: https://blog.csdn.net/LEILEI18A/article/details/107334474
- train_data2: https://bitbucket.org/gbdi/bowfire-dataset/downloads/
- train_data3: https://github.com/OlafenwaMoses/FireNET/releases/download/v1.0/fire-dataset.zip
- train_data4: https://github.com/cair/Fire-Detection-Image-Dataset/blob/master/Fire%20images.rar
- fire-demo-dataset: http://signal.ee.bilkent.edu.tr/VisiFire/Demo/SampleClips.html
- google云盘下载链接由qq群中小伙伴提供
- This data is for academic exploration only!!!