diff --git a/docx/CHANGELOG.md b/docx/CHANGELOG.md index 358a6c9..ac21ce1 100644 --- a/docx/CHANGELOG.md +++ b/docx/CHANGELOG.md @@ -1,4 +1,23 @@ -# [0.43.0](https://github.com/shelllet/winui/compare/main...dev) (2025-04-07) +# [0.44.0](https://github.com/shelllet/winui/compare/main...dev) (2025-05-03) + +### Changed: +1. [相机类型](./actions/type/TypeCamera.md) 动作支持工业 USB3/GIGE 接口相机,比如海康相机。 +2. 更新 [文字识别](./actions/ai/PaddleOCR.md) 动作,运行加载其它语言模型,用来识别中英文以外的文字。 +3. 更新 [文字识别(Tesseract)](./actions/ai/TesseractOCR.md) 动作, 支持基于 *Tesseract* (常用来识别特殊字体)的文字识别。 +4. 添加动作菜单*缓存对象*。 用来解决 某些动作反复执行时,由于内置对象的初始化比较耗,导致不必要的时间开销。 +5. 动作支持借助脚本更新运行时参数,详情参考动作说明。 +6. 修复导入其它流程崩溃问题。 +7. 修复 Web 自动化浏览器无正常退出问题。 +8. 修复 [图像匹配](./actions/detection/MatchImage.md) 不显示另 `Else` 连接点。 +9. 修复 打开流程后,按 *Enter* 键崩溃问题。 + +### Note + +1. 使用管理员权限运行 *小友+*, 无法显示 *动作* 的拖动效果(已知问题)。 +2. 64位下载(x64):https://winui.net/_media/simple/小友+0.44.0-setup.x64.exe + + +## [0.43.0](https://github.com/shelllet/winui/compare/main...dev) (2025-04-07) ### Changed: 1. 增加[图像匹配](./actions/detection/MatchImage.md) 动作。 diff --git a/docx/_coverpage.md b/docx/_coverpage.md index e1b040e..f3944dc 100644 --- a/docx/_coverpage.md +++ b/docx/_coverpage.md @@ -7,7 +7,7 @@ - Right now support down to build 17763 (version 1809/October 2018 Update) of Windows 10.. -[微软商店](https://apps.microsoft.com/store/detail/XP9BRHTXN0Z3V7) +[微软商店](https://apps.microsoft.com/detail/xp9lv7v0p6s74z?hl=en-US&gl=CN) [下载](https://api.winui.net/simple/v5/download_latest ':id=simple') diff --git a/docx/_sidebar.md b/docx/_sidebar.md index 8e97f03..cc50b6c 100644 --- a/docx/_sidebar.md +++ b/docx/_sidebar.md @@ -14,10 +14,18 @@ - [鼠标/键盘宏录制](./introduction/workflow/record) - [变量](./introduction/workflow/variable.md) - [资源](./introduction/workflow/resources.md) + - [动作](./introduction/workflow/action.md) - [流程操作技巧](./introduction/workflow/skill.md) - - [通配符匹配](./introduction/workflow/wildcard.md) - - [Glob模式匹配](./introduction/workflow/glob.md) + - 其它 + - [Glob模式](./introduction/mixed/glob.md) + - [通配符](./introduction/mixed/wildcard.md) - [Web 定位策略](./introduction/webdriver/locators.md) + - [Tesseract 支持的语言](./introduction/tesseract/Languages_Scripts.md) + - [Tesseract 数据文件](./introduction/tesseract/Data-Files.md) + - [Tesseract 5 的训练](./introduction/tesseract/tesstrain.md) + - [ Windows 系统上安装 CUDA](./introduction/mixed/CUDA.md) + - [cuDNN 和 CUDA 版本对应关系](./introduction/mixed/cuDNN.md) + - [Paddle2ONNX模型转化](./introduction/mixed/paddle2onnx.md) - [UIAutomatorViewer 工具](./introduction/android/uiautomatorviewer.md) - [动作](./actions/README.md) - 系统 @@ -134,10 +142,11 @@ - 深度学习 - [目标分类](./actions/ai/ImageClassification.md) - [对象检测](./actions/ai/ObjectDetection.md) - - [文字识别](./actions/ai/ImageOCR.md) + - [文字识别](./actions/ai/PaddleOCR.md) - [文本块检测](./actions/ai/TextDetection.md) - [二维码识别](./actions/ai/QRCode.md) - [条码识别](./actions/ai/BarcodeDetector.md) + - [文字识别(Tesseract)](./actions/ai/TesseractOCR.md) - 媒体 - [窗口截图](./actions/media/CaptureWindow.md) - [全屏截图](./actions/media/CaptureFullScreen.md) @@ -236,6 +245,7 @@ - [关系运算](./actions/control/RelationalOperator.md) - [参数](./actions/control/Param.md) - [分组](./actions/control/GroupAction.md) + - [软触发](./actions/control/SoftwareTrigger.md) - 算法 - [分割字符串](./actions/algorithm/SplitString.md) - [合并字符串](./actions/algorithm/JoinString.md) @@ -340,4 +350,8 @@ - [WebLocated](./enums/WebLocated.md) - [ModuleOption](./enums/ModuleOption.md) - [BARCODE_Encoding](./enums/BARCODE_Encoding.md) + - [PageSegMode](./enums/PageSegMode.md) + - [CameraTriggerActivation](./enums/CameraTriggerActivation.md) + - [CameraTriggerSource](./enums/CameraTriggerSource.md) + - [CameraType](./enums/CameraType.md) - [Changelog](./CHANGELOG.md) \ No newline at end of file diff --git a/docx/actions/ai/ImageOCR.md b/docx/actions/ai/PaddleOCR.md similarity index 69% rename from docx/actions/ai/ImageOCR.md rename to docx/actions/ai/PaddleOCR.md index 5eae545..8ef95be 100644 --- a/docx/actions/ai/ImageOCR.md +++ b/docx/actions/ai/PaddleOCR.md @@ -1,7 +1,7 @@ # 文字识别 识别图像中的中文/英文文字。 -![ImageOCR](./images/03.png ':size=90%') +![PaddleOCR](./images/03.png ':size=90%') ## 子流程 > 不支持 @@ -20,13 +20,21 @@ * 角度分类器 > 指定是否使用角度分类器,默认识别:0°、90° 、270°。 如果使用,则可识别旋转180°的图片。如果文本没有旋转180°,为了性能,请不要使用该选项。其它文本旋转角度无法准确识别。 +* 检测模型 +> 检测模型文件,用于非内置语言检测。 +* 分类器模型 +> 角度分类模型文件,用于非内置语言检测。 +* 识别模型 +> 识别模型文件,用于非内置语言检测。 +* 字典文件 +> 字典文件,参考:[Paddle2ONNX模型转化与预测](./introduction/mixed/paddle2onnx.md)。 ## 输出 > 识别结果, 参考: [`RecognitionResults`](./types/RecognitionResult.md)。 ### 其它 -示例 https://github.com/shelllet/WinUi/blob/main/dnn/ImageOCR.simple +示例 https://github.com/shelllet/WinUi/blob/main/dnn/PaddleOCR.simple diff --git a/docx/actions/ai/TesseractOCR.md b/docx/actions/ai/TesseractOCR.md new file mode 100644 index 0000000..e96ae6d --- /dev/null +++ b/docx/actions/ai/TesseractOCR.md @@ -0,0 +1,33 @@ +# 文字识别(Tesseract) +基于 Tesseract OCR 的一款开源的光学字符识别引擎。能够识别多种语言的文字,包括但不限于英语、中文、法语、德语等。 + +* 支持多种语言:Tesseract 能够识别多种语言的文字,包括但不限于英语、中文、法语、德语等。通过训练数据的扩展,其语言识别能力还在不断增强。 +* 高识别准确率:在经过大量数据训练和优化后,对于清晰的文档图像,Tesseract 可以达到较高的识别准确率。它能够处理多种字体、字号和排版格式的文字,对噪声和图像变形有一定的鲁棒性。 +* 可定制性强:用户可以根据自己的需求对 Tesseract 进行定制,例如训练自己的字库模型,以提高对特定领域或特殊字体的识别效果。此外,还可以调*整各种参数来优化识别过程,适应不同的应用场景。 + +![TesseractOCR](./images/07.png ':size=90%') + +## 子流程 +> 不支持 + +## 运行参数 + +* 图像 +> 包含文字的图片。 + +* 数据文件 +> 默认值为 NULL,包含了 **英语**、**中文 - 简体** 和 **中文 - 繁体**。 它指定了 Tesseract 数据文件所在的路径。其它语言需要下载对应的数据文件,参考:[训练数据文件](./introduction/tesseract/Data-Files)。 + +* 识别语言 +> 默认值为 "eng"。它指定了要识别的语言,可以使用 ISO 639-3 语言代码来指定语言,例如 "eng" 表示英语,"chi_sim" 表示简体中文。如果要同时识别多种语言,可以用 "+" 连接不同的语言代码,如 "eng+chi_sim",参考: [Tesseract 支持的语言](./introduction/tesseract/Languages_Scripts) + +* 页面分割模式 +> 默认值为 `AUTO` 。它指的是页面分割模式(Page Segmentation Mode),决定了 Tesseract 如何对图像中的页面进行分割和识别,例如是按行识别、按单词识别还是按单个字符识别等。参考:[PageSegMode](./enums/PageSegMode.md)。 + +## 输出 + +> 识别结果, 参考: [`RecognitionResults`](./types/RecognitionResult.md)。 + +### 其它 + +示例 https://github.com/shelllet/WinUi/blob/main/dnn/PaddleOCR.simple diff --git a/docx/actions/ai/images/07.png b/docx/actions/ai/images/07.png new file mode 100644 index 0000000..bef5ac6 Binary files /dev/null and b/docx/actions/ai/images/07.png differ diff --git a/docx/actions/algorithm/FilterText.md b/docx/actions/algorithm/FilterText.md index 9980196..e3cf7d5 100644 --- a/docx/actions/algorithm/FilterText.md +++ b/docx/actions/algorithm/FilterText.md @@ -10,7 +10,7 @@ ## 运行参数 * 数据 -> 含有文本的列表,例如 [*文字识别*](./actions/ai/ImageOCR.md) 动作。 +> 含有文本的列表,例如 [*文字识别*](./actions/ai/PaddleOCR.md) 动作。 * 文本 > 文本,*字符串* 类型,参考:[String](./types/String.md), 支持 [*通配符(WildCard)*](./introduction/process/wildcard.md) 匹配。 diff --git a/docx/actions/algorithm/JoinString.md b/docx/actions/algorithm/JoinString.md index 5b49dff..23b499b 100644 --- a/docx/actions/algorithm/JoinString.md +++ b/docx/actions/algorithm/JoinString.md @@ -1,5 +1,5 @@ # 合并字符串 -将字符串列表,或者含有字符串的列表(如 [文本检测](./actions/ai/ImageOCR.md)),合并成字符串。 +将字符串列表,或者含有字符串的列表(如 [文本检测](./actions/ai/PaddleOCR.md)),合并成字符串。 ![JoinString](./images/16.png ':size=90%') diff --git a/docx/actions/cloud/BaiduTranslate.md b/docx/actions/cloud/BaiduTranslate.md index 3c69a9d..3447fd3 100644 --- a/docx/actions/cloud/BaiduTranslate.md +++ b/docx/actions/cloud/BaiduTranslate.md @@ -1,7 +1,7 @@ # 百度翻译 百度翻译 -![action](./images/2022-11-17_184608.png ':size=90%') +![BaiduTranslate](./images/01.png ':size=90%') ## 子流程 @@ -9,11 +9,16 @@ ## 运行参数 -* [AppID]():AppID -* [Secret]:Secret -* From:源语言 -* To:目标语言 -* Text:翻译的文本 +* AppID +> AppID +* Secret +> Secret +* 源语言 +> +* 目标语言 +> +* 文本 +> 翻译的文本 ## 输出 @@ -21,13 +26,5 @@ > 翻译后的文本 -## 脚本调用 - -```python -import simple - - -``` - ## 示例 diff --git a/docx/actions/cloud/images/01.png b/docx/actions/cloud/images/01.png new file mode 100644 index 0000000..e1d3a16 Binary files /dev/null and b/docx/actions/cloud/images/01.png differ diff --git a/docx/actions/control/SoftwareTrigger.md b/docx/actions/control/SoftwareTrigger.md new file mode 100644 index 0000000..d882192 --- /dev/null +++ b/docx/actions/control/SoftwareTrigger.md @@ -0,0 +1,23 @@ +# 软触发 +工业相机的软触发(Software Trigger)是通过软件指令控制图像采集的技术,适用于需要灵活控制采集时机的场景(如机器视觉检测、动态目标捕捉)。如果工业相机设置了软触发模式,该动作可以触发相机拍照。 + +![SoftwareTrigger](./images/04.png ':size=90%') + + +## 子流程 +> 不支持 + + +## 运行参数 + + +* 对象 +> 相机对象,参考:[相机](./actions/type/TypeCamera.md)。 + + +## 输出 + +> 无。 + +## 其它 + diff --git a/docx/actions/type/TypeCamera.md b/docx/actions/type/TypeCamera.md index 63a0dfb..6940846 100644 --- a/docx/actions/type/TypeCamera.md +++ b/docx/actions/type/TypeCamera.md @@ -2,33 +2,36 @@ 定义相机类型,当前系统必须连接相机设备,且不被占用(USB相机通常已经连接)。工业 *GIGE* 接口的相机需要手动安装相应的驱动程序。 ![TypeCamera](./images/15.png ':size=90%') -* 该动作不能获取相机图像,需要配合动作 [相机图像](./actions/media/VideoFrame.md) 获取相机图像。 +* 该动作在非触发模式,需要配合动作 [相机图像](./actions/media/VideoFrame.md) 获取相机图像。 + ## 权限 > 无要求 ## 子流程 -> 支持。 +> 支持。非触发模式相机对象传子流程。触发模式时,相机图像转入子流程。 ## 运行参数 * 相机 > 相机索引,默认值:`0`,表示第 `1` 个相机设备。 +- 类型 +> 相机类型,参考:[CameraType](./enums/CameraType.md)。 -## 输出 - -> 相机对象,参考:[VideoCapture](./types/VideoCapture.md)。 +* 触发模式 +> 触发模式开关,只支持相机是 GIGE/USB3 工业相机。 +* 触发源 +> 只支持触发模式打开时设置。参考:[CameraTriggerSource](./enums/CameraTriggerSource.md)。 -## 脚本调用 -```python -import simple; +* 触发激活方式 +> 只支持触发模式打开时设置。参考:[CameraTriggerActivation](./enums/CameraTriggerActivation.md)。 -cap = VideoCapture(0) +## 输出 -``` +> 相机对象,参考:[VideoCapture](./types/VideoCapture.md)。 ## 示例 diff --git a/docx/actions/type/images/15.png b/docx/actions/type/images/15.png index f99bfcc..634a5c8 100644 Binary files a/docx/actions/type/images/15.png and b/docx/actions/type/images/15.png differ diff --git a/docx/enums/CameraTriggerActivation.md b/docx/enums/CameraTriggerActivation.md new file mode 100644 index 0000000..8d72324 --- /dev/null +++ b/docx/enums/CameraTriggerActivation.md @@ -0,0 +1,13 @@ +# CameraTriggerActivation + +* RisingEdge +> 上升沿 +* FallingEdge +> 下降沿 +* LevelHigh + +> 高电平 + +* LevelLow + +> 低电平 \ No newline at end of file diff --git a/docx/enums/CameraTriggerSource.md b/docx/enums/CameraTriggerSource.md new file mode 100644 index 0000000..2acbd32 --- /dev/null +++ b/docx/enums/CameraTriggerSource.md @@ -0,0 +1,11 @@ +# CameraTriggerSource +- Line0 +> 非隔离输入(如海康相机)。 +- Line1 + +- Line2 + +> 可配置为输入/输出的双向I/O(如LEO系列相机)。 +- Software + +> 通过主机发送软件命令触发拍照,优点是配置灵活,但触发速度和精度低于硬件触发 \ No newline at end of file diff --git a/docx/enums/CameraType.md b/docx/enums/CameraType.md new file mode 100644 index 0000000..9161d9b --- /dev/null +++ b/docx/enums/CameraType.md @@ -0,0 +1,8 @@ +# CameraType + +- USB2 + +- USB3 +> 常见于工业相机接口 +- GIGE +> 常见于工业相机接口 \ No newline at end of file diff --git a/docx/enums/PageSegMode.md b/docx/enums/PageSegMode.md new file mode 100644 index 0000000..28302e5 --- /dev/null +++ b/docx/enums/PageSegMode.md @@ -0,0 +1,24 @@ +# PageSegMode + +* AUTO (3) +> 自动检测页面布局并进行识别。这是最常用的模式之一,Tesseract 会自动分析图像的布局,尝试确定文字的行、段落等结构,然后进行识别。适用于大多数普通文档图像。 +* SINGLE_COLUMN (4) +> 假定图像包含一个垂直排列的单列文本。当图像中的文字是以单列形式排列时,使用此模式可以更准确地识别文字,引擎会按照单列文本的结构进行处理。 +* SINGLE_BLOCK_VERT_TEXT (5) +> 假定图像包含一个垂直排列的文本块。如果图像中的文字是垂直书写的,并且形成一个整体的文本块,使用该模式可以更好地进行识别。 +* SINGLE_BLOCK (6) +> 假定图像包含一个统一的文本块。对于没有明显分行或段落结构的图像,如一些标语、横幅等,使用此模式可以将整个图像作为一个文本块进行识别。 +* SINGLE_LINE (7) +> 将图像视为单行文本进行识别。适用于只包含一行文字的图像,如标题、菜单等,引擎会专注于识别这一行文字。 +* SINGLE_WORD (8) +> 将图像视为单个单词进行识别。当图像中只包含一个单词时,使用此模式可以提高识别的准确性。 +* CIRCLE_WORD (9) +> 将图像视为单个单词,且该单词可能是圆形排列的。对于一些以圆形方式排列的文字,如商标、徽章上的文字,此模式可以更好地进行识别。 +* SINGLE_CHAR (10) +> 将图像视为单个字符进行识别。用于识别只包含一个字符的图像,例如验证码中的单个字符。 +* SPARSE_TEXT (11) +> 在图像中查找稀疏分布的文本,不进行特定的页面布局分析。当图像中的文字分布比较分散,没有明显的布局结构时,使用此模式可以找出所有的文字。 +* SPARSE_TEXT_OSD (12) +> 在图像中查找稀疏分布的文本,并进行方向和脚本检测。结合了方向和脚本检测功能,适用于文字分布稀疏且方向不确定的图像。 +* RAW_LINE (13) +> 直接将图像中的像素作为原始文本行进行识别,不进行任何页面分割或预处理。这种模式适用于一些特殊情况,如手写文字或经过特殊处理的图像,引擎会尽量直接识别像素中的文字信息。 \ No newline at end of file diff --git a/docx/introduction/mixed/CUDA.md b/docx/introduction/mixed/CUDA.md new file mode 100644 index 0000000..bad705f --- /dev/null +++ b/docx/introduction/mixed/CUDA.md @@ -0,0 +1,51 @@ +在 Windows 系统上安装 CUDA 的详细步骤: + +### 1. 确认显卡支持 +- 要保证你的 NVIDIA 显卡支持 CUDA,你可以访问 [NVIDIA 官方 CUDA GPU 支持列表](https://developer.nvidia.com/cuda-gpus) 来确认显卡型号是否在支持范围内。 +- 可以通过以下操作查看显卡型号:在桌面上右键点击,选择“显示设置”,接着点击“显示”选项卡下的“高级显示设置”,再点击“显示适配器属性”,在弹出窗口中就能看到显卡的具体型号。 + +### 2. 下载 CUDA Toolkit +- 访问 [NVIDIA CUDA Toolkit 下载页面](https://developer.nvidia.com/cuda-downloads)。 +- 在页面中进行如下选择: + - **操作系统**:选择 “Windows”。 + - **版本**:根据你的 Windows 系统版本选择,如 Windows 10 或 Windows 11。 + - **架构**:一般选择 “x86_64”。 + - **安装类型**:可选择 “exe(local)”。 +- 点击 “下载” 按钮,等待下载完成。 + +### 3. 运行安装程序 +- 找到下载好的 `.exe` 安装文件并双击运行。 +- 在安装向导中,阅读并接受许可协议。 +- 选择安装类型,推荐选择 “自定义”,这样你可以根据需求决定安装哪些组件。一般来说,`CUDA` 核心组件是必须安装的,`NVIDIA Nsight Compute` 等工具可按需选择。 +- 选择安装路径,建议使用默认路径,这样能避免一些潜在的路径相关问题。 +- 点击 “安装” 按钮,等待安装过程完成,这可能需要一些时间。 + +### 4. 安装过程中可能遇到的问题及解决办法 +- **驱动程序冲突**:如果系统中已经安装了旧版本的 NVIDIA 显卡驱动,安装过程中可能会提示冲突。此时可以选择先卸载旧驱动,再进行 CUDA 安装;或者在安装 CUDA 时,让安装程序自动更新显卡驱动。 +- **空间不足**:确保安装磁盘有足够的空间,安装 CUDA 可能需要数 GB 的磁盘空间。 + +### 5. 配置环境变量 +- 安装完成后,需要配置系统环境变量,以确保系统能够找到 CUDA 相关的可执行文件和库文件。 +- 右键点击 “此电脑”,选择 “属性”。 +- 点击 “高级系统设置”,在弹出的窗口中点击 “环境变量”。 +- 在 “系统变量” 中找到 `Path` 变量,点击 “编辑”。 +- 点击 “新建”,添加以下两个路径(其中 `vXX.X` 是你安装的 CUDA 版本号): + - `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vXX.X\bin` + - `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vXX.X\libnvvp` +- 点击 “确定” 保存设置。 + +### 6. 验证安装 +- 打开命令提示符(按下 `Win + R` 组合键,输入 `cmd` 并回车)。 +- 在命令提示符中输入以下命令查看 CUDA 版本: +```bash +nvcc --version +``` +如果能正常显示 CUDA 版本信息,说明安装成功。 +- 还可以运行 CUDA 自带的示例程序来进一步验证。进入 CUDA 示例程序的安装目录(通常为 `C:\ProgramData\NVIDIA Corporation\CUDA Samples\vXX.X`),找到并编译运行一些示例,如 `deviceQuery`。在命令提示符中进入该示例的目录,然后执行以下命令: +```bash +nvcc -o deviceQuery deviceQuery.cpp +deviceQuery.exe +``` +如果程序能够正常运行并输出显卡信息等内容,说明 CUDA 安装和配置都正常。 + +通过以上步骤,你就可以在 Windows 系统上成功安装 CUDA。 \ No newline at end of file diff --git a/docx/introduction/mixed/cuDNN.md b/docx/introduction/mixed/cuDNN.md new file mode 100644 index 0000000..9ac16e0 --- /dev/null +++ b/docx/introduction/mixed/cuDNN.md @@ -0,0 +1,81 @@ +# cuDNN 和 CUDA 版本对应关系 + +cuDNN 和 CUDA 的版本对应关系需要根据具体的软件版本和硬件环境进行匹配,以下是基于证据的详细总结: + +### 1. **官方兼容性说明(NVIDIA文档)** + - **主版本对应**: +cuDNN 的版本通常对应 CUDA 的主版本(如 `12.x` 或 `11.x`)。例如: +- **cuDNN 8.9.1** 分为两个分支: +- `cuDNN 8.9.1 for CUDA 12.x`:支持 CUDA 12.0、12.1 等次版本 。 +![](https://metaso-static.oss-cn-beijing.aliyuncs.com/metaso/pdf2texts_reading_mode/figures/ab861921-be8e-48d8-bd1c-3a6951326975/2_0.jpg) +- `cuDNN 8.9.1 for CUDA 11.x`:支持 CUDA 11.7、11.8 等次版本 。 +- **cuDNN 8.9.4** 同样支持 CUDA 12.x 系列的所有次版本(如 12.0、12.1、12.2)。 + - **静态链接与硬件支持**: +- CUDA 12.x 版本的 cuDNN 支持静态链接,而 CUDA 11.x 版本不支持 。 +- 不同 CUDA 主版本支持的 NVIDIA 硬件架构不同(如 CUDA 12.x 支持 Hopper 架构,CUDA 11.x 支持 Turing 架构)。 + +### 2. **第三方框架的兼容性(TensorFlow/PyTorch/ONNX Runtime)** +- **TensorFlow**: + - 不同 TensorFlow 版本对 CUDA 和 cuDNN 有明确要求。例如: + - TensorFlow 1.11.0 需要 CUDA 9.0 和 cuDNN 7.1.2 。 + - TensorFlow 2.1 需要 CUDA 10.1 和 cuDNN 7.6 。 + - 需参考 [TensorFlow官方文档](https://www.tensorflow.org/install/source ) 获取最新对应关系 。 +- **PyTorch**: +- 需根据 PyTorch 版本选择兼容的 CUDA 和 cuDNN 组合。例如,PyTorch 2.0 通常需要 CUDA 11.7/11.8 和 cuDNN 8.x 。 +- **ONNX Runtime**,具体参考:[CUDA Execution Provider](https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html): + - **ONNX Runtime 1.17.x**:对应 CUDA 12.2,cuDNN 8.9.2.26。 + - **ONNX Runtime 1.15.x - 1.16.x**:对应 CUDA 11.8,cuDNN 8.2.4(Linux)/8.5.0.96(Windows)。 + - **ONNX Runtime 1.13.x - 1.14.x**:对应 CUDA 11.6,cuDNN 8.2.4(Linux)/8.5.0.96(Windows)。 + - **ONNX Runtime 1.11.x - 1.12.x**:对应 CUDA 11.4,cuDNN 8.2.4(Linux)/8.2.2.26(Windows)。 + - **ONNX Runtime 1.9.x - 1.10.x**:对应 CUDA 11.4,cuDNN 8.2.4(Linux)/8.2.2.26(Windows)。 + - **ONNX Runtime 1.7.x - 1.8.x**:对应 CUDA 11.0.3,cuDNN 8.0.4(Linux)/8.0.2.39(Windows)。 + +cuDNN和CUDA有较为明确的版本对应关系,以下是一些常见的对应版本: +- **CUDA 10.0**:对应 cuDNN 7.4。 +- **CUDA 10.1**:对应 cuDNN 7.6。 +- **CUDA 10.2**:对应 cuDNN 7.6。 +- **CUDA 11.0**:对应 cuDNN 8.0。 +- **CUDA 11.1**:对应 cuDNN 8.0。 +- **CUDA 11.2**:对应 cuDNN 8.1。 + + + +一般来说,cuDNN的版本可能会有向前兼容性,即较新版本的cuDNN也可以与较旧版本的CUDA一起使用,但不保证所有功能都能正常工作。在实际应用中,为了确保深度学习框架能够正常运行并获得最佳性能,建议按照官方文档的要求来选择匹配的CUDA和cuDNN版本。 + + +### 3. **版本查询与验证方法** + - **查看 CUDA 版本**: +- 命令行输入 `nvcc --version` 或 `nvidia-smi`(显示驱动支持的最高 CUDA 版本)。 + - **查看 cuDNN 版本**: +- 检查 CUDA 安装目录下的 `cudnn.h` 文件(Windows/Linux均适用)。例如: +```bash + cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2 # Linux +``` +或打开 `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.X\include\cudnn.h`(Windows)。 + +### 4. **关键注意事项** + - **驱动版本要求**: +- CUDA 和 cuDNN 的安装需满足 NVIDIA 驱动的最低版本。例如: +- CUDA 12.x 要求 Linux 驱动 ≥525.60.13,Windows 驱动 ≥527.41 。 +- CUDA 11.x 要求 Linux 驱动 ≥450.80.02,Windows 驱动 ≥452.39 。 + - **向下兼容性**: +- CUDA 驱动向下兼容,但 cuDNN 必须与 CUDA 主版本严格匹配。例如,CUDA 12.1 需使用 `cuDNN for CUDA 12.x`,而非 `11.x` 。 + - **历史版本对应**: +- 旧版本对应关系(仅供参考,可能已过时): +- CUDA 10.0 → cuDNN 7.4 ;CUDA 9.0 → cuDNN 7.5 ;CUDA 8.0 → cuDNN 5.0 。 + +### 5. **推荐操作流程** + - **步骤 1**:根据深度学习框架(如 TensorFlow/PyTorch)的版本要求,确定所需的 CUDA 版本 。 + - **步骤 2**:在 [NVIDIA cuDNN Support Matrix](https://docs.nvidia.com/deeplearning/cudnn/backend/latest/reference/support-matrix.html) 中查找对应 CUDA 主版本的 cuDNN 版本 。 + - **步骤 3**:确保 NVIDIA 驱动版本满足 CUDA 的最低要求(通过 `nvidia-smi` 查看)。 + +### 总结表格(部分示例) + +| CUDA 主版本 | 兼容的 cuDNN 版本 | 备注 | +|------------|---------------------------|-------------------------------| +| 12.x | cuDNN 8.9.1、8.9.4 | 支持 Hopper 架构 | +| 11.x | cuDNN 8.9.1(仅限 11.7+) | 支持 Turing 架构 | +| 10.x | cuDNN 7.6.5 | 需参考旧版文档 | + + +建议始终参考 **NVIDIA 官方支持矩阵** 和框架文档以获取最新信息 。 \ No newline at end of file diff --git a/docx/introduction/workflow/glob.md b/docx/introduction/mixed/glob.md similarity index 98% rename from docx/introduction/workflow/glob.md rename to docx/introduction/mixed/glob.md index d6a23d0..a8b030f 100644 --- a/docx/introduction/workflow/glob.md +++ b/docx/introduction/mixed/glob.md @@ -1,4 +1,4 @@ -# Glob模式匹配 +# Glob模式 在编程中匹配字符最常见的工具是正则表达式,此外还有一种 *glob* 模式经常用于匹配文件路径,*glob* 模式在某些方面与正则表达式功能相同,但是他们各自有着不同的语法和约定。 diff --git a/docx/introduction/mixed/imgs/lite_demo.png b/docx/introduction/mixed/imgs/lite_demo.png new file mode 100644 index 0000000..c9daf1b Binary files /dev/null and b/docx/introduction/mixed/imgs/lite_demo.png differ diff --git a/docx/introduction/mixed/inference_results/lite_demo_onnx.png b/docx/introduction/mixed/inference_results/lite_demo_onnx.png new file mode 100644 index 0000000..4ee6be3 Binary files /dev/null and b/docx/introduction/mixed/inference_results/lite_demo_onnx.png differ diff --git a/docx/introduction/mixed/inference_results/lite_demo_paddle.png b/docx/introduction/mixed/inference_results/lite_demo_paddle.png new file mode 100644 index 0000000..b39771a Binary files /dev/null and b/docx/introduction/mixed/inference_results/lite_demo_paddle.png differ diff --git a/docx/introduction/mixed/paddle2onnx.md b/docx/introduction/mixed/paddle2onnx.md new file mode 100644 index 0000000..9cfe277 --- /dev/null +++ b/docx/introduction/mixed/paddle2onnx.md @@ -0,0 +1,293 @@ +# Paddle2ONNX模型转化与预测 + +本章节介绍 PaddleOCR 模型如何转化为 ONNX 模型,并在 *小友+* 中使用。 + +## 1. 环境准备 + +需要准备 Python、Paddle、 PaddleOCR、Paddle2ONNX 模型转化环境,和 ONNXRuntime 预测环境。 + +### Python + +1. 下载 Python 安装包,本章节使用 `3.12.9` 版本,下载链接:[https://www.python.org/ftp/python/3.12.9/python-3.12.9-amd64.exe](https://www.python.org/ftp/python/3.12.9/python-3.12.9-amd64.exe)。 +- 打开 Python 官方下载页面 [https://www.python.org/downloads/](https://www.python.org/downloads/)。 +- 页面会根据你的系统自动推荐合适的 Python 版本。通常建议选择最新的稳定版本,在页面中找到“Download Python x.x.x”(x.x.x 代表具体版本号)按钮并点击。若你的 Windows 系统是 64 位,下载 64 - bit 的安装包;若为 32 位系统,则下载 32 - bit 的安装包。 + +2. 运行安装程序 +- 找到下载好的 `.exe` 格式的安装文件,双击运行。 +- 在弹出的安装界面中,注意勾选“Add Python x.x to PATH”选项,这个操作能自动将 Python 可执行文件路径添加到系统的环境变量中,之后你就能在命令提示符里直接使用 Python 命令。 +- 你可以选择“Install Now”进行默认安装,也能点击“Customize installation”来自定义安装路径和组件。若不确定如何选择,建议直接点击“Install Now”。 +- 等待安装过程完成,这可能需要一些时间,取决于你的系统性能。 + +3. 验证 Python 安装 +- 按下 `Win + R` 组合键,打开“运行”对话框,输入 `cmd` 并回车,以此打开命令提示符窗口。 +- 在命令提示符中输入 `python --version` 并回车。若安装成功,会显示所安装的 Python 版本号,例如 `Python 3.11.5`。 + +4. 验证 pip 安装 +`pip` 是 Python 的包管理工具,一般会随 Python 一起安装。在命令提示符中输入 `pip --version` 并回车,若安装成功,会显示 `pip` 的版本信息以及对应的 Python 版本,例如 `pip 23.3.1 from C:\Python311\Lib\site-packages\pip (python 3.11)`。 + +5. 更新 pip(可选) +为保证能使用 `pip` 的最新特性和修复已知问题,可在命令提示符中运行以下命令来更新 `pip`: +```plaintext +python -m pip install --upgrade pip +``` + +### 虚拟环境 +在 Python 开发中,虚拟环境是一个非常有用的工具,它可以为每个项目创建独立的 Python 运行环境,避免不同项目之间的依赖冲突。 + +### 使用 `venv` 模块(Python 标准库自带) +`venv` 是 Python 3.3 及以上版本标准库中自带的虚拟环境创建工具,使用起来简单方便。 + +#### 步骤 +1. **打开命令行工具**:在 Windows 系统中可以使用命令提示符(CMD)或 PowerShell。 +2. **创建虚拟环境**:在命令行中进入你想要创建虚拟环境的目录,然后运行以下命令: + +```PowerShell +cd d:\onnx + +python -m venv myenv + +# PowerShell +.\myenv\Scripts\Activate.ps1 + +# CMD +# .\myenv\Scripts\activate.bat +``` +其中 `myenv` 是你要创建的虚拟环境的名称,你可以根据需要进行修改。 + +3. **激活虚拟环境**: + - **Windows(CMD)**: +```plaintext +myenv\Scripts\activate.bat +``` + - **Windows(PowerShell)**: +```plaintext +myenv\Scripts\Activate.ps1 +``` + +激活虚拟环境后,命令行提示符前面会显示虚拟环境的名称,表明你已经成功进入该虚拟环境。 + +4. **安装依赖包**:在虚拟环境中,你可以使用 `pip` 安装项目所需的依赖包,例如: +```plaintext +pip install requests +``` + +5. **退出虚拟环境**:当你完成开发工作后,可以在命令行中运行以下命令退出虚拟环境: +```plaintext +deactivate +``` + +### Paddle +在使用 `pip install paddle` 安装 PaddlePaddle(以下简称 Paddle)时,有一些要点需要注意,下面为你详细介绍不同环境下的安装步骤和注意事项。 + + +#### 1. 选择合适的 Paddle 版本 +Paddle 有 CPU 版本和 GPU 版本,你需要根据自己的硬件情况选择合适的版本。 +- **CPU 版本**:如果你的计算机没有 NVIDIA GPU 或者不需要使用 GPU 进行计算,那么选择 CPU 版本即可。 +- **GPU 版本**:如果你的计算机配备了 NVIDIA GPU,并且想利用 GPU 的计算能力加速训练和推理,那么需要安装 GPU 版本。同时,你还需要安装对应的 CUDA 和 cuDNN 库。 + +#### 2. 安装 Paddle +##### CPU 版本安装(推荐) +在命令行中运行以下命令安装 CPU 版本的 Paddle: +```bash +pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple +``` +这里 `-i https://mirror.baidu.com/pypi/simple` 是指定使用百度的 PyPI 镜像源,这样可以加快下载速度。 + +##### GPU 版本安装 +如果你要安装 GPU 版本,需要先确认你的 CUDA 和 cuDNN 版本,通过执行命令 **nvidia-smi.exe** 查看 CUDA 版本, 查看输出: +```` +nvidia-smi.exe + +Mon Apr 21 14:18:12 2025 ++-----------------------------------------------------------------------------------------+ +| NVIDIA-SMI 576.02 Driver Version: 576.02 CUDA Version: 12.9 | +|-----------------------------------------+------------------------+----------------------+ +| GPU Name Driver-Model | Bus-Id Disp.A | Volatile Uncorr. ECC | +| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | +| | | MIG M. | +|=========================================+========================+======================| +| 0 NVIDIA GeForce RTX 4060 ... WDDM | 00000000:01:00.0 Off | N/A | +| N/A 48C P0 13W / 140W | 0MiB / 8188MiB | 0% Default | +| | | N/A | ++-----------------------------------------+------------------------+----------------------+ + ++-----------------------------------------------------------------------------------------+ +| Processes: | +| GPU GI CI PID Type Process name GPU Memory | +| ID ID Usage | +|=========================================================================================| +| No running processes found | ++-----------------------------------------------------------------------------------------+ +```` +CUDA 参考 [Windows 系统上安装 CUDA](.\introduction\mixed\CUDA.md) 安装,检查相应的`C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\bin` 路径是否加入到环境变量`PATH`中。 + +[对应的cuDNN](.\introduction\mixed\cuDNN.md) 版本下载:[https://developer.nvidia.com/cudnn-archive](https://developer.nvidia.com/cudnn-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local)。解压之后 ,同样设置环境变量`PATH`。 + +``` +$env:PATH = "D:\onnx\cudnn-windows-x86_64-8.9.7.29_cuda12-archive\bin;$env:PATH;" +``` + +然后根据版本选择合适的安装命令。例如,如果你使用的是 CUDA 12.0 和 cuDNN 9.8,可以运行以下命令: +```bash +pip install paddlepaddle-gpu==2.6.1.post120 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html +``` +其中 `2.6.1.post120` 表示 Paddle 的版本,`120` 代表 CUDA 12.0。你可以根据自己的实际情况调整版本号。 + +### 4. 验证安装 +安装完成后,你可以在 Python 环境中验证 Paddle 是否安装成功。打开 Python 解释器,输入以下代码: +```python +import paddle +paddle.utils.run_check() +``` +如果输出类似 `PaddlePaddle is installed successfully!` 的信息,说明 Paddle 已经成功安装。 + +### 5. 错误 +当你遇到 No module named 'setuptools' 错误,意味着 Python 环境里没有安装 setuptools 模块。 +```` +pip install setuptools +```` + +### PaddleOCR + +克隆PaddleOCR的仓库,使用 main 分支,并进行安装,由于 PaddleOCR 仓库比较大,git clone 速度比较慢,或使用国内镜像站点下载。 + +使用虚拟环境:```(myenv) PS D:\onnx>```。 + +``` +git clone -b main https://github.com/PaddlePaddle/PaddleOCR.git +cd PaddleOCR +python -m pip install -e . +``` + +### Paddle2ONNX + +Paddle2ONNX 支持将 PaddlePaddle 模型格式转化到 ONNX 模型格式,算子目前稳定支持导出 ONNX Opset 9~18,部分Paddle算子支持更低的ONNX Opset转换。 +更多细节可参考 [Paddle2ONNX](https://github.com/PaddlePaddle/Paddle2ONNX/tree/develop)。 +使用虚拟环境:```(myenv) PS D:\onnx>```。 +- 安装 Paddle2ONNX +``` +python -m pip install paddle2onnx +``` + +- 安装 ONNXRuntime +``` +python -m pip install onnxruntime +``` + +## 2. 模型转换 + + +- Paddle 模型下载 + +在 [模型列表](https://paddlepaddle.github.io/PaddleOCR/latest/model/index.html) 中下载PaddleOCR提供的预测模型。通常包含3种模型,其中 **方向分类器** 更新较慢,如果版本号琶可直接使用。 + + +以 PP-OCRv4 中文检测、识别、分类模型为例: + +``` +# 检测模型 +wget -O ./ch_PP-OCRv4_det_infer.tar https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_det_infer.tar + +# 方向分类器 +wget -O ./ch_ppocr_mobile_v2.0_cls_infer.tar https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar + +# 识别模型 +wget -O ./ch_PP-OCRv4_rec_infer.tar https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_rec_infer.tar + +tar xf ch_PP-OCRv4_det_infer.tar + +tar xf ch_ppocr_mobile_v2.0_cls_infer.tar + +tar xf ch_PP-OCRv4_rec_infer.tar + + +``` + +- 模型转换(包含3种基础模型) + +使用 Paddle2ONNX 将Paddle静态图模型转换为ONNX模型格式: + +```PowerShell +paddle2onnx --model_dir ./ch_PP-OCRv4_det_infer ` +--model_filename inference.pdmodel ` +--params_filename inference.pdiparams ` +--save_file ./det_model.onnx ` +--opset_version 14 ` +--enable_onnx_checker True + +paddle2onnx --model_dir ./ch_PP-OCRv4_rec_infer ` +--model_filename inference.pdmodel ` +--params_filename inference.pdiparams ` +--save_file ./rec_model.onnx ` +--opset_version 14 ` +--enable_onnx_checker True + +paddle2onnx --model_dir ./ch_ppocr_mobile_v2.0_cls_infer ` +--model_filename inference.pdmodel ` +--params_filename inference.pdiparams ` +--save_file ./cls_model.onnx ` +--opset_version 14 ` +--enable_onnx_checker True +``` + +执行完毕后,ONNX 模型会被分别保存为 `./det_model.onnx`,`./rec_model.onnx`,`./cls_model.onnx/` + +* 注意:对于OCR模型,转化过程中必须采用动态shape的形式,否则预测结果可能与直接使用Paddle预测有细微不同。 + 另外,以下几个模型暂不支持转换为 ONNX 模型: + NRTR、SAR、RARE、SRN + +* 注意:[当前Paddle2ONNX版本(v1.2.3)](https://github.com/PaddlePaddle/Paddle2ONNX/releases/tag/v1.2.3)现已默认支持动态shape,即 `float32[p2o.DynamicDimension.0,3,p2o.DynamicDimension.1,p2o.DynamicDimension.2]`,选项 `--input_shape_dict` 已废弃。如果有shape调整需求可使用如下命令进行Paddle模型输入shape调整。 + + ``` + python3 -m paddle2onnx.optimize --input_model inference/det_onnx/model.onnx ` + --output_model inference/det_onnx/model.onnx ` + --input_shape_dict "{'x': [-1,3,-1,-1]}" + ``` + +## 3. 推理预测 + +需要先安装 opencv、shapely、pyclipper等依赖包, 以中文OCR模型为例,使用 ONNXRuntime 预测可执行如下命令: + +``` +pip install opencv-python +pip install shapely +pip install pyclipper +pip install scikit-image +pip install albumentations +pip install lmdb +``` +``` +cd PaddleOCR +python ./tools/infer/predict_system.py --use_gpu=False --use_onnx=True ` +--det_model_dir=../model/det_model.onnx ` +--rec_model_dir=../model/rec_model.onnx ` +--cls_model_dir=../model/cls_model.onnx ` +--image_dir=./deploy/lite/imgs/lite_demo.png +``` + +以中文OCR模型为例,使用 Paddle Inference 预测可执行如下命令: + +``` +cd PaddleOCR +python ./tools/infer/predict_system.py --use_gpu=False ` +--rec_image_shape=3,48,320 ` +--cls_model_dir=../model/ch_ppocr_mobile_v2.0_cls_infer ` +--rec_model_dir=../model/ch_PP-OCRv4_rec_infer ` +--det_model_dir=../model/ch_PP-OCRv4_det_infer ` +--image_dir=./deploy/lite/imgs/lite_demo.png +``` + + +执行命令后在终端会打印出预测的识别信息,并在 `./inference_results/` 下保存可视化结果。 + +ONNXRuntime 执行效果: + +
+ +
+ +Paddle Inference 执行效果: + +
+ +
diff --git a/docx/introduction/workflow/wildcard.md b/docx/introduction/mixed/wildcard.md similarity index 99% rename from docx/introduction/workflow/wildcard.md rename to docx/introduction/mixed/wildcard.md index de25bd5..0641730 100644 --- a/docx/introduction/workflow/wildcard.md +++ b/docx/introduction/mixed/wildcard.md @@ -1,4 +1,4 @@ -# 通配符匹配 +# 通配符 ### 通配符示例 diff --git a/docx/introduction/tesseract/Data-Files.md b/docx/introduction/tesseract/Data-Files.md new file mode 100644 index 0000000..caef44a --- /dev/null +++ b/docx/introduction/tesseract/Data-Files.md @@ -0,0 +1,106 @@ +## 训练数据文件 + +我们有三套由谷歌训练的官方 `.traineddata` 文件,适用于 `tesseract` 4.00 及更高版本。这些文件分别存放在三个不同的代码仓库中。 + +* [tessdata_fast](https://github.com/tesseract-ocr/tessdata_fast)(2017 年 9 月)在速度与准确性之间具有最佳的 “性价比”,采用 `Integer`(整数)模型。 +* [tessdata_best](https://github.com/tesseract-ocr/tessdata_best)(2017 年 9 月)在谷歌的评估数据上能取得最佳结果,速度较慢,采用 `Float`(浮点数)模型。这些是唯一可以用作微调训练基础的模型。 +* [tessdata](https://github.com/tesseract-ocr/tessdata)(2016 年 11 月和 2017 年 9 月)这些包含 2016 年的旧版 Tesseract 模型。长短期记忆(LSTM)模型已使用 `tessdata_best` 长短期记忆模型的整数版本进行了更新。(基于 Cube 的印地语、阿拉伯语等旧版 Tesseract 模型已被删除)。 + +当使用来自 **`tessdata_best`** 和 **`tessdata_fast`** 代码仓库的训练数据文件时,仅支持基于新的长短期记忆(LSTM)的光学字符识别(OCR)引擎(--oem 1)。这些文件不支持旧版 Tesseract 引擎(--oem 0),所以 Tesseract 的 `oem 模式` '0' 和 '2' 对它们不起作用。 + +## 特殊数据文件 + +| 语言代码 | 描述 | 4.x/3.0x 训练数据文件 | +| :-------- | :---------- | :------------------- | +| osd | 方向和文字脚本检测 | [osd.traineddata](https://github.com/tesseract-ocr/tessdata/raw/3.04.00/osd.traineddata) | +| equ | 数学 / 公式检测 | [equ.traineddata](https://github.com/tesseract-ocr/tessdata/raw/3.04.00/equ.traineddata) | + +**注意**:这两个数据文件与旧版本的 Tesseract 兼容。`osd` 与 3.01 及更高版本兼容,`equ` 与 3.02 及更高版本兼容。 + +## 更新后的数据文件(2017 年 9 月 15 日) + +我们在 GitHub 上的三个不同代码仓库中有三套 `.traineddata` 文件。这些文件与 Tesseract 4.0x **+** 和 5.0.0.Alpha 兼容。 + +| | 训练模型 | 速度 | 准确性 | 支持旧版识别器 | 可重新训练 | +| :--------------- | :---------------------------------------------------------- | :--------------------------- | :------------------------------------------ | :----------------- | :------------- | +| [tessdata](https://github.com/tesseract-ocr/tessdata) | 旧版 + 长短期记忆(LSTM)(整数化的 `tessdata_best` 模型) | 比 `tessdata_best` 快 | 准确性略低于 `tessdata_best` | 是 | 否 | +| [tessdata_best](https://github.com/tesseract-ocr/tessdata_best) | 仅长短期记忆(LSTM)(基于 [langdata](https://github.com/tesseract-ocr/langdata)) | 最慢 | 最准确 | 否 | 是 | +| [tessdata_fast](https://github.com/tesseract-ocr/tessdata_fast) | 比 `tessdata_best` 网络更小的整数化长短期记忆(LSTM)模型 | 最快 | 最不准确 | 否 | 否 | + +大多数用户会需要 `tessdata_fast`,并且它将作为 Linux 发行版的一部分发布。 + +`tessdata_best` 适合那些愿意牺牲大量速度以换取稍高准确性的用户。对于高级用户,它也是唯一一套可用于某些重新训练场景的文件。 + +`tessdata` 中的第三套文件是唯一支持旧版识别器的。2016 年 11 月的 4.00 文件同时包含旧版和较旧的长短期记忆(LSTM)模型。`tessdata` 中的当前文件集包含旧版模型和较新的长短期记忆(LSTM)模型(`tessdata_best` 中 4.00.00 alpha 模型的整数版本)。 + +**注意**:当使用 `tessdata_best` 和 `tessdata_fast` 代码仓库中的新模型时,仅支持基于新的长短期记忆(LSTM)的光学字符识别(OCR)引擎。这些文件不支持旧版引擎,所以 Tesseract 的 oem 模式 '0' 和 '2' 对它们不起作用。 + +## 4.00 版本的数据文件(2016 年 11 月 29 日) + +[tessdata 标记为 4.0.0](https://github.com/tesseract-ocr/tessdata/releases/tag/4.0.0) 包含 2017 年 9 月的模型,这些模型已使用 `tessdata_best` 长短期记忆(LSTM)模型的 `Integer`(整数)版本进行了更新。这套训练数据文件支持使用 --oem 0 的旧版识别器以及使用 --oem 1 的长短期记忆(LSTM)模型。 + +[tessdata 标记为 4.00](https://github.com/tesseract-ocr/tessdata/releases/tag/4.00) 包含 2016 年的模型。各个语言文件的链接列在下面的表格中。 + +**注意**:`kur` 数据文件自 3.04 版本后未更新。对于哥特体(Fraktur),请使用来自 `tessdata_fast` 或 `tessdata_best` 代码仓库的较新数据文件。 + +| 语言代码 | 语言 | 4.0 训练数据文件 | +| :--------- | :------- | :--------------- | +| afr | 南非荷兰语 | [afr.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/afr.traineddata) | +| amh | 阿姆哈拉语 | [amh.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/amh.traineddata) | +| ara | 阿拉伯语 | [ara.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/ara.traineddata) | +| asm | 阿萨姆语 | [asm.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/asm.traineddata) | +| aze | 阿塞拜疆语 | [aze.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/aze.traineddata) | +| aze_cyrl | 阿塞拜疆语(西里尔字母) | [aze_cyrl.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/aze_cyrl.traineddata) | +| bel | 白俄罗斯语 | [bel.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/bel.traineddata) | +| ben | 孟加拉语 | [ben.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/ben.traineddata) | +| bod | 藏语 | [bod.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/bod.traineddata) | +| bos | 波斯尼亚语 | [bos.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/bos.traineddata) | +| bul | 保加利亚语 | [bul.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/bul.traineddata) | +| cat | 加泰罗尼亚语;瓦伦西亚语 | [cat.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/cat.traineddata) | +| ceb | 宿务语 | [ceb.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/ceb.traineddata) | +| ces | 捷克语 | [ces.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/ces.traineddata) | +| chi_sim | 中文 - 简体 | [chi_sim.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/chi_sim.traineddata) | +| chi_tra | 中文 - 繁体 | [chi_tra.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/chi_tra.traineddata) | +| chr | 切罗基语 | [chr.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/chr.traineddata) | +| cym | 威尔士语 | [cym.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/cym.traineddata) | +| dan | 丹麦语 | [dan.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/dan.traineddata) | +| deu | 德语 | [deu.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/deu.traineddata) | +| dzo | 宗卡语 | [dzo.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/dzo.traineddata) | +| ell | 现代希腊语(1453 年 - 至今) | [ell.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/ell.traineddata) | +| eng | 英语 | [eng.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/eng.traineddata) | +| enm | 中世纪英语(1100 - 1500 年) | [enm.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/enm.traineddata) | +| epo | 世界语 | [epo.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/epo.traineddata) | +| est | 爱沙尼亚语 | [est.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/est.traineddata) | +| eus | 巴斯克语 | [eus.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/eus.traineddata) | +| fas | 波斯语 | [fas.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/fas.traineddata) | +| fin | 芬兰语 | [fin.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/fin.traineddata) | +| fra | 法语 | [fra.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/fra.traineddata) | +| frk | 德语哥特体 | [frk.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/frk.traineddata) | +| frm | 中世纪法语(约 1400 - 1600 年) | [frm.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/frm.traineddata) | +| gle | 爱尔兰语 | [gle.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/gle.traineddata) | +| glg | 加利西亚语 | [glg.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/glg.traineddata) | +| grc | 古希腊语(-1453 年) | [grc.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/grc.traineddata) | +| guj | 古吉拉特语 | [guj.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/guj.traineddata) | +| hat | 海地语;海地克里奥尔语 | [hat.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/hat.traineddata) | +| heb | 希伯来语 | [heb.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/heb.traineddata) | +| hin | 印地语 | [hin.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/hin.traineddata) | +| hrv | 克罗地亚语 | [hrv.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/hrv.traineddata) | +| hun | 匈牙利语 | [hun.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/hun.traineddata) | +| iku | 因纽特语 | [iku.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/iku.traineddata) | +| ind | 印度尼西亚语 | [ind.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/ind.traineddata) | +| isl | 冰岛语 | [isl.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/isl.traineddata) | +| ita | 意大利语 | [ita.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/ita.traineddata) | +| ita_old | 古意大利语 | [ita_old.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/ita_old.traineddata) | +| jav | 爪哇语 | [jav.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/jav.traineddata) | +| jpn | 日语 | [jpn.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/jpn.traineddata) | +| kan | 卡纳达语 | [kan.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/kan.traineddata) | +| kat | 格鲁吉亚语 | [kat.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/kat.traineddata) | +| kat_old | 古格鲁吉亚语 | [kat_old.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/kat_old.traineddata) | +| kaz | 哈萨克语 | [kaz.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/kaz.traineddata) | +| khm | 高棉语 | [khm.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/khm.traineddata) | +| kir | 吉尔吉斯语 | [kir.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/kir.traineddata) | +| kor | 韩语 | [kor.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/kor.traineddata) | +| kur | 库尔德语 | [kur.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/kur.traineddata) | +| lao | 老挝语 | [lao.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/lao.traineddata) | +| lat | 拉丁语 | [lat.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/lat.traineddata) | +| lav | 拉脱维亚语 | [lav.traineddata](https://github.com/tesseract-ocr/tessdata/raw/4.00/lav \ No newline at end of file diff --git a/docx/introduction/tesseract/Languages_Scripts.md b/docx/introduction/tesseract/Languages_Scripts.md new file mode 100644 index 0000000..818e25b --- /dev/null +++ b/docx/introduction/tesseract/Languages_Scripts.md @@ -0,0 +1,177 @@ +# Languages/Scripts supported Tesseract OCR + +## Languages +| LangCode| Language | 4.00 | 4.0.0| 4.0.0 | 4.0.0 | +|---------|--------------------------------------|:----:|:-----:|:--------:|:---------:| +| | | Nov. 2016| tessdata|tessdata_best|tessdata_fast| +| | | | | | | +| afr | Afrikaans | x | x | x | x | +| amh | Amharic | x | x | x | x | +| ara | Arabic | x | x | x | x | +| asm | Assamese | x | x | x | x | +| aze | Azerbaijani | x | x | x | x | +| aze_cyrl | Azerbaijani - Cyrilic | x | x | x | x | +| bel | Belarusian | x | x | x | x | +| ben | Bengali | x | x | x | x | +| bod | Tibetan | x | x | x | x | +| bos | Bosnian | x | x | x | x | +| bre | Breton | x | x | x | x | +| bul | Bulgarian | x | x | x | x | +| cat | Catalan; Valencian | x | x | x | x | +| ceb | Cebuano | x | x | x | x | +| ces | Czech | x | x | x | x | +| chi_sim | Chinese - Simplified | x | x | x | x | +| chi_tra | Chinese - Traditional | x | x | x | x | +| chr | Cherokee | x | x | x | x | +| cos | Corsican | | x | x | x | +| cym | Welsh | x | x | x | x | +| dan | Danish | x | x | x | x | +| dan_frak | Danish - Fraktur (contrib) | | | | | +| deu | German | x | x | x | x | +| deu_frak | German - Fraktur (contrib) | | | | | +| deu_latf | German (Fraktur Latin) | x | x | x | x | +| dzo | Dzongkha | x | x | x | x | +| ell | Greek, Modern (1453-) | x | x | x | x | +| eng | English | x | x | x | x | +| enm | English, Middle (1100-1500) | x | x | x | x | +| epo | Esperanto | x | x | x | x | +| equ | Math / equation detection module | | x| x | x | +| est | Estonian | x | x | x | x | +| eus | Basque | x | x | x | x | +| fao | Faroese | | x | x | x | +| fas | Persian | x | x | x | x | +| fil | Filipino (old - Tagalog) | | x | x | x | +| fin | Finnish | x | x | x | x | +| fra | French | x | x | x | x | +| frk | German - Fraktur (now deu_latf) | x | x | x | x | +| frm | French, Middle (ca.1400-1600) | x | x | x | x | +| fry | Western Frisian | | x | x | x | +| gla | Scottish Gaelic | | x | x | x | +| gle | Irish | x | x | x | x | +| glg | Galician | x | x | x | x | +| grc | Greek, Ancient (to 1453) (contrib) | x | x | x | x | +| guj | Gujarati | x | x | x | x | +| hat | Haitian; Haitian Creole | x | x | x | x | +| heb | Hebrew | x | x | x | x | +| hin | Hindi | x | x | x | x | +| hrv | Croatian | x | x | x | x | +| hun | Hungarian | x | x | x | x | +| hye | Armenian | | x | x | x | +| iku | Inuktitut | x | x | x | x | +| ind | Indonesian | x | x | x | x | +| isl | Icelandic | x | x | x | x | +| ita | Italian | x | x | x | x | +| ita_old | Italian - Old | x | x | x | x | +| jav | Javanese | x | x | x | x | +| jpn | Japanese | x | x | x | x | +| kan | Kannada | x | x | x | x | +| kat | Georgian | x | x | x | x | +| kat_old | Georgian - Old | x | x | x | x | +| kaz | Kazakh | x | x | x | x | +| khm | Central Khmer | x | x | x | x | +| kir | Kirghiz; Kyrgyz | x | x | x | x | +| kmr | Kurmanji (Kurdish - Latin Script) | x | x | x | x | +| kor | Korean | x | x | x | x | +| kor_vert | Korean (vertical) | x | x | x | x | +| kur | Kurdish (Arabic Script) | | | | | +| lao | Lao | x | x | x | x | +| lat | Latin | x | x | x | x | +| lav | Latvian | x | x | x | x | +| lit | Lithuanian | x | x | x | x | +| ltz | Luxembourgish | x | x | x | x | +| mal | Malayalam | x | x | x | x | +| mar | Marathi | x | x | x | x | +| mkd | Macedonian | x | x | x | x | +| mlt | Maltese | x | x | x | x | +| mon | Mongolian | x | x | x | x | +| mri | Maori | x | x | x | x | +| msa | Malay | x | x | x | x | +| mya | Burmese | x | x | x | x | +| nep | Nepali | x | x | x | x | +| nld | Dutch; Flemish | x | x | x | x | +| nor | Norwegian | x | x | x | x | +| oci | Occitan (post 1500) | x | x | x | x | +| ori | Oriya | x | x | x | x | +| osd | Orientation and script detection module| x | x | x | x | +| pan | Panjabi; Punjabi | x | x | x | x | +| pol | Polish | x | x | x | x | +| por | Portuguese | x | x | x | x | +| pus | Pushto; Pashto | x | x | x | x | +| que | Quechua | x | x | x | x | +| ron | Romanian; Moldavian; Moldovan | x | x | x | x | +| rus | Russian | x | x | x | x | +| san | Sanskrit | x | x | x | x | +| sin | Sinhala; Sinhalese | x | x | x | x | +| slk | Slovak | x | x | x | x | +| slk_frak | Slovak - Fraktur (contrib) | | | | | +| slv | Slovenian | x | x | x | x | +| snd | Sindhi | x | x | x | x | +| spa | Spanish; Castilian | x | x | x | x | +| spa_old | Spanish; Castilian - Old | x | x | x | x | +| sqi | Albanian | x | x | x | x | +| srp | Serbian | x | x | x | x | +| srp_latn | Serbian - Latin | x | x | x | x | +| sun | Sundanese | x | x | x | x | +| swa | Swahili | x | x | x | x | +| swe | Swedish | x | x | x | x | +| syr | Syriac | x | x | x | x | +| tam | Tamil | x | x | x | x | +| tat | Tatar | x | x | x | x | +| tel | Telugu | x | x | x | x | +| tgk | Tajik | x | x | x | x | +| tgl | Tagalog (new - Filipino) | x | | | | +| tha | Thai | x | x | x | x | +| tir | Tigrinya | x | x | x | x | +| ton | Tonga | x | x | x | x | +| tur | Turkish | x | x | x | x | +| uig | Uighur; Uyghur | x | x | x | x | +| ukr | Ukrainian | x | x | x | x | +| urd | Urdu | x | x | x | x | +| uzb | Uzbek | x | x | x | x | +| uzb_cyrl | Uzbek - Cyrilic | x | x | x | x | +| vie | Vietnamese | x | x | x | x | +| yid | Yiddish | x | x | x | x | +| yor | Yoruba | x | x | x | x | + +## Scripts + +| | Script | 4.00 | 4.0.0| 4.0.0 | 4.0.0 | +|--------|---------------------------------------|:----:|:-----:|:--------:|:---------:| +| | | Nov 2016|tessdata|tessdata_best|tessdata_fast| +| arab |Arabic | | x | x | x | +| armn |Armenian | | x | x | x | +| beng |Bengali | | x | x | x | +| cans |Canadian_Aboriginal | | x | x | x | +| cher |Cherokee | | x | x | x | +| cyrl |Cyrillic | | x | x | x | +| deva |Devanagari | | x | x | x | +| ethi |Ethiopic | | x | x | x | +| frak |Fraktur | | x | x | x | +| geor |Georgian | | x | x | x | +| grek |Greek | | x | x | x | +| gujr |Gujarati | | x | x | x | +| guru |Gurmukhi | | x | x | x | +| hans |HanS (Han simplified) | | x | x | x | +| hans-vert |HanS_vert (Han simplified vertical) | | x | x | x | +| hant |HanT (Han traditional) | | x | x | x | +| hant-vert |HanT_vert (Han traditional vertical) | | x | x | x | +| hang |Hangul | | x | x | x | +| hang-vert |Hangul_vert (Hangul vertical) | | x | x | x | +| hebr |Hebrew | | x | x | x | +| jpan |Japanese | | x | x | x | +| jpan-vert |Japanese_vert (Japanese vertical) | | x | x | x | +| knda |Kannada | | x | x | x | +| khmr |Khmer | | x | x | x | +| laoo |Lao | | x | x | x | +| latn |Latin | | x | x | x | +| mlym |Malayalam | | x | x | x | +| mymr |Myanmar | | x | x | x | +| orya |Oriya(Odia) | | x | x | x | +| sinh |Sinhala | | x | x | x | +| syrc |Syriac | | x | x | x | +| taml |Tamil | | x | x | x | +| telu |Telugu | | x | x | x | +| thaa |Thaana | | x | x | x | +| thai |Thai | | x | x | x | +| tibt |Tibetan | | x | x | x | +| viet |Vietnamese | | x | x | x | diff --git a/docx/introduction/tesseract/tesstrain.md b/docx/introduction/tesseract/tesstrain.md new file mode 100644 index 0000000..4e37774 --- /dev/null +++ b/docx/introduction/tesseract/tesstrain.md @@ -0,0 +1,119 @@ +# Tesseract 5 的训练 +使用 `tesseract-ocr/tesstrain` 来训练字体,可按以下步骤操作: + +### 1. 环境准备 +首先,要确保你的系统已安装 Tesseract OCR 及其相关的开发库。同时,需要安装一些必要的工具,像 Python、make、imagemagick 等。以 Ubuntu 为例,可以使用下面的命令进行安装: +```bash +sudo apt-get update +sudo apt-get install tesseract-ocr tesseract-ocr-dev python3 make imagemagick +``` + +### 2. 克隆 `tesstrain` 仓库 +把 `tesseract-ocr/tesstrain` 仓库克隆到本地: +```bash +git clone https://github.com/tesseract-ocr/tesstrain.git +cd tesstrain +``` + +### 3. 准备训练数据 +训练数据主要包含图像文件和对应的标注文本文件。图像文件应当是包含文本的图像,标注文本文件则要包含图像中的准确文本内容。文件名要保持一致,例如 `image_001.tif` 对应的标注文件为 `image_001.gt.txt`。 + +你可以手动创建这些文件,也能借助一些工具来生成。以下是一个简单的示例,展示如何生成训练数据: +```bash +# 创建一个包含文本的图像 +convert -background white -fill black -font Arial -pointsize 30 label:"Hello, World!" image_001.tif + +# 创建对应的标注文件 +echo "Hello, World!" > image_001.gt.txt +``` + +### 4. 配置训练参数 +在 `tesstrain` 目录下,你可以对 `Makefile` 进行编辑,来配置训练参数。主要的参数如下: +- `LANG`:要训练的语言代码,比如 `eng` 代表英语。 +- `TESSDATA`:Tesseract 的数据目录,默认是 `../tessdata`。 +- `GROUND_TRUTH_DIR`:训练数据的目录。 +- `MODEL_NAME`:训练后模型的名称。 + +示例配置如下: +```makefile +LANG = eng +TESSDATA = ../tessdata +GROUND_TRUTH_DIR = ./data +MODEL_NAME = my_custom_model +``` + +### 5. 开始训练 +配置好参数之后,就可以使用 `make` 命令开始训练: +```bash +make training +``` + +### 6. 监控训练进度 +训练过程可能会持续较长时间,你可以通过查看日志文件来监控训练进度: +```bash +tail -f data/logs/$(LANG).log +``` + +### 7. 评估训练结果 +训练完成后,你可以使用测试数据来评估训练结果: +```bash +make evaluate +``` + +### 8. 导出训练好的模型 +训练完成且评估通过后,你可以把训练好的模型导出为 `.traineddata` 文件: +```bash +make traineddata +``` + +### 完整示例脚本 +下面是一个完整的示例脚本,展示了如何使用 `tesstrain` 训练自定义字体: + +```bash +#!/bin/bash + +# 克隆 tesstrain 仓库 +git clone https://github.com/tesseract-ocr/tesstrain.git +cd tesstrain + +# 准备训练数据 +mkdir -p data +convert -background white -fill black -font Arial -pointsize 30 label:"Hello, World!" data/image_001.tif +echo "Hello, World!" > data/image_001.gt.txt + +# 配置训练参数 +cat << EOF > Makefile.local +LANG = eng +TESSDATA = ../tessdata +GROUND_TRUTH_DIR = ./data +MODEL_NAME = my_custom_model +EOF + +# 开始训练 +make training + +# 评估训练结果 +make evaluate + +# 导出训练好的模型 +make traineddata +``` + +把上述脚本保存为 `train_font.sh`,然后赋予执行权限并运行: +```bash +chmod +x train_font.sh +./train_font.sh +``` + +通过以上步骤,你就能使用 `tesseract-ocr/tesstrain` 训练自定义字体了。 + +**关键注意事项和技巧:** + +* **高质量的训练数据:** 训练数据的质量直接影响模型的准确率。确保你的训练数据包含足够多的字符、不同的文本模式和清晰的图像。 +* **足够的数据量:** 对于复杂的字体,你需要大量的训练数据才能获得好的结果。 +* **字体变体:** 如果你的字体有不同的样式(例如粗体、斜体),你需要为每种样式分别准备训练数据或考虑训练一个能够识别多种样式的模型。 +* **字符覆盖率:** 确保你的训练数据覆盖了你希望 Tesseract 能够识别的所有字符。 +* **迭代次数:** 训练需要一定的迭代次数才能收敛。你需要根据实际情况调整迭代次数。 +* **学习率和其他超参数:** 高级的用户可能需要调整训练的学习率和其他超参数来优化模型性能。 + +这是一个高层次的概述。实际操作中,你需要仔细阅读 `tesstrain` 的文档,了解每个步骤的具体细节和参数。根据你的具体需求和字体特点,可能需要进行多次尝试和调整才能获得满意的结果。 diff --git a/docx/introduction/workflow/action.md b/docx/introduction/workflow/action.md new file mode 100644 index 0000000..b213f2f --- /dev/null +++ b/docx/introduction/workflow/action.md @@ -0,0 +1,17 @@ +# 动作 + +## 运行时参数 +右边的菜单项,如下图所示: + +![action param](./images/10.png ':size=50%') + +* 复制 +> 复制包含运行参数的图像。 +* 保存 +> 包含运行参数的图像保存到本地磁盘。 + +* 脚本 +> 脚本编辑器,设置运行时参数。 + +* 缓存对象 +> 用来解决 某些动作反复执行时,由于内置对象的初始化比较耗,导致不必要的时间开销。但是动作在执行后会保持内存占用。 \ No newline at end of file diff --git a/docx/introduction/workflow/images/10.png b/docx/introduction/workflow/images/10.png new file mode 100644 index 0000000..698ab37 Binary files /dev/null and b/docx/introduction/workflow/images/10.png differ diff --git a/docx/introduction/workflow/logic.md b/docx/introduction/workflow/logic.md index 16a365b..4587540 100644 --- a/docx/introduction/workflow/logic.md +++ b/docx/introduction/workflow/logic.md @@ -22,7 +22,7 @@ * 每个流程从*Start* 动作开始执行。 -* 流程动作执行完毕,默认不退出,如果需要退出流程,需要添加 *Exit* 动作。 +* 流程动作执行完毕,默认不退出,如果需要退出流程,需要添加 [退出流程](./actions/control/Quit.md) 动作。 ## 动作作用域 动作的作用域通常包括动作本身、兄弟动作所在的流程范围及子动作所在的流程范围,但不包括父动作所在的流程。 \ No newline at end of file diff --git a/docx/introduction/workflow/record.md b/docx/introduction/workflow/record.md index 59d08ab..3632d25 100644 --- a/docx/introduction/workflow/record.md +++ b/docx/introduction/workflow/record.md @@ -6,7 +6,7 @@ * 切换录制窗口 - ![image](./introduction/workflow/images/02.png ':size=90%') + ![image](./images/02.png ':size=90%') * 添加 diff --git a/docx/introduction/workflow/skill.md b/docx/introduction/workflow/skill.md index 070a61b..faaceb7 100644 --- a/docx/introduction/workflow/skill.md +++ b/docx/introduction/workflow/skill.md @@ -14,7 +14,7 @@ 3. 支持的快捷键 - `Alt + Del` 删除连接线 + `Alt + Del` 删除出口连接线 `Ctrl + C` 复制动作