• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

jmpap/YOLOV2-Tensorflow-2.0: Just another YOLO V2 implementation. Train your own ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

jmpap/YOLOV2-Tensorflow-2.0

开源软件地址:

https://github.com/jmpap/YOLOV2-Tensorflow-2.0

开源编程语言:

Jupyter Notebook 100.0%

开源软件介绍:

YOLO V2 with TensorFlow 2.0

Here is a jupyter notebook featuring a complete implementation from scratch of YOLOV2 with TensorFlow 2.0 :

  • Dataset pipeline with data augmentation
  • Training from YOLO pretrained weights
  • Visualization of object detection

I use this notebook to train a model to detect crop and weeds in a field. The goal is to detect crop in real time for tractor guidance and to detect weeds to remove them.

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

Files

  • Yolo_V2_tf_2.ipynb : Yolo V2 implementation with Tensorflow 2.0
  • Yolo_V2_tf_eager.ipynb : old notebook, Yolo V2 implementation with Tensorflow 1.x with eager execution

Requirements

  • tensorflow 2.0
  • imgaug
  • cv2

Before using the notebook

  • Download pretrained weights here. Place this weights file in notebook directory and name it yolo.weights
  • The training requires four directories containing images and annotations :

train_image_folder/ : contains images files used during training (png format)

train_annot_folder/ : contains annotations in PASCAL VOC format (one xml file for each image)

val_image_folder/ : contains images files used for validation

val_annot_folder/ : contains annotations in PASCAL VOC format

Using the notebook

  • Define object's labels to detect (same labels as defined in PASCAL VOC xml file). Example :
	LABELS           = ('sugarbeet', 'weed')
  • Define image size in dataset and YOLO grid size. Image size must be YOLO grid size * 32.
	IMAGE_H, IMAGE_W = 512, 512
	GRID_H,  GRID_W  = 16, 16 # GRID size = IMAGE size / 32
  • Define train batch size and validation batch size : depends on image size and video card RAM.
	TRAIN_BATCH_SIZE = 10
	VAL_BATCH_SIZE   = 10
  • Define path to dataset directories.
	# Train and validation directories

	train_image_folder = 'data/train/image/'
	train_annot_folder = 'data/train/annotation/'
	val_image_folder = 'data/val/image/'
	val_annot_folder = 'data/val/annotation/'

That's it, just run notebook cells to train YOLO on your own data!

Example of use

YOLO model trained on sugarbeet and weed dataset (two labels) :

Credits

Many thanks to these great repositories:

https://github.com/experiencor/keras-yolo2

https://github.com/allanzelener/YAD2K

and to this very good explanation of the YOLO V2 loss function:

https://fairyonice.github.io/Part_4_Object_Detection_with_Yolo_using_VOC_2012_data_loss.html




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap