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

Negative values for some coordinates #30

Closed
alexandru-dinu opened this issue Jun 10, 2018 · 1 comment
Closed

Negative values for some coordinates #30

alexandru-dinu opened this issue Jun 10, 2018 · 1 comment

Comments

@alexandru-dinu
Copy link

alexandru-dinu commented Jun 10, 2018

What is the reason of having negative values for some coordinates, when converting from
(center x, center y, width, height) to (x1, y1, x2, y2) (in non_max_suppresion function)?

For example, the values for x1 coordinates are calculated as:
box_corner[:, :, 0] = prediction[:, :, 0] - prediction[:, :, 2] / 2 and there are some negative values here.

box_corner[:, :, 0] <= 0 boils down to sigmoid(tx) + grid_x <= anchor_w * exp(tw) / 2.

How can this happen?

Thanks!

@eriklindernoren
Copy link
Owner

eriklindernoren commented Jun 10, 2018

There is not really a reason for having the model output negative values for the corner coordinates. It is of course penalized for doing so during training (since there won't be negative values occuring in the label set) but there is no explicit restriction set in place to hinder the model from outputting them. You could map negative values to zero if this is a problem for your use case.

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