Skip to content

Commit

Permalink
refactor:微信爬虫目录转移单独仓库,更新README
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverComet7 committed Dec 5, 2022
1 parent ffe5add commit 7214c4e
Show file tree
Hide file tree
Showing 141 changed files with 23 additions and 73,197 deletions.
46 changes: 17 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,26 @@
# yolov5
# [原地址](https://github.com/c925777075/yolov5-dnf)

1. 代码中涉及到使用opencv对小地图和技能栏进行模板匹配和二值化等操作,注意,不同游戏分辨率和电脑显示器分辨率是不一致的,代码中给出的(0,0,1280,800)是本人游戏中的分辨率,而small_recgonize.py和skill_recgonize.py中的img[45:65, 1107:1270], img[733: 793, 538:750, 2]是根据不同显示器的分辨率决定的,使用时需要自己调整。
2. 本人训练的yolov5模型还有待提高,我的训练集只有294张图片,因此效果一般。
详细教学请移步b站,有很详细的讲解:https://www.bilibili.com/video/BV18r4y1A7BF/
# 准备工作:数据集的收集与测试

1. 录制整体流程视频
1. 标注数据集
1. 训练权重文件
1. 视频检测识别效果

视频收集数据集
标注
训练
视频检测训练效果

## 游戏主流程:
1. 屏幕抓取,图像检测
2. 怪物识别,和怪物距离n像素拍地板清怪,漏怪继续拍地板
3. 捡发光的材料
4. 小地图进入下一关
5. boss房间,下一局
## 游戏主逻辑:

1. 屏幕抓取后图像识别
2. 怪物识别,材料识别等,和怪物距离n像素拍地板清怪,捡材料
3. 进入下一个地图(自动寻路)
4. boss房间,出现售卖商人,下一次循环

## 小地图寻路
1. 固定地图寻路:
幽暗密林: → → → ↑ →

2. 不固定最快boss寻路:
heroDoor 临边?房间
有 英雄房间与boss房间比较 x距离 y距离决定去往哪 无 返回上一个房间

3. 最慢boss寻路(全图?):


1. 固定地图寻路:幽暗密林: → → → ↑ →
2. 不固定最快boss寻路(直通:深度优先)
> 英雄房间与boss房间比较 x距离 y距离决定去往哪
3. 最慢boss寻路(全图:广度优先)

测试流程:
1.纯小号检测 1级地图
2.未央爬楼视频检测,测试延迟同步操作是否能基础通过
3.跨4子账号未央检测
## 测试流程:

实战
1. 用小号测试流程
6 changes: 0 additions & 6 deletions test/keyboard_test.py

This file was deleted.

3 changes: 0 additions & 3 deletions test/rand.py

This file was deleted.

8 changes: 6 additions & 2 deletions test/yabl.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def plot_one_box(x, img, color=None, label=None, line_thickness=None):
cv2.putText(img, label, (c1[0], c1[1] - 2), 0, tl / 3, [225, 255, 255], thickness=tf, lineType=cv2.LINE_AA)


# 幽暗密林
yamlDoorDirection = ['RIGHT', 'RIGHT', 'UP', 'RIGHT']
# 王之摇篮
wzylDoorDirection = ['UP', 'LEFT', 'UP', 'RIGHT', 'UP', 'UP']

while True:

Expand Down Expand Up @@ -144,7 +147,7 @@ def plot_one_box(x, img, color=None, label=None, line_thickness=None):
print('攻击boss')
# action_cache = key_press('A')
elif 'mat' in cls_object:
print('减材料')
print('减发光材料')
elif 'box' in cls_object:
print('ESC')
elif 'option' in cls_object:
Expand All @@ -160,7 +163,8 @@ def plot_one_box(x, img, color=None, label=None, line_thickness=None):
door_index = idx
if not door_box or door_box[0] < img0.shape[0] // 2:
print('没有识别到门,门在左侧,固定去下一个门')
action_cache = move(yamlDoorDirection[thisDirectionIndex], material=False, action_cache=action_cache)
action_cache = move(yamlDoorDirection[thisDirectionIndex], material=False,
action_cache=action_cache)
elif abs(door_box[1] - hero_xywh[1]) < thy and abs(door_box[0] - hero_xywh[0]) < thx:
action_cache = None
print("进入下一地图")
Expand Down
95 changes: 0 additions & 95 deletions wx-read/bookTypeSearch.py

This file was deleted.

Loading

0 comments on commit 7214c4e

Please sign in to comment.