归一化坐标改用result.original_image.shape[:2]

This commit is contained in:
yooooger 2026-03-05 14:18:49 +08:00
parent d4151c2dab
commit 3d6210adb8

View File

@ -459,7 +459,7 @@ class YOLOSegmentationInference:
approx = cv2.approxPolyDP(contour, epsilon, True) approx = cv2.approxPolyDP(contour, epsilon, True)
# 归一化坐标 # 归一化坐标
h, w = mask.shape h, w = result.original_image.shape[:2]
points = [] points = []
for point in approx: for point in approx:
x = point[0][0] / w x = point[0][0] / w