• Stars
    star
    223
  • Rank 177,572 (Top 4 %)
  • Language
    Python
  • Created over 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

darknet_scripts - YOLO / YOLOv2 / YOLOv3 / YOLOv4 / YOLOv5 / YOLOv7

Auxilary scripts for working with darknet deep learning famework (2017)

  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

More Repositories

1

net_intrusion_detection

Network intrusion detection with Machine Learning (Deep Learning) experiment : 1d-cnn, softmax, neural networks, convolution
Jupyter Notebook
36
star
2

convert_MOT16_to_yolo

Converts MOT16 and MOT17 annotations to YOLO format.
MATLAB
17
star
3

convert_caltech_annos_to_yolo

This script will convert caltech annotations into yolo format
Python
6
star
4

catboost-nids

Gradient Boosting Machine (XGBoost, CatBoost, RandomForest, Decision Tree, Scikit learn) based network intrusion detection method, on imbalanced CIC-IDS-2018 dataset
Jupyter Notebook
5
star
5

lightweight_facial_analysis

Face Detection, Facial Landmark Detection, Emotion Recognition and Hand Detection. Works even on resource constrained laptop/pc | GUI | User Interface
Python
3
star
6

receptivity

Python
2
star
7

Data-Sources-for-Data-Science

List of data sources where u can get specific dataset and use for your R&D
2
star
8

software_programming_in_python

repository for the python programming class 2022-2 Inha University
Jupyter Notebook
2
star
9

SurvTrack

Python
2
star
10

net_traffic_samplers

Network traffic sampler Sketch Guided Sampling, Packet Sampling, Random Sampling, Fast Filtered Sampling, Selective Flow Sampling
C++
2
star
11

WebCrawling4TrackingApp

tracking product prices on websites
Python
1
star
12

keyword_forcasting

Jupyter Notebook
1
star
13

breast-cancer-classification-tutorial

Notebook contains uci breast cancer classification tutorial for combria (2018) dataset. Cross Validation, Logistic Regression, SVM, Machine Learning, Feature Selection, PCA, correlation analysis
Jupyter Notebook
1
star
14

learn-data-science

Jupyter Notebook
1
star
15

monthly_masjid_contibutions

This repo intends to visualize monthly contributions and expenses of the Ashrafia Masjid @ Inha University South Korea
R
1
star