CVHub520 / X-AnyLabeling

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

imdecode error in opencv-contrib-python-headless 4.10.0.84 #676

Closed gboeer closed 1 month ago

gboeer commented 1 month ago

Search before asking

X-AnyLabeling Component

No response

Bug

With the recent version of 4.10.0.84 of opencv-contrib-python-headless, starting the app results in the following error.

Error in predict_shapes: OpenCV(4.10.0) :-1: error: (-5:Bad argument) in function 'imdecode'
> Overload resolution failed:
>  - buf is not a numpy array, neither a scalar
>  - Expected Ptr<cv::UMat> for argument 'buf'

This version will get installed because of the requirement: opencv-contrib-python-headless>=4.7.0.72

The error can be resolved by switching back to version 4.7.0.72 with: pip install opencv-contrib-python-headless==4.7.0.72

Information

Application Information: {'App name': 'X-AnyLabeling', 'App version': '2.4.4', 'Device': 'CPU'}

System Information: {'CPU': 'x86_64', 'CUDA': 'V12.1.105', 'GPU': '0, NVIDIA GeForce RTX 2080 Ti, 11264, 1, NVIDIA GeForce RTX 2080 Ti, ' '11264, 2, NVIDIA GeForce RTX 2080 Ti, 11264, 3, NVIDIA GeForce RTX ' '2080 Ti, 11264, 4, NVIDIA GeForce RTX 2080 Ti, 11264, 5, NVIDIA ' 'GeForce RTX 2080 Ti, 11264, 6, NVIDIA GeForce RTX 2080 Ti, 11264, 7, ' 'NVIDIA GeForce RTX 2080 Ti, 11264, 8, NVIDIA GeForce RTX 2080 Ti, ' '11264, 9, NVIDIA GeForce RTX 2080 Ti, 11264', 'Operating System': 'Linux-6.8.0-45-generic-x86_64-with-glibc2.35', 'Python Version': '3.10.12'}

Package Information: {'ONNX Runtime GPU Version': '1.18.0', 'ONNX Runtime Version': '1.19.2', 'ONNX Version': '1.17.0', 'OpenCV Contrib Python Headless Version': '4.10.0.82', 'PyQt5 Version': '5.15.7'}

Link to a Reproducible Demonstration Video

None

Execution Mode

Pre-compiled Executable

Additional

No response

Are you willing to submit a PR?

CVHub520 commented 1 month ago

Thank you for reporting this bug. We appreciate your detailed description of the problem and the steps you've taken to identify it.

I've tested the application on Python versions 3.8 through 3.12, using the default installation from requirements.txt (which installs opencv-contrib-python-headless==4.10.0.84). However, in my tests, the application runs normally without encountering the error you described.

Anyway, thank you again for bringing this to our attention. We're committed to ensuring the software works smoothly across different environments.

gboeer commented 1 month ago

Yes I in a fresh install I also did not see this error now, I believe it may have been caused by another pytorch vision, not sure though.