Skip to content

Latest commit

 

History

History
134 lines (113 loc) · 5.53 KB

README_EN.md

File metadata and controls

134 lines (113 loc) · 5.53 KB

fire-smoke-detect and english description

fire-smoke-detect and fire-smoke-detect-dataset

  • 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!

installation environment

    python: 3.6+
    ubuntu16.04 or 18.04
    darknet (cuda10.0 docker)
    pytorch 1.6+ (cuda10.2 docker)

new open-source dataset

  • 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.

Improve and optimize

  • eg:Smoke is further subdivided into white smoke, black smoke, and gray smoke, and fires can also be further refined

dataset download details


How to use dataset?

  • 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!!!
    

how to use test-train's code in yolov4

  • yolov4's test:

    1. 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!
    2. Download the yolov4 fire detection model in Baidu cloud disk and put it in the backup_fire folder;
    3. 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:

    1. yolov4 to onnx refer ./yolov4/yolov4_to_onnx/yolov4_to_onnx.py
    2. onnx to trt engine refer ./yolov4/yolov4_to_onnx/onnx_to_trt7.py
  • yolov4's train:

    1. Convert VOC format data to YOLO format data
    2. Configure file information such as cfg
    3. 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
      

how to use test's code in yolov5

  • yolov5's test:

    1. cd yolov5, and excuting an order:
    python detect.py --source ***/aaa.jpg --weights ./best.pt
    

demo

  • ./result: fire-smoke-detect demos
fire-smoke-detect-demo
  • ./xml_lab: fire-detection image annotations
fire-detect-annotation

Cite

Reputation:

  • This data is for academic exploration only!!!

Other