问题如下:
File "D:\rotation-yolov5-master\detect.py", line 173, in <module>
detect()
File "D:\rotation-yolov5-master\detect.py", line 78, in detect
pred = rotate_non_max_suppression(pred, opt.conf_thres, opt.iou_thres, classes=opt.classes, agnostic=True)
File "D:\rotation-yolov5-master\utils\general.py", line 869, in rotate_non_max_suppression
i = nms(boxes, scores)
File "D:\rotation-yolov5-master\utils\general.py", line 797, in nms
rotate_ious = rotate_iou(max_iou_boxes[-1], sort_boxes[1:])
File "D:\rotation-yolov5-master\utils\general.py", line 710, in rotate_iou
r_b1 = get_rotated_coors(box1[i])
File "D:\rotation-yolov5-master\utils\general.py", line 729, in get_rotated_coors
R[:2] = cv2.getRotationMatrix2D(angle=-a*180/math.pi, center=(cx,cy), scale=1)
TypeError: Argument 'angle' can not be treated as a double
解决方法:
将
R[:2] = cv2.getRotationMatrix2D(angle=-a*180/math.pi, center=(cx,cy), scale=1)
改为:
R[:2] = cv2.getRotationMatrix2D(angle=float(-a*180/math.pi), center=(cx,cy), scale=1)