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

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() #150

Open
dongfeicui opened this issue May 11, 2023 · 0 comments

Comments

@dongfeicui
Copy link

dongfeicui commented May 11, 2023

Before proposing this issue, plz search the existed issues by your keywords first.

Describe the bug
I get the same error in both FaceBoxes/FaceBoxes.py line 133 and FaceBoxes/FaceBoxes_ONNX.py line 138.
The program cannot determine the value. Because the variable b is two-dimensional and cannot be compared with a scalar variable vis_thres.

To Reproduce
Case 1
python3 demo.py -f examples/inputs/emma.jpg -o 3d.
Case2
python3 demo_video.py -f examples/inputs/videos/214.avi -o 3d

Expected behavior
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Screenshots
image

Platform:

  • Windows

Additional context
Add any other context about the problem here.
I modified the code as the follow:
In FaceBoxes/FaceBoxes.py line 133 I change for b in dets: => for b in dets.squeeze(0):
In FaceBoxes/FaceBoxes_ONNX.py line 138 I change for b in dets: => for b in dets.squeeze(0):
If used in older numpy, please use np.squeeze(dets, 0)

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

No branches or pull requests

1 participant