Skip to content

fire-smoke-detection-dataset and fire-detection-yolov4 (with xml annotations)

Notifications You must be signed in to change notification settings

eppen/fire-detect-yolov4

 
 

Repository files navigation

fire-detect-yolov4-5 and fire-detect-dataset

  • author is leilei
  • fire-detection qq群: 980489677
  • 如果此项目对您有所帮助,请给个star,您的star是对我的鼓励!

Add important information

  • Open source again smoke-fire detection data 10827 sheets (including 2059 labels):
  • 再次开源烟雾-火灾检测数据10827张(含2059个标注):
  • BaiDuYunPan_Download 提取码->(hhwq)
  • 仍然需要下载 latest-fire-dataset 合并
  • Darknet has updated part of the code, so my code is not suitable for the latest darknet, please refer to the current darknet_images.py file.
  • Darknet已更新了部分代码,因此我的代码不适用于最新的Darknet,请参考当前的darknet_images.py文件。

Some 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 darknet-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 images: test_baidu.py
    * crawl google images: test_google.py
    

How to use this code (test)?

  1. installed darknet-yolov4, and put darknet_API.py into ./darknet
  2. put cfg into ./darknet
  3. download fire-yolov4's weight, and put it in backup_fire folder
  4. Call the darknet_API main 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')
    
  5. The latest version of darknet has modified darknet.py and can directly perform image detection based on it.
  • Note:
    • This project should be placed in the ./darknet folder;
    • Fire generally coexists with smoke, but we only marked fire;
    • In addition, it is easy to confuse the negative sample of the fire and the light;

How to train yolov4 in darknet (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
    

demo

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

Cite

Reputation:

  • This data set contains 2 parts:
  • (1) Images crawled by myself, marked by myself
  • (2) The data that others open source, some have annotations, some have no annotations (I re-annotate it)
  • 本数据仅学术探索!!!

Other

About

fire-smoke-detection-dataset and fire-detection-yolov4 (with xml annotations)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%