Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to modifly code for custom yolo? #5

Open
ashwinnair14 opened this issue Dec 18, 2017 · 4 comments
Open

How to modifly code for custom yolo? #5

ashwinnair14 opened this issue Dec 18, 2017 · 4 comments

Comments

@ashwinnair14
Copy link

ashwinnair14 commented Dec 18, 2017

files_to_test.zip
Hi @duangenquan @ichigoi7e ,

I have trained a custom yolo model with only 4 classes and which has a different structure than yolo.
I have attached the cfg and weights and also the NCS graph to test. Tested with the person image from darknet.

When I modify the python code to set self.classes = 4 I dont get any outputs on the script(ObjectWrapper.py).

But when I run the same model and image on the original darknet I get this output.

Is there an easy way to change the C++ or the python code ? or do I need to rewrite it?

Thanks

layer     filters    size              input                output
   conv     12  3 x 3 / 2   416 x 416 x   3   ->   208 x 208 x  12
..
..
.
.
.
.
   conv     45  1 x 1 / 1    13 x  13 x 100   ->    13 x  13 x  45
   detection
mask_scale: Using default '1.000000'
Loading weights from 8.weights...Done!
data/person.jpg: Predicted in 0.001252 seconds.
person: 100%
motorbike: 82%

@necusjz
Copy link
Contributor

necusjz commented Dec 18, 2017

Please modify the C++ code ./src/Region.cpp as well, refer to Update parameters section in README.

@ashwinnair14
Copy link
Author

@ichigoi7e Thanks but I was unable to understand the paramater
I guess self.blockwd = 12 is the the lastConv layer lenght - 1?

Whats the paramater targetBlockwd ?
Cause I dont get expected outputs no matter what I try ?
for the person image I was 100% score on the darknet platform.

@necusjz
Copy link
Contributor

necusjz commented Dec 19, 2017

@ashwinnair14
The exact values of these parameters are related to your code on the darknet platform.
For example, how many grids do you divide a picture into?
Please read your previous code carefully.

@duangenquan
Copy link
Owner

@ashwinnair14 , blockwd and targetBlockwd are used to rectify detection results a little bit, because the converted caffe model from yolo generates smaller blocks sometimes.
please set blockwd as the block numbers running on stick, and targetBlockwd from darknet models.

BTW, you can also tune other parameters in caffe cfg, such as pad, to generate the same block dimensions as darknet models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants