YAD2K: Yet Another Darknet 2 Keras



网址:https://github.com/allanzelener/YAD2K

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
每天前100人再送5门编程课! AI+5门300元课程+社群闭门分享会源码开源下载:https://github.com/DjangoPeng/keras-101/tree/master/code_samples 【为什么学AI】 归功于近年来大规模数据和硬件计算能力的大幅度提升,人工智能的概念近两年一直是市场追捧的对象。目前各大厂都争先恐后地布局AI,落地各类AI的的商业应用,也随之打响了一场激烈的人才争夺战。长远来看,越快将 AI 用于自己的工作中就能越早体会到AI带来的收益。 【讲师介绍】 彭靖田 Google Developer Experts。 曾为 TensorFlow Top级 的贡献者,著书《深入理解TensorFlow》,是国内第一本深度剖析 Google AI 框架的畅销书。 曾从0到1深入参与了华为 2012 实验室深度学习平台和华为深度学习云服务的设计与研发工作。 【课程设计】 课程内容基于最新的Keras版本(你也可以使用 TensorFlow 2 的 tf.keras 模块),其中有大量独家解读、案例,以及不少讲师一线实战多年的方法论和深度思考。同时,在层次划分上,难易兼顾,循序渐进。既有核心的基础知识,也有高级的进阶操作,尽量做到“老少皆宜”。 课程分为基础篇、入门篇和实战篇: 一、基础篇: 主要讲解人工智能发展史和深度学习脱颖而出的原由,以及神经网络的基础概念、理论实现、优化原理和计算方法。 二、入门篇: 主攻快速上手,通过7个小节让你从0到1实现环境搭建、模型优化,直接试水2个实战项目。同时,增强AI的理论学习,系统掌握机器学习3大分支、模型评估方法、数据预处理常用手段与过拟合问题的解决方案。 三、实战篇: 通过4个实战全面掌握深度学习理论与实现,涵盖目标检测、图像分类、可视化和可解释性学习、迁移学习、特征提取、数据增强等。带你综合运用前面所学的所有知识,逐渐熟练AI开发流程与技能。 课程包含思维导图上的所有内容(价值199元)前500名立减100元,仅99元买完就能学!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值