wenxichen / tensorflow_yolo2

A Tensorflow version of YOLO2 and its extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README

Coming Next: better trained darknet19 model, and easier to use detection tool, (better explanation for dataset folder placement for training), Documentation for nips2017 adversarial defence challenge techniques

Scripts

Open terminal in the home directory of the project. Then you can:

  • use darknet19 to detect: python src/pascal/pascal_detect_darknet.py
    • first, put pascal trained darknet19 weights into weights/ directory (since the model has been only trained for 80k iterations, the accuracy might not be optimal)
    • change the image_path variable to the image you want to do detection on
  • train darknet19 on ImageNet: python src/imagenet/imagenet_train_darknet.py
    • first, put ILSVRC dataset into data/ folder
    • the implementation is multithread, though it might not be optimized enough. Sugguestions are welcome.
  • train tensorflow slim resnet50 on Pascal: python src/pascal/pascal_train_resnet.py
  • train darkent19 on Pascal: python src/pascal/pascal_train_darknet.py
    • currently, this only support imagenet darknet19 ckpt trained locally using the command above. (i.e., the download weight may not work; however you may try to put the download weight into ckpt directory with proper path, I suspect this would work)
    • put VOCdevkit dataset into data/ folder

Resources

Trained tensorflow model ckpts:

  • tensorflow slim resnet50 further trained on Pascal VOC2007
  • darknet19 trained on ImageNet for 88 epochs (validation accuracy ~60)
  • darknet19 trained on Pascal VOC2007 (only for 80k iterations, the accuracy might not be optimal)

ImageNet Challenge class labels:

  • Since the networks are not primary for classification, the original labels produced by the trained models does not match the official ilsvrcids for ImageNet Challenge. However, the synset names are consistent. I have created a map from synset names to ilsvrcids at src/img_dataset/syn2ilsid_map.pickle. Or you can create your own map using src/img_dataset/magenet_lsvrc_2015_synsets.txt.

References

  • Darknet19 is built according to YOLO1 and YOLO2 paper by J. Redmon et al.

About

A Tensorflow version of YOLO2 and its extensions

License:MIT License


Languages

Language:Python 91.8%Language:Jupyter Notebook 6.6%Language:Shell 1.6%