Skip to content

WellyZhang/Darknet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Darknet Logo

Darknet

Darknet is an open source neural network framework written in C and CUDA. It is fast, easy to install, and supports CPU and GPU computation.

For more information see the Darknet project website.

For questions or issues please use the Google Group.

Introduction

While using Darknet to run the YOLO algorithm, I find it a bit hard to adapt the architecture to my own dataset and painful to understand the source code(since there is not a single comment!). Therefore, I forked the original repo and added my own comments for it with instructions here on how to adjust parameters to tune it for your own dataset.

Run YOLO with Your Own Dataset

  1. Prepare the dataset and annotations.
  2. Store all your image paths in a single file, such as train.txt.
  3. For each iamge, there should be an annotation file with the same filename except for its extension that is stored in a specified file. Follow the original instructions on running YOLO as an example.
  4. Set the correct paths.
  5. In the yolo.c file, change the training_images to the file that records your training images paths.
  6. Also in yolo.c, customize your backup_directory where intermediate weights will be saved.
  7. Modify the parameters in the code.
  8. In scr/yolo.c, change the number of classes that your dataset possesses and their class names. Be sure to add correct paths to in the image reading code snippet.
    In case you might want to show new classes, run the Python script in data/labels/make_labels.py
  9. In src/yolo_kernels.cu, change the number of classes as it is in the yolo.c.
  10. Adapt the hyperparameters in the YOLO*.cfg file(the file that specifies the model architecture), including the number of classes, sides and boxes each grid cell predicts(num). Also, you need to calculate the output number of the previous fully connected layer, just (5 * num + classes) * side * side.

References

The original master of Darknet could be found here.
Another fork of Darknet that supports detection in videos resides here.
For those of you who feel inclinded to read the paper, click here.

Releases

No releases published

Packages

No packages published

Languages

  • C 90.6%
  • Cuda 8.7%
  • Other 0.7%