Commit Graph

46 Commits

Author SHA1 Message Date
FishmanTheMurloc
0c02808626 使用TorchSharp重写RodNet,以利后续优化 (#1613)
* 使用TorchSharp重写RodNet,以利后续优化

* 增加一个外部torch加载配置来代替直接的依赖,如配置不生效则使用原先手搓的算法

* BgiOnnxFactory取消单例,改为在App服务类中注册为单例,由此修复了一堆单元测试

* BgiOnnxFactory中几个静态方法改为成员方法以和App解耦;因不再有多个mat源供消耗,FishBite中文字块算法不再改动传入的mat,使得后续串联的算法不受其影响

* 将BehavioursTests中临时的配置读取方式改为读取主项目编译环境中的json文件;新建单元测试的README

* 将RodNet算法更新到 010006a44c 的版本;RodNet中关于torch库推理和直接数学计算的校验移至单元测试

* 更新RodNet算法至最新:add5672731

* 注释调试用的代码
2025-06-01 15:16:54 +08:00
Shatyuka
b2958ac646 用Image<Rgb24>替换Bitmap (#1563) 2025-05-11 11:03:53 +08:00
Takaranoao
5b3bac478d 升级多个依赖&增加额外的推理加速功能&迁移OCR (#1459)
* 更新多个NuGet包至最新版本

* 重构模型加载以适应yolosharp

* feat: 改变接口。TensorRT缓存的初步支持,修改配置项。

* 更新依赖并调整变量顺序,修复加载问题

* 更新AvalonEdit和Microsoft.ML.OnnxRuntime包至最新版本,以修复问题

* fix: downgrade Microsoft.ML.OnnxRuntime.DirectML to version 1.21.0

* typo

* fix: change log level from warning to error for ONNX provider loading failure

* 增加 paddle ocr 的 onnx 模型

* feat: add PaddleOCR models for Chinese, English, and Latin recognition

* 使用cv的DNN生成Tensor,加速Yap文字识别

* feat: 尝试搓一个onnx的ocr

* clean up code

* chore: update OpenCvSharp4 package versions to 4.10.0.20241108

* 修复因格式化代码而丢的引用

* chore: update Microsoft.ML.OnnxRuntime.DirectML package to version 1.21.1 and improve logging for ONNX provider initialization

* chore: 等yolosharp更新再升级onnx

* chore: add Microsoft.ML.OnnxRuntime.Managed package and clean up logging in Det class

* fix: refactor output tensor handling in Det class for improved clarity

* 补充注释,修复DML的OCR问题

* 默认OCR推理使用CPU,整理配置

* fix error NETSDK1152: 找到了多个具有相同相对路径的发布输出文件

* fix(logging): enhance debug log for ONNX initialization with provider details

* 修复TensorRT模型缓存的加载问题

* fix(onnx): improve cached model retrieval and add file existence check

* fix(ocr): replace SrcGreyMat with SrcMat for region of interest processing

* fix(onnx): add file existence check for cached model and adjust session options for DirectML provider

* 增加硬件加速配置UI界面

* 移除旧的OCR模型

* 错别字

---------

Co-authored-by: 辉鸭蛋 <huiyadanli@gmail.com>
2025-05-11 01:08:37 +08:00
辉鸭蛋
b51f00a259 修复4号位地图追踪时不切人的放技能的问题 2025-04-15 01:52:06 +08:00
Takaranoao
7cf826a80b 修复手动设置cd不生效和快速跳过战斗时有时会导致刷屏的问题。 (#1410) 2025-04-06 14:36:53 +08:00
Takaranoao
399441b9e8 优化技能冷却处理逻辑 (#1321)
* 在路径追踪重构了部分冷却处理逻辑,战斗脚本e增加wait参数可等待技能冷却而不是跳过。采矿e增加等待。尝试修复路径追踪 UseElementalSkill 与采矿脚本冲突的问题。

* 给CombatCommand加入快速跳过e的选项

* 优化技能冷却处理逻辑,增加OcrSkillCd属性以支持OCR识别的技能冷却时间,并调整相关技能CD计算和等待逻辑,尝试修复纳西妲采集终止时按键未弹起的问题

* 优化战斗任务中的技能冷却处理逻辑

* 更新纳西妲技能冷却时间记录,改为使用UTC时间并增加日志输出以便调试

* 增加最大技能CD检查,以排除系统时间/日期同步导致无限卡死。修复跑图路切人。(ps:主板电池没电应该去修主板)

* 修复CheckAvatarAvailable

* fix AutoFightTask skill cooldown logic and improve comments

* 尝试修复脚本在"当前角色"下的小问题

* 尝试修复脚本在"当前角色"下的小问题,Avatar类结构调整,重新做了"根据技能cd优化出招"部分。

* Refactor avatar retrieval in PathingConditionConfig to use GetAvatars method and update skill cooldown references

* Fix variable naming for clarity in CombatScenes

* 在自动战斗执行前预先过滤不可执行的脚本。

---------

Co-authored-by: 辉鸭蛋 <huiyadanli@gmail.com>
2025-04-04 13:54:44 +08:00
Takaranoao
cbaf1f6c36 更新OpenCvSharp4版本到4.10.0,PaddleOCR到2.7.0.3,尝试修复bitblt导致崩溃的问题 (#1381) 2025-04-01 14:47:13 +08:00
辉鸭蛋
7d7289ac16 release all key after fight #1073 2025-01-30 10:36:49 +08:00
辉鸭蛋
b14de9ed20 auto domain: SendInput instead of PostMessage 2025-01-30 08:07:51 +08:00
辉鸭蛋
2d0a7b5da8 typo 2025-01-27 13:56:27 +08:00
辉鸭蛋
917ba1460d fix some bug 2025-01-24 00:16:11 +08:00
辉鸭蛋
197e991a89 0.39.5 2025-01-21 22:51:57 +08:00
辉鸭蛋
ccb8025676 auto start capture on solo task start2 #1048 2025-01-21 01:56:42 +08:00
辉鸭蛋
dd9e700485 more game resolution check 2025-01-12 21:45:02 +08:00
辉鸭蛋
741da4e0c7 #869 2024-12-29 20:22:00 +08:00
辉鸭蛋
adcd08421a fix: incorrect host judgment methods #777 2024-11-09 17:49:42 +08:00
辉鸭蛋
44190a522b team identification support online
修复错误信息,改进联机状态处理

更新了 `BetterGenshinImpact.csproj` 文件中的程序集版本号,从 `0.35.2` 更新为 `0.35.4`。

修正了 `ScriptProject.cs` 文件中抛出 `FileNotFoundException` 异常时的错误信息,将 "manifest.json文件存在" 改为 "manifest.json文件不存在"。

在 `AutoFightAssets.cs` 文件中:
- 为 `AvatarSideIconRectList` 和 `AvatarIndexRectList` 添加了注释,解释其在非联机状态下的用途。
- 添加了多个新的属性和注释,用于处理联机状态下的角色头像和对应的白色块位置。
- 初始化了 `OnePRa` 和 `PRa` 两个识别对象,用于识别联机状态下的1P和P图标。

在 `Avatar.cs` 文件中:
- 修改了角色切换逻辑,使用 `CombatScenes.ExpectedTeamAvatarNum` 替代硬编码的数字。
- 在 `TrySwitch` 方法中添加了 `needLog` 参数,并在切换成功时记录日志。
- 移除了部分注释代码,并在日志中保存了角色切换和索引区域的截图。
- 添加了 `System.Diagnostics` 的引用。

在 `CombatScenes.cs` 文件中:
- 将 `Avatars` 初始化为空数组。
- 添加了 `ExpectedTeamAvatarNum` 属性,默认值为4。
- 在 `InitializeTeam` 方法中添加了联机状态的判断和处理逻辑。
- 修改了队伍识别逻辑,使用动态数组替代固定长度的数组。
- 修改了 `CheckTeamInitialized` 方法,使用 `ExpectedTeamAvatarNum` 替代硬编码的数字。
- 修改了 `BuildAvatars` 方法,添加了对联机状态下角色编号位置信息的处理。
- 修改了 `SelectAvatar` 方法,使用 `GetValueOrDefault` 替代 `TryGetValue`。

在 `ScriptControlViewModel.cs` 文件中,设置 `WindowStartupLocation` 为 `WindowStartupLocation.CenterOwner`。

添加了 `1p.png` 和 `p.png` 两个新图像文件,用于识别联机状态下的1P和P图标。
2024-10-27 17:15:55 +08:00
辉鸭蛋
11ec9bc45d refactor: CancellationTokenSource -> CancellationToken 2024-10-19 01:50:21 +08:00
ema
335b053b32 change: moved image assets to new folder 2024-09-30 10:12:13 +08:00
qhy040404
c490d29aa1 code cleanup 2024-08-14 18:01:02 +08:00
辉鸭蛋
abac18bc7e reduce the recognition rate requirements for Qin and costume characters 2024-08-02 22:38:47 +08:00
辉鸭蛋
347e42bab9 update dependency library version 2024-07-01 00:51:28 +08:00
辉鸭蛋
03a336967e add classify yolov8 2024-05-28 19:11:43 +08:00
辉鸭蛋
c2d3e132e8 refactor: RectArea -> Region compilation passed 2024-05-02 14:45:07 +08:00
辉鸭蛋
27ff3e649b quick click genshin online yes or no button #170 2024-04-20 12:24:15 +08:00
辉鸭蛋
cbca6cfcfe don't interrupt when recognition fails 2024-04-13 19:03:33 +08:00
辉鸭蛋
aa0fedf808 new avatar rec in auto fight 2024-04-13 18:46:18 +08:00
辉鸭蛋
bdc99e9e06 all assets to singleton 2024-04-04 14:38:04 +08:00
huiyadanli
85f87b02aa auto tcg: default character card config #217 2024-01-21 21:39:11 +08:00
huiyadanli
9a0fa23451 add alias support 2024-01-14 00:08:59 +08:00
huiyadanli
374de87833 fix: OCR cannot accurately recognize "纳西妲" 2024-01-13 23:13:12 +08:00
huiyadanli
0d9cf01800 fix auto fight bug when all triggers close #203 2024-01-11 21:56:32 +08:00
huiyadanli
819587d2bd mandatory assignment of team avatars 2024-01-07 14:56:58 +08:00
huiyadanli
7a50f8b994 fix wanderer recognition 2024-01-07 13:12:15 +08:00
huiyadanli
66cd73dbf3 universal combat strategy 2024-01-06 22:59:23 +08:00
huiyadanli
2ea4139a9f fix avatar avtive status detection 2024-01-06 14:58:51 +08:00
huiyadanli
279f7eb3b5 add enter domain 2024-01-01 22:22:46 +08:00
huiyadanli
be08871440 go to domain tree 2024-01-01 15:06:16 +08:00
huiyadanli
922118a3a1 optimize "播放中" ocr result 2023-12-31 19:40:19 +08:00
huiyadanli
3f76d8dbc9 optimization task termination and team identification 2023-12-31 19:06:31 +08:00
huiyadanli
1c4c884096 finsh auto combat 2023-12-31 17:39:42 +08:00
huiyadanli
e2360ca2bd switch avatar 2023-12-31 14:37:44 +08:00
huiyadanli
427ed0045f team identification 2023-12-30 13:53:07 +08:00
huiyadanli
0c52e3b85b init team avatars 2023-12-30 00:11:59 +08:00
huiyadanli
d0321e9d73 add only capture mode 2023-12-28 23:18:36 +08:00
huiyadanli
f06bddffef init auto domain 2023-12-26 21:04:44 +08:00