Я хотел бы определить и разделить отдельные значения результатов ограничивающей рамки Yolo yxyx.
Вот что у меня есть на данный момент:
Код: Выделить всё
from pyautogui import *
from ultralytics import YOLO
model = YOLO('Best.pt') # Load model
results = model.predict('savedimage.png', conf=0.45)
for result in results:
boxes = result.boxes # Boxes object for bounding box outputs
masks = result.masks # Masks object for segmentation masks outputs
keypoints = result.keypoints # Keypoints object for pose outputs
probs = result.probs # Probs object for classification outputs
obb = result.obb # Oriented boxes object for OBB outputs
origShapeH = boxes.orig_shape\[0\]
origShapeW = boxes.orig_shape\[1\]
print(boxes.xyxy)
print("Height: ", origShapeH)
print("Width: ", origShapeW)
Код: Выделить всё
tensor([[1169.7236, 265.5889, 1392.5630, 499.6911]])
Height: 900
Width: 1600
Код: Выделить всё
x1 = 1169.7236
y1 = 265.5889
x2 = 1392.5630
y2 = 499.6911
Height: 900
Width: 1600
Подробнее здесь: https://stackoverflow.com/questions/793 ... ial-values
Мобильная версия