CVHub520 / X-AnyLabeling

Effortless data labeling with AI support from Segment Anything and other awesome models.
GNU General Public License v3.0
3.02k stars 342 forks source link

Error with cv2.findContours() function #439

Closed DoongLi closed 1 month ago

DoongLi commented 1 month ago

errors below: python anylabeling/app.py WARNING:root:Could not inference model WARNING:root:too many values to unpack (expected 2) Traceback (most recent call last): File "/home/doongli/X-AnyLabeling/X-AnyLabeling/./anylabeling/services/auto_labeling/segment_anything.py", line 263, in predict_shapes shapes = self.post_process(masks, cv_image) File "/home/doongli/X-AnyLabeling/X-AnyLabeling/./anylabeling/services/auto_labeling/segment_anything.py", line 129, in postprocess contours, = cv2.findContours( ValueError: too many values to unpack (expected 2) WARNING:root:Could not inference model WARNING:root:too many values to unpack (expected 2) Traceback (most recent call last): File "/home/doongli/X-AnyLabeling/X-AnyLabeling/./anylabeling/services/auto_labeling/segment_anything.py", line 263, in predict_shapes shapes = self.post_process(masks, cv_image) File "/home/doongli/X-AnyLabeling/X-AnyLabeling/./anylabeling/services/auto_labeling/segment_anything.py", line 129, in postprocess contours, = cv2.findContours( ValueError: too many values to unpack (expected 2) WARNING:root:Could not inference model WARNING:root:too many values to unpack (expected 2)

Solution below: (It is best to refer to https://github.com/cvhub520/x-anylabeling/isSues/378 new virtual environment) then: pip uninstall opencv-contrib-python-headless pip install opencv-contrib-python-headless==4.7.0.72

CVHub520 commented 1 month ago

Thank you for reporting this issue and providing a potential solution to the issue.