Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

sam_clip.py - Bug when handling the case where no detections above the confidence threshold are made #4

Open
masinov opened this issue Nov 17, 2023 · 0 comments

Comments

@masinov
Copy link

masinov commented Nov 17, 2023

The bug is located in the method "predict" of the class SAMCLIP in sam_clip.py

When building the list "nms_data", detection tuples are only appended to it if their corresponding bbox is found with a probability above the confidence threshold. If no such case is found, the list will be empty and therefore the method will send an empty array to the function sv.non_max_suppression (line 162), which then tries to unpack the array into rows and columns, raising a ValueError: not enough values to unpack (expected 2, got 1) exception.

It will save users a headache if you add an assertion to verify that nms_data is not empty before running non_max_suppression.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant