yolov7-pip icon indicating copy to clipboard operation
yolov7-pip copied to clipboard

How to use GPU with yolov7detect?

Open raf329 opened this issue 9 months ago • 2 comments

HI!

I used code from this link https://pypi.org/project/yolov7detect/:

model = yolov7.load('yolov7.pt')

# set model parameters
model.conf = 0.25  # NMS confidence threshold
model.iou = 0.45  # NMS IoU threshold
model.classes = None  # (optional list) filter by class
model.device = 0
results = model(cd_frame, size=640, augment=False)

But anyway in Task Manager of Windows 11 I can see that GPU is not using. 
I tried python detect.py --weights yolov7.pt --conf 0.25 --img-size 640 --source yourvideo.mp4 --device 0 - this code load GPU. 

How to tackle with this problem?

Best Regards!

raf329 avatar May 07 '24 16:05 raf329