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

Fix calculations of output #2

Closed
daddydrac opened this issue Dec 4, 2019 · 0 comments
Closed

Fix calculations of output #2

daddydrac opened this issue Dec 4, 2019 · 0 comments

Comments

@daddydrac
Copy link
Owner

daddydrac commented Dec 4, 2019

Math formula that will correct output goes in “darkchocolate” key in JSON, on line 18 in dark_chocolate.py file:

   x_center, y_center = ( left + bbox_width / 2, top + bbox_height / 2)
                    # darknet expects relative values wrt image width & height
                    x_rel, y_rel = (x_center / width, y_center / height)
                    w_rel, h_rel = (bbox_width / width, bbox_height / height)
                    Output: (cat_id, x_rel, y_rel, w_rel, h_rel)
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

1 participant