AyushExel / bridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

test issue 1

AyushExel opened this issue · comments

I'm trying Yolov8 with screen capture but it doesn't seem to work. I'm using the win32gui.GetDesktopWindow() to get the screenshot

Here my code

   self.model = YOLO('yolov8n.pt')
    frame = wincap.getScreenshot(detection_box)
    results = self.model(frame)
    print(results)

Here is what the output looks like.

[Ultralytics YOLO <class 'ultralytics.yolo.engine.results.Results'> instance
Ultralytics YOLO <class 'ultralytics.yolo.engine.results.Boxes'> masks
type: <class 'torch.Tensor'>
shape: torch.Size([0, 6])
dtype: torch.float32
original size: (270, 480)
]
When I try

print(results.boxes) or print(results.masks)
I get this error

AttributeError: 'list' object has no attribute 'boxes'

Results is a list with one object per frame.
Do results [0].boxes