0
Specific Error,
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() Are there anyone to explain why this error occur? Here is my code that I want to apply: https://code.sololearn.com/ca10a18a2277
14 Antworten
+ 1
Okey. I will try thanks for help.
0
I see that boxes_sorted is set equal to the sorted(boxes, ect...). Boxes is a parameter value, is it supposed to be a list or what? And of what exactly?
0
Boxes parameters seems as ndarray at now. Boxes include some of bounding box coordinates and their confidence scores. I mean, if the 10 boxes detected, boxes size will be equal to (10,5). Each box have their four coordinates value and score information.
0
Im just not sure of what input to provide. Have you though of making a box class? Then you can just keep all that info in each instance
0
It is a nms algorithm that is used for object detection. The aim of this function decrase to possible false detection by using their scores value and intersection over union value.
0
Right right, but Im still unsure of the input to provide. Its too specific. Thats why i suggested a class that can hold all those attributes and be a bit less confusing.
what is an example of input so i can run it and get the error you get?
0
Here is my input boxes:
[[104 72 64 64 0.337]
[120 88 64 64 0.496]
[200 104 64 64 0.0430]
[184 120 64 64 0.136]
[192.88 57.77 71.11 71.11 0]
[104 75.55 71.11 71.11 0.363]
[175.11 111.11 71.11 71.11 0.038]
[183.01 40 79.01 79.01 0.477]
[104 59.75 79.01 79.01 0.36]
[169.84 105.84 87.79 87.79 1]]
And here is the error I get:
bbox_list_thresholded.remove(box) # If there is significant overlap, then remove the box
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
0
okay, its a list. So you could find the index of the box you want to remove and call .pop(<index>) on the list
0
Do yo mean that I need to change (bbox_list_thresholded.remove(box)) line as (bbox_list_thresholded.pop(box))
0
No, cause i dont know what value "box" holds. All im saying is, if you want to remove the first box in the list:
box_list.pop(0)
0
Well if I convert the box list to numoy array. Then, can I use remove instead of pop ?
0
Not sure, but its not working now. Popping the index will though
0
Well, How can I reach the index of box to use .pop() command
0
Write another function to look for certain values in a list. If values are found, return the index. You can use that function inside of pop and it will pop the chosen index