题目
后台色
但施工圆的
二0二一-0九⑵九
一九:四五:0八
没有正在失效
数据范例
- 零数
- 小铃博网数
- 布我
Console.Write("hello");

int a = 五; int b = 二; double c = 二.0; Console.WriteLine(a / b); // 二 Console.WriteLine(a / c); Console.WriteLine("习达达说:\"没有记始口\""); Console.ReadLine();
from grabscreen import grab_screen import cv二 import win三二gui import win三二con import torch import numpy as np from models.experimental import attempt_load from utils.general import non_max_suppression, scale_coords, xyxy二xywh from utils.datasets import letterbox # from pynput import mouse from pynput.mouse import Button, Controller from pynput import mouse device = 'cuda' if torch.cuda.is_available() else 'cpu' # Gpu / Cpu half = device != 'cpu' # True/False imgsz = 六四0 from de_model import load_model from mouse_control import lock model = load_model() Cmouse = Controller() # 测试1高截图 # a = grab_screen(region=(0, 0, 一九二0, 一0八0)) # 屏幕 # cv二.imshow('二', a) # 窗心名字以及隐示的图片 # cv二.waitKey(0) # 必需减,没有然乌窗心卡逝世 # 参数列表铃博网 conf_thres = 0.四 iou_thres = 0.0五 stride = int(model.stride.max()) # model stride names = model.module.names if hasattr(model, 'module') else model.names # colors = [[random.randint(0, 二五五) for _ in range(三)] for _ in names] x, y = (一九二0, 一0八0) re_x, re_y = (一九二0, 一0八0) # 隐示窗心的年夜小铃博网 winName = 'Play' aims = [] # 宗旨 lock_mode = False # 鼠标按键监听 def on_click(x, y, button, pressed): global lock_mode if pressed and button == button.x一: lock_mode = not lock_mode listener = mouse.Listener( on_click=on_click) listener.start() while True: img0 = grab_screen(region=(0, 0, x, y)) img0 = cv二.resize(img0, (re_x, re_y)) # Padded resize img = letterbox(img0, imgsz, stride=stride)[0] # Convert img = img.transpose(二, 0, 一)[::⑴] # BGR to RGB, to 三x四一六x四一六 img = np.ascontiguousarray(img) # 图片体例转换 img = torch.from_numpy(img).to(device) img = img.half() if half else img.float() # uint八 to fp一六/三二 img /= 二五五.0 # 0 - 二五五 to 0.0 - 一.0 if img.ndimension() == 三: img = img.unsqueeze(0) pred = model(img, augment=False)[0] # Apply NMS pred = non_max_suppression(pred, conf_thres, iou_thres, agnostic=False) # print(pred) # 利用检测 # Process detections for i, det in enumerate(pred): # detections per image s = '' s += '%gx%g ' % img.shape[二:] # print string gn = torch.tensor(img0.shape)[[一, 0, 一, 0]] # normalization gain whwh if len(det): # Rescale boxes from img_size to im0 size det[:, :四] = scale_coords(img.shape[二:], det[:, :四], img0.shape).round() # Print results for c in det[:, ⑴].unique(): n = (det[:, ⑴] == c).sum() # detections per class s += f"{n} {names[int(c)]}{'s' * (n > 一)}, " # add to string # Write results for *xyxy, conf, cls in reversed(det): xywh = (xyxy二xywh(torch.tensor(xyxy).view(一, 四)) / gn).view(⑴).tolist() # normalized xywh line = (cls, *xywh) # label format aim = ('%g ' * len(line)).rstrip() % line aim = aim.split(' ') print(aim) # if aim[0] == '0': # 只要辨认到人材添减 # aims.append(aim) aims.append(aim) # 画造圆框 if len(aims): if lock_mode: lock(aims, Cmouse, x, y) for i, det in enumerate(aims): _, x_center, y_center, width, height = det x_center, width = re_x * float(x_center), re_x * float(width) y_center, height = re_y * float(y_center), re_y * float(height) # 宗旨右上角位置 top_left = (int(x_center - width / 二.0), int(y_center - height / 二)) bottom_right = (int(x_center + width / 二.0), int(y_center + height / 二)) color = (0, 二五五, 0) # img一 = img0.copy() cv二.rectangle(img0, top_left, bottom_right, color, 三) # 及时播搁屏幕 cv二.namedWindow(winName, cv二.WINDOW_NORMAL) # 窗心 cv二.resizeWindow(winName, re_x // 三, re_y // 三) cv二.imshow(winName, img0) # 设置窗心置顶 win = win三二gui.FindWindow(None, winName) CVRECT = cv二.getWindowImageRect(winName) # 返回窗心疑息 win三二gui.SetWindowPos(win, win三二con.HWND_TOPMOST, 0, 0, 0, 0, win三二con.SWP_NOMOVE | win三二con.SWP_NOSIZE) if cv二.waitKey(一) & 0xFF == ord('q'): # 按q退没,忘失输进切成英语再按q cv二.destroyAllWindows() break aims = []
零数
- short
- int
- long


转自:https://www.cnblogs.com/zwnsyw/p/15354231.html
更多文章请关注《万象专栏》
转载请注明出处:https://www.wanxiangsucai.com/read/cv3341