[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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 unhandled negative resize augmentation #8565

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

jonesmwhv
Copy link

Changes

  • Fix unhandled negative resize augmentation
  • Propagate OpenCV errors back to C logger

Summary

Fixes a rare bug when augmenting an image relative to model resolution. It was possible to attempt to augment an image to have negative width or height.

When this is handled in OpenCV the augment fails, and this error is produced (but was swallowed):

OpenCV can't augment image: 736 x 416 
OpenCV(4.2.0) ../modules/core/src/matrix.cpp:235: error: (-215:Assertion failed) s >= 0 in function 'setSize'

The Mat is then freed, and Darknet doesn't recreate a fresh one, causing the loss to jump up (effectively breaking the training) as the Mat is no longer updated.
chart

@cenit cenit merged commit 640edd2 into AlexeyAB:master Sep 1, 2023
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

Successfully merging this pull request may close these issues.

2 participants