diff --git a/run_ssd_live_demo.py b/run_ssd_live_demo.py index 9a3fcfc3..52c0ae42 100644 --- a/run_ssd_live_demo.py +++ b/run_ssd_live_demo.py @@ -73,10 +73,10 @@ for i in range(boxes.size(0)): box = boxes[i, :] label = f"{class_names[labels[i]]}: {probs[i]:.2f}" - cv2.rectangle(orig_image, (box[0], box[1]), (box[2], box[3]), (255, 255, 0), 4) + cv2.rectangle(orig_image, (int(box[0]), int(box[1])), (int(box[2]), int(box[3])), (255, 255, 0), 4) cv2.putText(orig_image, label, - (box[0]+20, box[1]+40), + (int(box[0])+20, int(box[1])+40), cv2.FONT_HERSHEY_SIMPLEX, 1, # font scale (255, 0, 255),