-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cfedf15
commit b5d4919
Showing
3 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 搭建项目开发环境 | ||
|
||
开发者你好,欢迎探索 Umi-OCR 的项目源代码。本文将会指导你搭建起适用于 Umi-OCR V2 的开发环境。 | ||
|
||
### 基础开发环境需求 | ||
|
||
- 系统要求:建议 Win10/11 | ||
- 编辑器:建议 [VS Code](https://code.visualstudio.com/) | ||
- VS Code 插件推荐: | ||
- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) | ||
- [Black Formatter](https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter) (Python规范格式化) | ||
- [QML](https://marketplace.visualstudio.com/items?itemName=bbenoist.QML) (提供qml语法高亮) | ||
- [QML Snippets](https://marketplace.visualstudio.com/items?itemName=ThomasVogelpohl.vsc-qml-snippets) (提供qml代码补全) | ||
|
||
本项目内嵌了所有前端运行环境及第三方库,故你不再需要安装Python和QT等开发环境;只需一个趁手的编辑器即可。 | ||
|
||
如果你不喜欢 VS Code ,也可以用任何编辑器——甚至记事本来开发本项目。 | ||
|
||
### 高阶开发环境需求(引擎组件) | ||
|
||
如果你希望定制离线引擎组件,可查看隔壁 [PaddleOCR-json](https://github.com/hiroi-sora/PaddleOCR-json) ,该仓库内包含 [项目构建指南](https://github.com/hiroi-sora/PaddleOCR-json/tree/main/cpp) 等有用的文档。 | ||
|
||
不过,对一般开发者而言,你不用管引擎组件的细节。 | ||
|
||
### 部署项目和基础开发环境 | ||
|
||
1. clone 本仓库。 | ||
2. `UmiOCR-data/` 目录下有三个压缩包:`.runtime.7z`,`.site-packages.7z`,`lib.7z`。将它们原地解压。 | ||
3. 回到项目根目录,点击 `Umi-OCR.exe` 测试运行项目。不出意外的话,能正常打开软件界面。 | ||
4. `.vscode` 目录是编辑器配置文件目录,已经填写好了必要的环境参数。用 VS Code 打开其中的工作区文件 `Umi-OCR_v2.code-workspace` 。 | ||
5. 在 VS Code 内随便打开一个python文件,如 `UmiOCR-data/pyapp/run.py` 。不出意外的话,能够显示代码高亮。 | ||
6. 尝试点击 F5 调试程序。如果已经能跑起来了,则项目开发环境已经搭建成功。 | ||
7. 如果 VS Code 报错 `The Python path in your debug configuration is invalid.` ,则重新指定一下PY解释器路径。按快捷键 `Ctrl+Shift+P` ,然后输入 `Python:Select Interpreter` 。点第一个,然后 `+ Enter inter preter path...` 。 | ||
8. 在弹出的文件选择弹窗中,选择 `项目目录/UmiOCR-data/.runtime/python.exe` 。 | ||
9. 再度点击 F5 调试程序,此时应该肯定能跑起来了。 | ||
|
||
注意,如果你本地已经安装过python,则建议不要用本地解释器运行本项目。请使用本项目内置的解释器。 | ||
|
||
### 导入第三方模块 | ||
|
||
由于本项目使用嵌入式Python环境,故不能使用pip的方式来下载和管理包。请手动下载 `.whl` 包文件,解压后放到 `UmiOCR-data/.site-packages` 目录下。 | ||
|
||
### 更多开发说明 | ||
|
||
待填坑: | ||
- 翻译项目 | ||
- 打包qml | ||
- 制作主题皮肤 | ||
- 增加OCR组件 | ||
- 增加自定义标签页 |