yolo in caffe

3,411 views
Skip to first unread message

Jeremy Rutman

unread,
Mar 21, 2016, 5:42:34 AM3/21/16
to Caffe Users
Has anyone gone and implemented yolo in caffe?

I ran across  a fork https://github.com/handong1587/caffe-yolo  but there are no instructions or docs it seems.
Is it an active branch? Last update was Dec. 2015.

Dmytro Prylipko

unread,
Mar 28, 2016, 11:10:27 AM3/28/16
to Caffe Users
I am also interested in YOLO for Caffe. Is it usable?

Yassine Bezza

unread,
Apr 14, 2016, 2:51:32 AM4/14/16
to Caffe Users
Hello,

I found this but I did not test it yet.

https://github.com/MelodyHai/caffe-yolo
Message has been deleted

Xing Wang

unread,
May 20, 2016, 8:34:47 PM5/20/16
to Caffe Users
You may want to check this out 

在 2016年3月21日星期一 UTC-7上午2:42:34,Jeremy Rutman写道:

Hugo Feng

unread,
May 24, 2016, 4:39:44 AM5/24/16
to Caffe Users
Hey Wang,

Impressed! In terms of the weight file you mentioned, how do you convert from the darknet model? Anything worth a heads up?
Since darknet inputs distributes from -1 to 1, while caffe uses mean image substraction, so how do they fit into the convertion? Any preprocessing you added?
Thank you!

Hugo

在 2016年5月21日星期六 UTC+8上午8:34:47,Xing Wang写道:

Xing Wang

unread,
May 25, 2016, 1:24:17 AM5/25/16
to Caffe Users
Hi, Hugo,

Thanks ! 

If you use caffe io to load image, in fact, the loaded image is in [0, 1], quoted from caffe io 
"While Python represents images in [0, 1], certain Caffe models like CaffeNet and AlexNet represent images in [0, 255]"

Mean image subtraction is  necessary for ImageNet models, but not here. 

According to the yolo source code, I think yolo only requires the input image to be in [0, 1], but not [-1, 1].

For caffemodel part, I directly read the darknet model and stored it into a caffemodel without any modification.

Xing


在 2016年5月24日星期二 UTC-7上午1:39:44,Hugo Feng写道:

yaxi Wu

unread,
May 26, 2016, 11:28:20 AM5/26/16
to Caffe Users
Hi, Xing,

Thanks for your yolo in caffe. It is really wonderful!

I haven't figured out how to convert darknet model into a caffemodel. Did you use a tool or write a script to complete this? Would you give me some advice about it?

Thank you!

Yaxi 

在 2016年5月25日星期三 UTC+8下午1:24:17,Xing Wang写道:

Hugo Feng

unread,
May 30, 2016, 10:36:26 AM5/30/16
to Caffe Users
Thank you Wang! That helps me a lot~


在 2016年5月25日星期三 UTC+8下午1:24:17,Xing Wang写道:
Hi, Hugo,

Xing Wang

unread,
May 31, 2016, 2:45:58 PM5/31/16
to Caffe Users
Hi, Yaxi,

I updated the repository and added a create_yolo_caffemodel.py to create caffemodel files from yolo's (.weights) files.
Hope it helps.

Xing 

在 2016年5月26日星期四 UTC-7上午8:28:20,yaxi Wu写道:

yaxi Wu

unread,
Jun 1, 2016, 10:28:51 PM6/1/16
to Caffe Users
Hi, Xing,

Thank U!  It really helps me a lot.

Yaxi

ofir liba

unread,
Jun 14, 2016, 8:34:18 AM6/14/16
to Caffe Users
Hi Xing,
I'm trying to convert AlexNet from Darknet to Caffe by using your script "create_yolo_caffe_model.py" . 
To do that I need to convert first alexnet.cfg to caffe prototext file. could you explain how you did the conversion for Yolo ( cfg-->prototext) ? when I do it , i encounter some problems.
 
Tx,
Ofir

banerje...@gmail.com

unread,
Jun 21, 2016, 9:02:49 AM6/21/16
to Caffe Users
Hi Xing,

Thank you so much for the scripts -- it is excellent. Can you please explain the line:

offset = np.transpose(np.reshape(np.array([np.arange(7)]*14),(2,7,7)),(1,2,0))

in yolo_main.py

I am confused with the number 14.

Thanks and regards,

Serene

Lucas Thom

unread,
Aug 19, 2016, 4:35:40 PM8/19/16
to Caffe Users
Hey Xing,

Is this right?

probs = np.zeros((grid_size,grid_size,num_box,num_class))
class_probs = np.reshape(output[0:(grid_size*grid_size*(num_box*5+num_class)/3*2)],(grid_size,grid_size,num_class))
scales = np.reshape(output[(grid_size*grid_size*(num_box*5+num_class)/3*2):(grid_size*grid_size*(num_box*5+num_class)/3*2)+grid_size*grid_size*num_box],(grid_size,grid_size,num_box))
boxes = np.reshape(output[(grid_size*grid_size*(num_box*5+num_class)/3*2)+grid_size*grid_size*num_box:],(grid_size,grid_size,num_box,num_box*num_box))
offset = np.transpose(np.reshape(np.array([np.arange(grid_size)]*grid_size*num_box),(num_box,grid_size,grid_size)),(1,2,0))

NM

unread,
Sep 12, 2016, 6:39:07 PM9/12/16
to Caffe Users
Hi,

Does this now have training included as well? Im looking to train YOLO on caffe 

Thanks 

Rishabh Gupta

unread,
Jan 23, 2017, 9:21:19 AM1/23/17
to Caffe Users
Hey all so I followed steps from https://github.com/xingwangsfu/caffe-yolo using cfg/yolov1/yolo.cfg  but I encounter the following error 

ERROR:root:local layer is not supported
ERROR:root:detection layer is not supported
can anyone please help me with that .
Thanks

tone...@gmail.com

unread,
Apr 26, 2017, 11:15:33 PM4/26/17
to Caffe Users
Someone may have a look at https://github.com/yeahkun/caffe-yolo and https://github.com/choasUp/caffe-yolo9000 , if you prefer not to use Python.
However, their projects are flawed. At least they have achieved their goal by modifying Caffe itself, and this will be a problem with many users by (1) implicitly fixing the version YOLO can apply to to 1.0.0-rc3 instead of the newest version possible; (2) using many POSIX-onlly functions that may fail to compile under Windows.

Lin Jay

unread,
Jul 14, 2017, 12:32:52 PM7/14/17
to Caffe Users
i found someone implemented yolov2 on caffe version, seems which is reference from yeahkuns work on v1.

from https://github.com/karta0807913/caffe-yolo-9000 it works fine for me.


Jeremy Rutman於 2016年3月21日星期一 UTC+8下午5時42分34秒寫道:

zenge...@gmail.com

unread,
Jul 28, 2017, 3:51:18 AM7/28/17
to Caffe Users
@Lin Jay. hi
Can this project train the yolov2 network? and what about the accuracy compare to darknet's training?

在 2017年7月15日星期六 UTC+8上午12:32:52,Lin Jay写道:
Reply all
Reply to author
Forward
Message has been deleted
0 new messages