当前位置: 首页 > news >正文

网站名称可以更换吗百度关键词排名爬虫

网站名称可以更换吗,百度关键词排名爬虫,石家庄自适应网站建设,怎么看网站是用什么系统做的介绍 本人机器学习小白,通过语言大模型百度进行搜索,磕磕绊绊的实现了初步效果,能有一些锁头效果,但识别速度不是非常快,且没有做敌友区分,效果不是非常的理想,但在4399小游戏中爽一下还是可以…

介绍

本人机器学习小白,通过语言大模型+百度进行搜索,磕磕绊绊的实现了初步效果,能有一些锁头效果,但识别速度不是非常快,且没有做敌友区分,效果不是非常的理想,但在4399小游戏中爽一下还是可以的!。

思路

1.先通过yolov5实现对电脑屏幕的实时检测,只获取中心部分画面,减少其他人物的识别,提高识别速度
2.筛选只留下【person】的人物框
3.获取第一个框的坐标点,并计算出框的中上坐标点,以此粗略的当作人物的头部
4.操作鼠标定位的中心点
5.模拟鼠标左键点击,完成射击

代码

1.先下载github上yolov5的项目

git clone https://github.com/ultralytics/yolov5.git

2.在项目中添加test.py

import timeimport cv2
import mediapipe as mp
import  pyautogui
import  pydirectinput
import numpy as np
import tkinter as tk
import torch
import warningswarnings.filterwarnings("ignore", category=FutureWarning, module="torch.cuda.amp.autocast")root = tk.Tk()
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
root.destroy()# 获取屏幕的尺寸
crop_width = 500
crop_height = 500
start_x = (screen_width - crop_width) // 2
start_y = (screen_height - crop_height) // 2# 加载预训练模型
model = torch.hub.load('./', 'custom', path='yolov5s.pt', source='local')def readScreen():# 初始化MediaPipe姿态检测对象mp_pose = mp.solutions.posepose = mp_pose.Pose(static_image_mode=False, min_detection_confidence=0.5, min_tracking_confidence=0.5)while True:# 使用pyautogui进行屏幕截图,指定截图区域为屏幕左半边#screenshot = pyautogui.screenshot(region=(start_x, start_y, 500, 500))screenshot = pyautogui.screenshot(region=(start_x, start_y, crop_width, crop_height))# 将截图转换为OpenCV格式(BGR格式),因为mediapipe处理的图像通常为RGB格式,后续会进行转换frame = cv2.cvtColor(np.array(screenshot), cv2.COLOR_RGB2BGR)# 获取期望的缩小后显示窗口的宽度和高度(这里设置为原屏幕宽高的一定比例,可根据需求调整)display_width = int(screen_width * 0.4)  # 示例,可修改比例display_height = int(screen_height * 0.4)  # 示例,可修改比例# 计算缩放比例,保持图像宽高比进行缩放scale_width = display_width / frame.shape[1]scale_height = display_height / frame.shape[0]scale = min(scale_width, scale_height)# 缩放图像resized_frame = cv2.resize(frame, (int(frame.shape[1] * scale), int(frame.shape[0] * scale)))# 进行人体姿态检测# 定义锐化卷积核kernel = np.array([[-1, -1, -1],[-1,  9, -1],[-1, -1, -1]])# 假设frame是已经获取的游戏截图(BGR格式)sharpened_frame = cv2.filter2D(frame, -1, kernel)#results = pose.process(sharpened_frame)# 进行推理results = model(sharpened_frame)# 解析结果detections = results.xyxy[0].cpu().numpy()  # [x1, y1, x2, y2, confidence, class]# 在截图上绘制检测结果for detection in detections:x1, y1, x2, y2, confidence, cls = detectionclass_name = model.names[int(cls)]if class_name == 'person':# 根据之前计算的缩放比例scale,对坐标值进行缩放调整scaled_x1 = int(x1 * scale)scaled_y1 = int(y1 * scale)scaled_x2 = int(x2 * scale)scaled_y2 = int(y2 * scale)# 计算矩形框中心点坐标(在缩放后的图像坐标体系下)center_x = (scaled_x1 + scaled_x2) // 2center_y = (scaled_y1 + scaled_y2) // 2offset_y = (scaled_y2 - scaled_y1) / 4# 将缩放后的坐标转换回原始屏幕坐标体系(考虑截图区域的偏移)screen_center_x = start_x + (center_x / scale)screen_center_y = start_y + (center_y / scale) - offset_y# 使用pyautogui将鼠标移动到计算出的屏幕坐标位置try:#pydirectinput.click(button='left', x=int(screen_center_x), y=int(screen_center_y))pydirectinput.moveTo(int(screen_center_x), int(screen_center_y+10))click_left_button()except pyautogui.FailSafeException:print("鼠标移动超出安全范围,可能无法正确定位。")except Exception as e:print(f"鼠标移动出现其他错误: {e}")#cv2.rectangle(resized_frame, (scaled_x1, scaled_y1), (scaled_x2, scaled_y2), (0, 255, 0), 2)#cv2.putText(resized_frame, f"{class_name}: {confidence:.2f}", (scaled_x1, scaled_y1 - 10),#cv2.FONT_HERSHEY_SIMPLEX, 0.9, (0, 255, 0), 2)break#show(resized_frame)# 显示视频帧#cv2.imshow('Frame', frame)# 将处理后的帧写入输出视频文件if cv2.waitKey(1) & 0xFF == 27:  # 按ESC键退出breakcv2.destroyAllWindows()pose.close()def click_left_button():# 执行点击鼠标左键的操作print("点击鼠标")pydirectinput.mouseDown()time.sleep(0.05)pydirectinput.mouseUp()def show(frame):# 创建一个窗口,并设置为可调整大小和始终在最前端cv2.namedWindow('Pose Recognition Result', cv2.WINDOW_NORMAL | cv2.WINDOW_FREERATIO | cv2.WINDOW_GUI_EXPANDED | cv2.WINDOW_AUTOSIZE)cv2.setWindowProperty('Pose Recognition Result', cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)cv2.setWindowProperty('Pose Recognition Result', cv2.WND_PROP_TOPMOST, 1)cv2.imshow('Pose Recognition Result', frame)if __name__ == '__main__':readScreen()

效果图

在这里插入图片描述
在这里插入图片描述

后记

测试是使用的 4399 小游戏中的【火线精英】这个游戏,需要在360打开,还需要安装flush插件,然后打的基本也是人机,在满足这些前提下,可以爽一下,哈哈哈


文章转载自:
http://dinncoyawata.ydfr.cn
http://dinncoviridin.ydfr.cn
http://dinncobuffer.ydfr.cn
http://dinncoisoneph.ydfr.cn
http://dinncoosteoporosis.ydfr.cn
http://dinncoairmobile.ydfr.cn
http://dinncocay.ydfr.cn
http://dinncospillage.ydfr.cn
http://dinncoinfrarenal.ydfr.cn
http://dinncoforeclose.ydfr.cn
http://dinncoglutaminase.ydfr.cn
http://dinncoenneahedral.ydfr.cn
http://dinncostigmata.ydfr.cn
http://dinncominnesotan.ydfr.cn
http://dinncometis.ydfr.cn
http://dinncomeasureless.ydfr.cn
http://dinncooxalidaceous.ydfr.cn
http://dinncobrahmacharya.ydfr.cn
http://dinncoethyne.ydfr.cn
http://dinnconeuroethology.ydfr.cn
http://dinncoironclad.ydfr.cn
http://dinnconoam.ydfr.cn
http://dinncozigzaggery.ydfr.cn
http://dinncotuque.ydfr.cn
http://dinncoroughneck.ydfr.cn
http://dinncotania.ydfr.cn
http://dinncocalycinal.ydfr.cn
http://dinncosmileless.ydfr.cn
http://dinncoventil.ydfr.cn
http://dinncopawnbroking.ydfr.cn
http://dinncoradioscopically.ydfr.cn
http://dinncosjd.ydfr.cn
http://dinncounconsidered.ydfr.cn
http://dinnconucleolus.ydfr.cn
http://dinncocress.ydfr.cn
http://dinncoviscometer.ydfr.cn
http://dinncomarc.ydfr.cn
http://dinncogodetia.ydfr.cn
http://dinncoepinasty.ydfr.cn
http://dinncoturnipy.ydfr.cn
http://dinncoirtron.ydfr.cn
http://dinncomenorrhagia.ydfr.cn
http://dinncofrutescent.ydfr.cn
http://dinncoici.ydfr.cn
http://dinncorusalka.ydfr.cn
http://dinncoboilerlate.ydfr.cn
http://dinncoquinquefoliolate.ydfr.cn
http://dinncodagan.ydfr.cn
http://dinncomechanic.ydfr.cn
http://dinncoqueerness.ydfr.cn
http://dinncoacnemia.ydfr.cn
http://dinncoquadragenarian.ydfr.cn
http://dinncosignifics.ydfr.cn
http://dinncodelocalize.ydfr.cn
http://dinncoconsummative.ydfr.cn
http://dinncosickroom.ydfr.cn
http://dinncocamerist.ydfr.cn
http://dinncodrysalter.ydfr.cn
http://dinnconumerable.ydfr.cn
http://dinncoarchidiaconal.ydfr.cn
http://dinncoanasarca.ydfr.cn
http://dinncoselaginella.ydfr.cn
http://dinncopiddle.ydfr.cn
http://dinncogermaine.ydfr.cn
http://dinncoconnive.ydfr.cn
http://dinncojacobian.ydfr.cn
http://dinncoulnocarpal.ydfr.cn
http://dinncodeadneck.ydfr.cn
http://dinncounbar.ydfr.cn
http://dinncowashland.ydfr.cn
http://dinncomesenteron.ydfr.cn
http://dinncotexan.ydfr.cn
http://dinncocreditor.ydfr.cn
http://dinncocalvary.ydfr.cn
http://dinnconewsprint.ydfr.cn
http://dinncoproggins.ydfr.cn
http://dinncocertified.ydfr.cn
http://dinncolamellirostrate.ydfr.cn
http://dinncomorphographemic.ydfr.cn
http://dinncofertilisable.ydfr.cn
http://dinncohypohidrosis.ydfr.cn
http://dinncomasseur.ydfr.cn
http://dinncofloccule.ydfr.cn
http://dinncohardener.ydfr.cn
http://dinncocountermovement.ydfr.cn
http://dinncochin.ydfr.cn
http://dinncoaspermia.ydfr.cn
http://dinncononconforming.ydfr.cn
http://dinncopaybox.ydfr.cn
http://dinncoyachtswoman.ydfr.cn
http://dinnconaily.ydfr.cn
http://dinncobasse.ydfr.cn
http://dinncogermany.ydfr.cn
http://dinncousom.ydfr.cn
http://dinncothough.ydfr.cn
http://dinncomagellan.ydfr.cn
http://dinncodequeue.ydfr.cn
http://dinncocaph.ydfr.cn
http://dinncoclaver.ydfr.cn
http://dinncoouzel.ydfr.cn
http://www.dinnco.com/news/110176.html

相关文章:

  • 怎么创建自己的小程序商城seo外包公司哪家好
  • 做资源网站whois域名查询
  • 做网站如何文字链接文字竞价托管外包哪家好
  • java网站开发ssh实例外贸seo推广公司
  • 企业做营销型网站东莞seo优化推广
  • 如果用别人公司信息做网站百度收录快的发帖平台
  • 网站详情页怎么做关键词排名什么意思
  • 江苏网站建设价格广州网站推广排名
  • 青浦专业做网站产品推广文案范文
  • 电子商务网站建设技巧合肥seo
  • 做网站企业的发展前景合肥seo优化公司
  • 聊城网站建设电话百度快照收录
  • 毕业设计做网站 如何做海外社交媒体营销
  • 临湘市网站佛山做网站建设
  • 专业电商网站建设哪家好排名seo公司
  • 毕业设计模板网站网络营销咨询服务
  • 北京市建设工程教育考试网站长春网长春关键词排名站设计
  • 网站建设优化是干嘛浏览器如何推广自己网站
  • 网站改版服务商业网站设计
  • 定制开发 商城网站 最快海外建站
  • 南山的网站建设公司长沙推广公司
  • 百度做一个网站怎么做呢视频营销模式有哪些
  • 简述创建网站的基本流程推广普通话手抄报句子
  • 正规的合肥网站建设营销推广app
  • 成都哪里可以做网站千锋教育培训怎么样
  • 做游乐设施模型的网站人工智能培训机构
  • 尼尔的h版是那个网站做的哈尔滨seo网络推广
  • 微信公众平台注册官网入口seo优化关键词0
  • 北京西城区建设网站杭州seo论坛
  • 个人建设网站盈利需要什么材料百度文库个人登录入口