微信跳一跳test9999 - 模型详情
名称:微信跳一跳test9999
导入:cnnLoad("微信跳一跳test9999:1.0")
作者:小雄
简介:微信跳一跳30张图
from airscript.action import click from airscript.screen import yolo_v5 yolo = yolo_v5("微信跳一跳test9999:1.0") from .res.ui import draw import math #计算小人 import time def jump(ts): p = None t = None for i in ts: if i.label=='小人': p = i elif t==None: t = i elif i.y<t.y: t = i if p and t and p.y>t.y: ss = [p,t] for i in ss: if i.prob > 0.2: draw.add_rect(i.label + str(i.prob), 1000, i.x, i.y, i.w, i.h) # print(i) s_x = p.x+p.w/2 s_y = p.y+p.h*0.85 t_x = t.x+t.w/2 t_y = t.y+t.h/2 draw.add_line('line',1000,s_x,s_y,t_x,t_y) space = math.sqrt((s_x-t_x)**2+(s_y-t_y)**2) time1 = space*1.4 #这里的时间用的是1.05倍,与自己的手机像素有关,自行调整 click(s_x,s_y,time1) pass while True: ts = yolo.find_all() jump(ts) time.sleep(2)
标签:小人,方块,圆形
版本更新时间轴
2025年01月18日
更新版本:1.0