Skip to content

CharlesPikachu/YOLO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLO

A pytorch implementation of YOLOv1-v3.  
Project only supports python3.x.

To do

  • Test the model of YOLOv1.
  • Train the model of YOLOv1.
  • Test the model of YOLOv2.
  • Train the model of YOLOv2.
  • Test the model of YOLOv3.
  • Train the model of YOLOv3.
  • Data augmentation.
  • Using k-means to generate the priors.
  • Evaluate the model including mAP, precision, recall, etc.
  • Data of VOC format -> YOLO format.

Dependency

  • torch 0.3.1
  • opencv-python
  • torchvision
  • numpy
  • pillow
  • argparse

Train

Prepare

VOC -> YOLO

Data of VOC format(lxml) -> YOLO format(txt).
You can use the script in ./TOOL/voc2yolo.py to complete the work of conversion.
  • Usage
    • modify Line<13~15> according to your needs
    • run "python3 voc2yolo.py"

Get good priors

Run k-means clustering on the dimensions of bounding boxes to get good priors for our model.
You can use the script in ./TOOL/genPriors/genPriors.py to get the good priors.
  • Usage
    • modify the options.json according to your needs
    • run "python3 genPriors.py"

YOLOV1

preparing...

YOLOV2

Step1

pip install -r requirements.txt

Step2

modify the config.py-yolo2_options
  • set mode -> train
  • set weightfile -> darknet19_448.conv.23
  • set clsnamesfile -> coco.names, voc.names, etc.
  • set trainSet, testSet, cfgfile, gpus, ngpus, etc.

Step3

run "python3 train.py --version yolo2"

YOLOV3

Step1

pip install -r requirements.txt

Step2

modify the config.py-yolo3_options
  • set mode -> train
  • set weightfile -> darknet53.conv.74
  • set clsnamesfile -> coco.names, voc.names, etc.
  • set trainSet, testSet, cfgfile, gpus, ngpus, etc.

Step3

run "python3 train.py --version yolo3"

Test

YOLOV1

preparing

YOLOV2

Step1

modify the config.py-yolo2_options
  • set mode - test
  • set weightfile -> yolov2.weights
  • set clsnamesfile -> coco.names, voc.names, etc.

Step2

run "python3 detector.py --version yolo2"

YOLOV3

Step1

modify the config.py-yolo3_options
  • set mode - test
  • set weightfile -> yolov3.weights
  • set clsnamesfile -> coco.names, voc.names, etc.

Step2

run "python3 detector.py --version yolo3"

Eval

preparing

Reference

About

A pytorch implementation of YOLOv1-v3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages