unable to use best.pt to recognize real time images from screen #13446
Unanswered
ThiagoBauken
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i cant use my trained best.py to run with this locally but it runs on the pretreined version
import torch
import time
import mss
import numpy as np
import cv2
class MssYoloDetector:
def init(self):
# Carrega o modelo YOLOv5 pré-treinado
self.model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True)
# Ajuste para a resolução desejada: 1920x1080
self.monitor = {'top': 0, 'left': 0, 'width': 1920, 'height': 1080}
if name == "main":
detector = MssYoloDetector()
detector.run()
Beta Was this translation helpful? Give feedback.
All reactions