docs: update doc about fastdeploy

This commit is contained in:
MistEO
2022-11-26 04:09:15 +08:00
parent cb1a93244b
commit 9c140181fa
13 changed files with 31 additions and 95 deletions

View File

@@ -42,10 +42,10 @@ file(GLOB_RECURSE maa_src src/MeoAssistant/*.cpp)
add_library(MeoAssistant SHARED ${maa_src})
if (MSVC)
find_library(PaddleOCR_LIB NAMES ppocr PATHS 3rdparty/lib)
find_library(FastDeploy_LIB NAMES ON PATHS 3rdparty/lib)
find_library(OpenCV NAMES opencv_world453 PATHS 3rdparty/lib)
find_library(ZLIB NAMES zlibstatic PATHS 3rdparty/lib)
target_link_libraries(MeoAssistant ws2_32 ${OpenCV} ${PaddleOCR_LIB} ${ZLIB})
target_link_libraries(MeoAssistant ws2_32 ${OpenCV} ${FastDeploy_LIB} ${ZLIB})
target_include_directories(MeoAssistant PRIVATE 3rdparty/include)
else ()
find_package(ZLIB REQUIRED)

View File

@@ -100,6 +100,8 @@ MAA 的意思是 MAA Assistant Arknights
- 图像识别库:[opencv](https://github.com/opencv/opencv.git)
- ~~文字识别库:[chineseocr_lite](https://github.com/DayBreak-u/chineseocr_lite.git)~~
- 文字识别库:[PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
- 深度学习快速部署工具集: [FastDeploy](https://github.com/PaddlePaddle/FastDeploy)
- 机器学习推理和训练加速器: [onnxruntime](https://github.com/microsoft/onnxruntime)
- ~~关卡掉落识别:[企鹅物流识别](https://github.com/penguin-statistics/recognizer)~~
- 地图格子识别:[Arknights-Tile-Pos](https://github.com/yuanyan3060/Arknights-Tile-Pos)
- C++ JSON库[meojson](https://github.com/MistEO/meojson.git)

View File

@@ -99,6 +99,8 @@ Due to the small number of overseas clients users and the lack of project manpow
- Image recognition: [opencv](https://github.com/opencv/opencv.git)
- ~~OCR: [chineseocr_lite](https://github.com/DayBreak-u/chineseocr_lite.git)~~
- OCR: [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
- Deep Learning Model Deployment Toolkit: [FastDeploy](https://github.com/PaddlePaddle/FastDeploy)
- ML inferencing and training accelerator: [onnxruntime](https://github.com/microsoft/onnxruntime)
- ~~Item drop recognition: [Penguin Stats recognizer](https://github.com/penguin-statistics/recognizer)~~
- Map tile recognition: [Arknights-Tile-Pos](https://github.com/yuanyan3060/Arknights-Tile-Pos)
- C++ JSON library: [meojson](https://github.com/MistEO/meojson.git)

View File

@@ -101,6 +101,8 @@ UIを見れば使い方もすぐ分かる
- 画像認識ライブラリ:[opencv](https://github.com/opencv/opencv.git)
- ~~テキスト認識ライブラリ:[chineseocr_lite](https://github.com/DayBreak-u/chineseocr_lite.git)~~
- テキスト認識ライブラリ:[PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
- Deep Learning Model Deployment Toolkit: [FastDeploy](https://github.com/PaddlePaddle/FastDeploy)
- ML inferencing and training accelerator: [onnxruntime](https://github.com/microsoft/onnxruntime)
- ~~ステージドロップ認識:[PenguinStats認識](https://github.com/penguin-statistics/recognizer)~~
- マップタイル認識:[Arknights-Tile-Pos](https://github.com/yuanyan3060/Arknights-Tile-Pos)
- C++ JSONライブラリ[meojson](https://github.com/MistEO/meojson.git)

View File

@@ -99,6 +99,8 @@ MAA 的意思是 MAA Assistant Arknights
- 圖像辨識庫:[opencv](https://github.com/opencv/opencv.git)
- ~~字元辨識庫:[chineseocr_lite](https://github.com/DayBreak-u/chineseocr_lite.git)~~
- 字元辨識庫:[PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
- Deep Learning Model Deployment Toolkit: [FastDeploy](https://github.com/PaddlePaddle/FastDeploy)
- ML inferencing and training accelerator: [onnxruntime](https://github.com/microsoft/onnxruntime)
- ~~關卡掉落辨識:[企鵝物流辨識](https://github.com/penguin-statistics/recognizer)~~
- 地圖格子辨識:[Arknights-Tile-Pos](https://github.com/yuanyan3060/Arknights-Tile-Pos)
- C++ JSON庫[meojson](https://github.com/MistEO/meojson.git)

View File

@@ -11,15 +11,7 @@
请尝试安装 [Visual C++ Redistributable](https://docs.microsoft.com/zh-CN/cpp/windows/latest-supported-vc-redist?view=msvc-160#visual-studio-2015-2017-2019-and-2022)、[.NET Framework 4.8](https://dotnet.microsoft.com/download/dotnet-framework/net48) 并重新启动计算机后运行本软件。
### 可能性 2 : CPU 指令集不支持
项目使用 `PaddleOCR` 对游戏部分界面进行识别。`PaddleOCR` 用到了较新发布的 CPU 才支持的 `AVX` 指令集,而一些较老的 CPU 可能并不支持该指令集。
您可以尝试下载 [NoAVX](../3rdparty/ppocr_noavx.zip) 版本的 `PaddleOCR`, 解压后替换本软件中同名的文件。这是对于使用不支持 `AVX` 指令集的 CPU 的用户的性能降低的替代方案,如非必要,请不要使用。
_具体可以下载 [CPU-Z](https://www.cpuid.com/softwares/cpu-z.html),查看“指令集”中有无 `AVX` 这一项来判断_
### 可能性 3 : 其它运行库问题
### 可能性 2 : 其它运行库问题
如果您是 Windows Server 或其他精简版系统的用户,可尝试使用 [Microsoft C++ 生成工具](https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/) 进行完整的开发环境配置(仅需要安装 .NET 及 C++ 开发环境)。

View File

@@ -12,20 +12,9 @@
请自行搜索教程安装,没什么特别的,作者当前成功验证过的版本为`4.5.3`版本。其他版本应该也可以,但仍然推荐使用`4.5.3`版本,与项目保持一致,避免一些不必要的问题。仅`Opencv`本体即可,不需要额外安装`opencv_contrib`
### PaddleOCR
### FastDeploy
1. 使用我魔改了接口的版本:<https://github.com/MaaAssistantArknights/PaddleOCR>
2. 参考 [这个教程](https://github.com/MaaAssistantArknights/PaddleOCR/blob/release/2.5/deploy/cpp_infer/readme_ch.md)
3. 额外依赖的 `paddle_inference` 直接 [下载](https://paddleinference.paddlepaddle.org.cn/master/user_guides/download_lib.html) 即可。其中 `avx``mkl` 两者都可以提高计算效率,建议选择。但如果 CPU 不支持,则只能选择 `noavx``openblas` 的兼容性版本(一般稍微新一点的 CPU 都支持两者了AMD 的也没关系)。 `cuda``cudnn` 是 GPU 加速库,在 `PaddleOCR` 上可能比较麻烦,我没折腾过,有兴趣可以尝试下
4.`cmake` 找不到 `Opencv` ,可尝试修改 [Opencv 的查找路径](https://github.com/MaaAssistantArknights/PaddleOCR/blob/release/2.5/deploy/cpp_infer/CMakeLists.txt#L49)
5. 若您使用**非** `MKL` 版本,需要关闭 [MKL 宏定义](https://github.com/MaaAssistantArknights/PaddleOCR/blob/release/2.5/deploy/cpp_infer/src/args.cpp#L24) (改为 `false`
编译选项参考
```bash
cmake ../ -DPADDLE_LIB=/your_path/paddle_inference/ -DOpenCV_DIR=/your_path_to_opencv/ -DWITH_STATIC_LIB=OFF -DBUILD_SHARED=ON
# 若设备不支持 MKL, 可再额外添加 -DWITH_MKL=OFF 选项,并下载对应的 PaddlePaddle 预测库版本
```
1. 参考 [这个教程](https://github.com/PaddlePaddle/FastDeploy/blob/develop/docs/cn/build_and_install/cpu.md),安装 ONNX Runtime (Ort) 和 Vision 即可。CPU 版比较方便GPU 版本可能更折腾一点,可自行选择
### zlib

View File

@@ -11,15 +11,7 @@
Please try installing [Visual C++ Redistributable](https://docs.microsoft.com/en/cpp/windows/latest-supported-vc-redist?view=msvc-160#visual-studio-2015-2017-2019-and-2022) and [.NET Framework 4.8](https://dotnet.microsoft.com/download/dotnet-framework/net48), and restart your computer and the application.
### Possible cause 2: incompatible CPU instruction set
This project requires `PaddleOCR` for image recognition, which depends on the `AVX` instruction set supported only by some of the newly-released CPUs, while old versions may not support it.
You can also try downloading `PaddleOCR` of [NoAVX](../3rdparty/ppocr_noavx.zip) version, unzip and replace the files with the same names. Since it may cause a performance drop, please do not use it unless it is necessary.
_([CPU-Z](https://www.cpuid.com/softwares/cpu-z.html) is a tool that provides a check of the existence of `AVX` instruction set.)_
### Possible cause 3: other runtime library problems
### Possible cause 2: other runtime library problems
If you are a user of Windows Server or other lite versions, you can try [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) to configure a complete development environment (only .NET and C++ environments are required).

View File

@@ -12,20 +12,9 @@ If you meet any other problems, please feel free to submit issue to us.
Please search the tutorial and install. Nothing to mention. The version `4.5.3` is confirmed to be able to use. Other versions should be OK as well, but `4.5.3` is recommended to keep it the same as the project and avoid some unnecessary problems. Installing `Opencv` itself is enough. `opencv_contrib` is not required.
### PaddleOCR
### FastDeploy
1. Use a hacked version: <https://github.com/MaaAssistantArknights/PaddleOCR>
2. Refer to [this tutorial](https://github.com/MaaAssistantArknights/PaddleOCR/blob/release/2.5/deploy/cpp_infer/readme.md).
3. [Download](https://paddleinference.paddlepaddle.org.cn/master/user_guides/download_lib.html) extra dependencies for `paddle_inference`. Both `avx` and `mkl` are recommended, which can improve the efficiency of calculation. However, if your CPU does not support them, you can choose compatible version of either `noavx` or `openblas` (new CPUs should support them, even AMD). `cuda` and `cudnn` are GPU libraries, but I haven't tried it on `PaddleOCR` yet. Feel free to try it out.
4. If `cmake` cannot find `Opencv`, you can try editing [the finding path of Opencv](https://github.com/MaaAssistantArknights/PaddleOCR/blob/release/2.5/deploy/cpp_infer/CMakeLists.txt#L49).
5. If you are using **NOT** `MKL` version, you need to change the [MKL Macro](https://github.com/MaaAssistantArknights/PaddleOCR/blob/release/2.5/deploy/cpp_infer/src/args.cpp#L24) to `false`.
Compilation flags for your reference
```bash
cmake ../ -DPADDLE_LIB=/your_path/paddle_inference/ -DOpenCV_DIR=/your_path_to_opencv/ -DWITH_STATIC_LIB=OFF -DBUILD_SHARED=ON
# If your device does not support MKL, you can add `-DWITH_MKL=OFF` flag, and download corresponding PaddlePaddle version.
```
1. Refer to [this tutorial](https://github.com/PaddlePaddle/FastDeploy/blob/develop/docs/cn/build_and_install/cpu.md) to install FastDeploy with ONNX Runtime (Ort) and Vision.
### zlib

View File

@@ -11,15 +11,7 @@
[Visual C++ Redistributable](https://docs.microsoft.com/ja-jp/cpp/windows/latest-supported-vc-redist?view=msvc-160#visual-studio-2015-2017-2019-and-2022)と[.NET Framework 4.8](https://dotnet.microsoft.com/ja-jp/download/dotnet-framework/net48)パッケージをインストールし、コンピューターを再起動してアプリを実行してみてください。
### 可能性2CPU命令セットがサポートしていない
本プログラムは、`PaddleOCR` を使用してゲームの一部の画面を識別します。 `PaddleOCR` は、新しくリリースされたCPUでのみサポートされている `AVX` 命令セットを使用します。一部の古いCPUはこの命令セットをサポートしていない場合があります。
[NoAVX](../3rdparty/ppocr_noavx.zip)バージョンの `PaddleOCR` をダウンロードして解凍し、このアプリで同じ名前のファイルに置き換えてください。これは、`AVX` 命令セットをサポートしていないCPUのユーザー向けのパフォーマンス低下の代替手段であり、必要でない限り使用しないでください。
_具体的には、[CPU-Z](https://www.cpuid.com/softwares/cpu-z.html) をダウンロードし、「命令セット」に `AVX` があるかどうかで判断できます。_
### 可能性3ほかのランタイムライブラリの問題
### 可能性2ほかのランタイムライブラリの問題
Windows Serverまたは、その他の簡素化されたシステムを使用している場合、[Microsoft C++ビルドツール](https://visualstudio.microsoft.com/ja/visual-cpp-build-tools/)を使用して完全な開発環境構成を試してみてください(.NETおよびC++開発環境のみをインストールする必要があります)。

View File

@@ -11,15 +11,7 @@
請嘗試安裝 [Visual C++ Redistributable](https://docs.microsoft.com/zh-CN/cpp/windows/latest-supported-vc-redist?view=msvc-160#visual-studio-2015-2017-2019-and-2022)、[.NET Framework 4.8](https://dotnet.microsoft.com/download/dotnet-framework/net48) 並重新啟動電腦後執行本軟體。
### 可能性 2 : CPU 指令集不支援
項目使用 `PaddleOCR` 對遊戲部分畫面進行辨識。 `PaddleOCR` 用到了較新發佈的 CPU 才支援的 `AVX` 指令集,而一些較老的 CPU 可能並不支援該指令集。
您可以嘗試下載 [NoAVX](../3rdparty/ppocr_noavx.zip) 版本的 `PaddleOCR`, 解壓後替換本軟體中同名的檔案。這是對於使用不支援 `AVX` 指令集的 CPU 的使用者的性能降低的替代方案,如非必要,請不要使用。
_具體可以下載 [CPU-Z](https://www.cpuid.com/softwares/cpu-z.html),檢視“指令集”中有無 `AVX` 這一項來判斷_
### 可能性 3 : 其它執行庫問題
### 可能性 2 : 其它執行庫問題
如果您是 Windows Server 或其他精簡版系統的使用者,可嘗試使用 [Microsoft C++ 生成工具](https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/) 進行完整的開發環境配置(僅需要安裝 .NET 及 C++ 開發環境)。

View File

@@ -12,20 +12,9 @@
請自行檢索教程安裝,沒什麼特別的,作者當前成功驗證過的版本為`4.5.3`版本。其他版本應該也可以,但仍然推薦使用`4.5.3`版本,與項目保持一致,避免一些不必要的問題。僅`Opencv`本體即可,不需要額外安裝`opencv_contrib`
### PaddleOCR
### FastDeploy
1. 使用我魔改了介面的版本:<https://github.com/MaaAssistantArknights/PaddleOCR>
2. 參考 [這個教程](https://github.com/MaaAssistantArknights/PaddleOCR/blob/release/2.5/deploy/cpp_infer/readme_ch.md)
3. 額外依賴的 `paddle_inference` 直接 [下載](https://paddleinference.paddlepaddle.org.cn/master/user_guides/download_lib.html) 即可。其中 `avx``mkl` 兩者都可以提高計算效率,建議選擇。但如果 CPU 不支援,則只能選擇 `noavx``openblas` 的相容性版本(一般稍微新一點的 CPU 都支援兩者了AMD 的也沒關係)。 `cuda``cudnn` 是 GPU 加速庫,在 `PaddleOCR` 上可能比較麻煩,我沒折騰過,有興趣可以嘗試下
4.`cmake` 找不到 `Opencv` ,可嘗試修改 [Opencv 的查找路徑](https://github.com/MaaAssistantArknights/PaddleOCR/blob/release/2.5/deploy/cpp_infer/CMakeLists.txt#L49)
5. 若您使用**非** `MKL` 版本,需要關閉 [MKL 巨集定義](https://github.com/MaaAssistantArknights/PaddleOCR/blob/release/2.5/deploy/cpp_infer/src/args.cpp#L24) (改為 `false`
編譯選項參考
```bash
cmake ../ -DPADDLE_LIB=/your_path/paddle_inference/ -DOpenCV_DIR=/your_path_to_opencv/ -DWITH_STATIC_LIB=OFF -DBUILD_SHARED=ON
# 若裝置不支援 MKL, 可再額外添加 -DWITH_MKL=OFF 選項,並下載對應的 PaddlePaddle 預測庫版本
```
1. 参考 [這個教程](https://github.com/PaddlePaddle/FastDeploy/blob/develop/docs/cn/build_and_install/cpu.md),安装 ONNX Runtime (Ort) 和 Vision 即可。CPU 版比较方便GPU 版本可能更折腾一点,可自行选择
### zlib

View File

@@ -15,7 +15,12 @@
"include": [
"resource/**",
"MeoAssistant.dll",
"MeoAsstGui.exe"
"MeoAsstGui.exe",
"ON.dll",
"onnxruntime.dll",
"onnxruntime_providers_shared.dll",
"paddle2onnx.dll",
"yaml-cpp.dll"
],
"exclude": [
"**/PaddleOCR/**",
@@ -37,29 +42,17 @@
"type": "MaaDependency",
"configuration": {
"include": [
"libiomp5md.dll",
"mkldnn.dll",
"mklml.dll",
"paddle_inference.dll",
"ppocr.dll",
"ON.dll",
"onnxruntime.dll",
"onnxruntime_providers_shared.dll",
"paddle2onnx.dll",
"yaml-cpp.dll",
"opencv_world453.dll",
"**/PaddleOCR/**",
"**/PaddleCharOCR/**"
]
}
},
{
"name_template": "MAAComponent-DependencyNoAvx-{VERSION}-win-x64",
"type": "MaaDependencyNoAvx",
"configuration": {
"include": [
"opencv_world453.dll",
"**/PaddleOCR/**",
"**/PaddleCharOCR/**"
],
"no_avx_bundle": "3rdparty/ppocr_noavx.zip"
}
},
{
"name_template": "MAAComponent-DebugSymbol-{VERSION}-win-x64",
"type": "MaaDebugSymbol",