YOLO(You Only Look Once):Real-Time Object Detection

caffe-yolo:https://github.com/xingwangsfu/caffe-yolo

YOLO in caffe

Update 12-05-2016: Currently, only yolo v1 (http://pjreddie.com/darknet/yolov1/) is supported. Yolo V2 (http://pjreddie.com/darknet/yolo/) is not supported. Batch norm layer is supported.

Introduction

This is a caffe implementation of the YOLO:Real-Time Object Detection

Note, the caffe models are not trained in caffe, but converted from darknet's (.weight) files (http://pjreddie.com/darknet/yolov1/).

The converter is consisted of four steps:

  • create .prototxt files for caffe from .cfg file in darkent
  • initialize the caffe network and weights from .prototxt file
  • read the weights from pre-trained darknet's (.weight) file
  • replace the initialized weights with the weights in pre-trained darkenet's (.weight) file

Usage

  • run "create_yolo_prototxt.py" to create .prototxt files
  • run "create_yolo_caffemodel.py" to create .caffemodel files
  • run "yolo_main.py" to call yolo in caffe

Convert yolo's (.weight) files to caffemodel

  • first, you need to download the pretrained yolo weight files (http://pjreddie.com/darknet/yolov1/) and .cfg files (https://github.com/pjreddie/darknet/tree/master/cfg/yolov1)

  • run create_yolo_prototxt.py to create .prototxt files

  • after that, run create_yolo_caffemodel.py to create the caffemodel from yolo's (.weight) files

    • "python create_yolo_caffemodel.py -m train_val_prototxt.filename -w yoloweights_filename -o caffemodel_filename"

    replace train_val_prototxt.filename with /your/path/to/yolo_train_val.prototxt (yolo_small, yolo_tiny), yoloweights_filename with /your/path/to/yolo.weights (yolo-small, yolo-tiny), and caffemodel_filename with your output caffemodel name,

    e.g. "python create_yolo_caffemodel.py -m yolo_train_val.prototxt -w yolo.weights -o yolo.caffemodel"

Main file usage

run yolo_main.py to do yolo object detection for the input image

  • "python yolo_main.py -m model_filename -w weight_filename -i image_filename"

replace model_filename with /your/path/to/yolo_small_deploy.prototxt or yolo_tiny_deploy.prototxt, weight_filename with /your/path/to/yolo_tiny.caffemodel or yolo_small.caffemodel and image_filename with the target image file

Requirements

  • Caffe, pycaffe

  • Opencv2

Copyrights

According to the LICENSE file of the original code,

  • Me and original author hold no liability for any damages

  • Do not use this on commercial!

转载于:https://www.cnblogs.com/ystwyfe/p/7942953.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值