Python code confidence is an array not a number
Upon running the python code I am getting:
if confidence >= 0.4:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
And when trying condfidence.any() it won't work as well. Any advice?
have u found a solution?
pip uninstall opencv-python pip install opencv-python==4.5.5.62
Nope
On Tue, 6 Sept 2022 at 00:20, hasimiali @.***> wrote:
have u found a solution?
— Reply to this email directly, view it on GitHub https://github.com/doleron/yolov5-opencv-cpp-python/issues/20#issuecomment-1237499833, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFA3ZIY4U5UZ7TMAXQB5B3LV4ZW3DANCNFSM6AAAAAAQFHTDMI . You are receiving this because you authored the thread.Message ID: @.***>
Hi, I had the same problem, solved with:
pip uninstall opencv-python pip install opencv-python==4.5.4.58
my numpy version is 1.23.3 running on Win 10 with python 3.8.10
Upon running the python code I am getting:
if confidence >= 0.4: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()And when trying
condfidence.any()it won't work as well. Any advice?
i've done
when you call
wrap_detection(input_image = img, output_data=output_data[0])
don't forget to get only array [0] in output_data