mirror of
https://github.com/ultralytics/ultralytics.git
synced 2025-09-15 15:48:41 +08:00
Fix scaling ratio calculation in ONNX example (#20016)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
d610180309
commit
608617e598
@ -181,7 +181,7 @@ class YOLOv8:
|
||||
class_ids = []
|
||||
|
||||
# Calculate the scaling factors for the bounding box coordinates
|
||||
gain = min(self.input_height / self.img_height, self.input_width / self.img_height)
|
||||
gain = min(self.input_height / self.img_height, self.input_width / self.img_width)
|
||||
outputs[:, 0] -= pad[1]
|
||||
outputs[:, 1] -= pad[0]
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user