GithubHelp home page GithubHelp logo

jalywang123 / darknet_scripts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jumabek/darknet_scripts

0.0 1.0 0.0 11.57 MB

Auxilary scripts to work with (YOLO) darknet deep learning famework. AKA -> How to generate YOLO anchors?

Python 100.00%

darknet_scripts's Introduction

darknet_scripts

This repo contains my auxilary scripts to work with darknet deep learning famework

  1. How to compute/reproduce YOLOv2 anchors for yolo-voc.cfg?
  2. How to visualize genereted anchors?
  3. Is gen_anchors.py same as YOLOv2 anchor computation?
  4. How to get anchors if My input for network is bigger than 416?
  5. How to plot YOLO loss
  6. YOLO and Anchors tutorial

How to compute/reproduce YOLOv2 anchors for yolo-voc.cfg?

  1. Download The Pascal VOC Data and unpack it to directory build\darknet\x64\data\voc will be created dir build\darknet\x64\data\voc\VOCdevkit\:

    1.1 Download file voc_label.py to dir build\darknet\x64\data\voc: http://pjreddie.com/media/files/voc_label.py

  2. Download and install Python for Windows: https://www.python.org/ftp/python/2.7.9/python-2.7.9rc1.amd64.msi

  3. Run command: python build\darknet\x64\data\voc\voc_label.py (to generate files: 2007_test.txt, 2007_train.txt, 2007_val.txt, 2012_train.txt, 2012_val.txt)

  4. Run command: type 2007_train.txt 2007_val.txt 2012_*.txt > train.txt

  5. Obtain anchors5.txt in generated_anchors/voc-reproduce folder by executing:

python gen_anchors.py -filelist //path//to//voc//filelist/list//train.txt -output_dir generated_anchors/voc-reproduce -num_clusters 5

How to visualize genereted anchors?

After completing the steps above, execute

python visualize_anchors.py -anchor_dir generated_anchors/voc-reproduce 

Inside the generated_anchors/voc-reproduce directory you will have png visualization of the anchors

Is gen_anchors.py same as YOLOv2 anchor computation?

Yes, almost. Look at the two visualaziations below:


  • yolo-voc.cfg anchors are provided by the original author

  • yolo-voc-reproduce.cfg anchors computed by gen_anchors.py

How to get anchors if My input for network is bigger than 416?

Simply change the lines here https://github.com/Jumabek/darknet_scripts/blob/master/gen_anchors.py#L17 to your input dimension. Then compute the anchors.

How to plot YOLO loss?

In order to plot a loss, you first need a log of the darknet train command For example,below command will save the log into log/aggregate-voc-tiny7.log

darknet.exe detector train data/aggregate-voc-tiny7.data cfg/aggregate-voc-tiny7.cfg  backup/aggregate-voc-tiny7/aggregate-voc-tiny7_21000.weights >> log/aggregate-voc-tiny7.log -gpus 0,1

Once you have \path\to\log\aggregate-voc-tiny7.log, plot the loss by executing

python plot_yolo_log.py \\path\\to\\log\\aggregate-voc-tiny7.log

darknet_scripts's People

Contributors

jumabek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.