scr = mss.mss(
monitor = {
"left": 0,
"top": 0,
"width": 2560,
"height": 1440 }
cv2.getWindowProperty('SF_TRT', cv2.WND_PROP_VISIBLE
img = scr.grab(monitor)
img = np.array(img)
img = cv2.cvtColor(img, cv2.COLOR_BGRA2BGR)
img = cv2.resize(img,(640,640))
model = model.to(device)
results =model(img)
xmins = results.pandas().xyxy[0]['xmin']
ymins = results.pandas().xyxy[0]['ymin']
xmaxs = results.pandas().xyxy[0]['xmax']
ymaxs = results.pandas().xyxy[0]['ymax']
for xmin, ymin, xmax, ymax in zip(xmins, ymins, xmaxs, ymaxs):
cv2.rectangle(img, (xmin[0], ymin[1]), (xmax[2], ymax[3]), (0, 255, 0), 2)
cv2.namedWindow('SF_TRT', cv2.WINDOW_NORMAL)
cv2.getWindowProperty('SF_TRT', cv2.WND_PROP_VISIBLE)
cv2.imshow('SF_TRT', img)
k = cv2.waitKey(1)