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

Add dnn darknet support #372

Open
marcinpastuszka opened this issue Aug 6, 2018 · 6 comments
Open

Add dnn darknet support #372

marcinpastuszka opened this issue Aug 6, 2018 · 6 comments

Comments

@marcinpastuszka
Copy link

marcinpastuszka commented Aug 6, 2018

Hello,
Please add bindings for dnn darknet support:
Commit (changes based on caffe bindings)

Example in cpp/python
Works fine, but to be honest I don't understand how this module works, so if you can prepare an example for using it in node.js it will be great.

Thanks,
Marcin

@justadudewhohacks
Copy link
Owner

Does one have to compile OpenCV with darknet support in order to import darknet models? If not then feel free to open a PR for your changes and I will try it out some time.

@marcinpastuszka
Copy link
Author

marcinpastuszka commented Aug 6, 2018

Hello, compilation of the whole OpenCV is not needed. I used the 3.4.2 one and with this bindings. Reading from darknet files is working fine and native method runs correctly, so I will open PR ;)
I just have problem to use the output from this net (to be honest I'm really noob in OpenCV)

Sorry, I'm using 3.4.2 version :)

@justadudewhohacks
Copy link
Owner

Okay. Which model are you importing, yolo v1, v2, v3?

@marcinpastuszka
Copy link
Author

Yolov3

@justadudewhohacks
Copy link
Owner

Okay, I will try it out once you submitted a PR. Not sure about yolo v3, but v2 should return a Matrix of batchSize x gridX x gridY x number of anchors * (5 + numClasses).

An image is divided into a grid of gridX x gridY number of cells, where a cell is usually of size 32 x 32. For each cell you have N bounding box predictions (where N is the number of anchors). A bounding box prediction is encoded by center x, center y (relative to the cell position), width, height(relative to the anchor box size), confidence score, + class scores for each class.

Not sure if OpenCV is doing something under the hood here for post processing, I will have to try it out.

@marcinpastuszka
Copy link
Author

Thanks for explanation :)

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

2 participants