def findGun(outputs,img):
ht , wt , ct = img.shape
bbox = []
classIDs = []
confs = []
for output in outputs:
for det in outputs:
scores = det[5:]
classID = np.argmax(scores)
confidence = scores[classID]
if confidence > confThreshold:
w,h = int(det[2]*wt),int(det[3]*ht)
x , y = int((det[0]*wt) - w/2),int((det[1]*ht) - h/2)
bbox.append([x,y,w,h])
classIDs.append(classID)
confs.append(float(confidence))
Traceback (most recent call last): File "yolo.py", line 46, in findGun(outputs,img) File "yolo.py", line 26, in findGun if confidence > confThreshold: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()