环境配置,需安装好python,msi,yolo等
import mss
import numpy as np
import cv2
import pynput
import time
#import traintest 训练自己的模型
from ultralytics import YOLO
sct=mss.mss()
screem_width=1920
screem_height=1080
game_left,game_top,game_width,game_height=screem_width//2,screem_height//2,screem_width//2,screem_height//2#游戏内截图区域
resize_win_width,resize_win_height=screem_width//3,screem_height//3 #显示窗口大小
monitpor={
'left':game_left,
'top':game_top