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

Padding only applied to first bounding box if needed #33

Open
geloescht opened this issue Oct 11, 2021 · 3 comments
Open

Padding only applied to first bounding box if needed #33

geloescht opened this issue Oct 11, 2021 · 3 comments

Comments

@geloescht
Copy link

From scanning the code I can detect a possible error that could result in subtle mispredictions.
When a bounding box overlaps the top or left edge of the input image (why not bottom and right?), the image is padded with 40 pixels in line https://github.com/justinshenk/fer/blob/1810e3e895bc10853872689c88961f11c19f6a00/src/fer/fer.py#L219 and the corresponding bounding box adjusted accordingly. Unfortunately the padding is permanent but the adjustment only applied to this one bounding box. All following bounding boxes will be out of alignment with the padded image. Also if another bounding box also overlaps the former top or left edge, the image will be padded again.
A solution would be to do an in-place adjustment to all bounding boxes when the padding happens.

@JustinShenk
Copy link
Owner

Thanks for catching this and opening the issue. Indeed, these should be fixed. I don't have time for a complete solution, but does #34 look alright to you?

@geloescht
Copy link
Author

I guess that should work, unless always applying padding somehow slows down detection too much. Someone with experience in using this repository should test that, I might not have the time to use it as much as I thought I would. Thanks for the quick reaction!

@JustinShenk
Copy link
Owner

JustinShenk commented Oct 13, 2021 via email

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