I have detected my object :
indexes = cv2.dnn.NMSBoxes(boxes, confidences, 0.7, 0.4) font = cv2.FONT_HERSHEY_PLAIN colors = np.random.uniform(0, 255, size=(len(boxes))) results = [] # drawing if(len(indexes))>0: for i in indexes.flatten(): (x, y) = (boxes[i][0], boxes[i][1]) (w, h) = (boxes[i][2], boxes[i][3]) label = str(classes[class_ids[i]]) confidence = str(round(confidences[i], 2)) color = colors[i] cv2.rectangle(img, (x, y), (x + w, y + h), color, 2) cv2.putText(img, label + " " + confidence, (x, y -5), font, 1, (0, 0, 0), 2) results.insert(i,label)
the label detected is getting stored in result but its storing one object