1 Star 0 Fork 0

yuxuecheng / YAD2K

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

YAD2K: Yet Another Darknet 2 Keras

license

Welcome to YAD2K

You only look once, but you reimplement neural nets over and over again.

YAD2K is a 90% Keras/10% Tensorflow implementation of YOLO_v2.

Original paper: YOLO9000: Better, Faster, Stronger by Joseph Redmond and Ali Farhadi.

YOLO_v2 COCO model with test_yolo defaults


Requirements

Installation

git clone https://github.com/allanzelener/yad2k.git
cd yad2k

# [Option 1] To replicate the conda environment:
conda env create -f environment.yml
source activate yad2k
# [Option 2] Install everything globaly.
pip install numpy h5py pillow
pip install tensorflow-gpu  # CPU-only: conda install -c conda-forge tensorflow
pip install keras # Possibly older release: conda install keras

Quick Start

  • Download Darknet model cfg and weights from the official YOLO website.
  • Convert the Darknet YOLO_v2 model to a Keras model.
  • Test the converted model on the small test set in images/.
wget http://pjreddie.com/media/files/yolo.weights
wget https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolo.cfg
./yad2k.py yolo.cfg yolo.weights model_data/yolo.h5
./test_yolo.py model_data/yolo.h5  # output in images/out/

See ./yad2k.py --help and ./test_yolo.py --help for more options.


More Details

The YAD2K converter currently only supports YOLO_v2 style models, this include the following configurations: darknet19_448, tiny-yolo-voc, yolo-voc, and yolo.

yad2k.py -p will produce a plot of the generated Keras model. For example see yolo.png.

YAD2K assumes the Keras backend is Tensorflow. In particular for YOLO_v2 models with a passthrough layer, YAD2K uses tf.space_to_depth to implement the passthrough layer. The evaluation script also directly uses Tensorflow tensors and uses tf.non_max_suppression for the final output.

voc_conversion_scripts contains two scripts for converting the Pascal VOC image dataset with XML annotations to either HDF5 or TFRecords format for easier training with Keras or Tensorflow.

yad2k/models contains reference implementations of Darknet-19 and YOLO_v2.

train_overfit is a sample training script that overfits a YOLO_v2 model to a single image from the Pascal VOC dataset.

Known Issues and TODOs

  • Expand sample training script to train YOLO_v2 reference model on full dataset.
  • Support for additional Darknet layer types.
  • Tuck away the Tensorflow dependencies with Keras wrappers where possible.
  • YOLO_v2 model does not support fully convolutional mode. Current implementation assumes 1:1 aspect ratio images.

Darknets of Yore

YAD2K stands on the shoulders of giants.


COPYRIGHT All contributions by Allan Zelener: Copyright (c) 2017, Allan Zelener. All rights reserved. All other contributions: Copyright (c) 2017, the respective contributors. All rights reserved. Each contributor holds copyright over their respective contributions. The project versioning (Git) records all such contribution source information. LICENSE The MIT License (MIT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

YAD2K: Yet Another Darknet 2 Keras 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yuxuecheng/YAD2K.git
git@gitee.com:yuxuecheng/YAD2K.git
yuxuecheng
YAD2K
YAD2K
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891