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

Use MPF_BAD_FRAME_SIZE instead of MPF_DETECTION_FAILED for OpenCV empty/resize exception #1337

Closed
jrobble opened this issue May 24, 2021 · 1 comment
Assignees
Milestone

Comments

@jrobble
Copy link
Member

jrobble commented May 24, 2021

When the OpenCV DNN component gets a zero-size detection from the previous stage it will generate a job error like the following:

            {
               "source": "DNNCV",
               "code": "DETECTION_FAILED",
               "message": "OpenCV raised an exception while trying to get detections from video: OpenCV(4.5.0) /tmp/opencv/opencv-4.5.0/modules/imgproc/src/resize.cpp:4051: error: (-215:Assertion failed) !ssize.empty() in function 'resize'\n (Frames: 20453 - 31576)"
            }

After discussion, it may be best to address this in the WFM by removing zero-sized detections from tracks before generating segments for the next stage.

This should instead use the MPF_BAD_FRAME_SIZE error code when the exception is thrown due to a resize call. That will allow end users to make a more informed decision about what to do since MPF_DETECTION_FAILED is a generic catch-all error code.

Look for other instances where the resize call is made in other components.

@jrobble jrobble added this to the Milestone 2 milestone May 24, 2021
@jrobble jrobble self-assigned this May 24, 2021
@jrobble jrobble added this to To do in OpenMPF: Development via automation May 24, 2021
@jrobble jrobble moved this from To do to Planned in OpenMPF: Development May 24, 2021
@jrobble jrobble assigned clnowacki and unassigned jrobble Jun 4, 2021
@clnowacki clnowacki moved this from Planned to In Progress in OpenMPF: Development Jun 4, 2021
@clnowacki
Copy link
Member

clnowacki commented Jun 16, 2021

As an extra measure, update the workflow manager DetectionPaddingProcessor to remove any zero-size detections from tracks before padding. See #1353.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants