Skip to content

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

Notifications You must be signed in to change notification settings

yangyin2016/fire-detect-yolov4

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fire-detect-yolov4 and fire-detect-dataset

  • author is leilei(CSU)
  • fire-detection qq群: 980489677

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

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')
    
  • 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-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%