Skip to content

Commit b558646

Browse files
authored
Merge pull request #74 from litongjava/master
add readme of English
2 parents ebd96d2 + 7581c0e commit b558646

File tree

3 files changed

+232
-68
lines changed

3 files changed

+232
-68
lines changed

readme-cn.md

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# 树洞 OCR
2+
3+
[English](./readme.md) | [中文](./readme-cn.md)
4+
5+
## 介绍
6+
7+
- 本地 OCR 识别
8+
: 树洞 OCR 文字识别工具无需联网,通过调用本地 OCR 技术,基于 Paddle OCR 模型和深度学习框架如 PyTorch、DJL,提供快速准确的文字识别。
9+
- 跨平台兼容
10+
: 基于 java 1.8 和 JavaFX 开发,支持在不同操作系统上运行,包括 Mac OS X 12.6 及以上版本。
11+
- 强大的功能支持
12+
: 除了基础的文字识别,还包括 PDF 识别、图片文字识别、快捷键截图识别等功能.
13+
14+
## 主要依赖库
15+
16+
- jdk 1.8
17+
- javafx
18+
- djl
19+
- pytorch
20+
- onnx
21+
- paddle ocr
22+
- opencv
23+
24+
## 开源地址
25+
26+
[gitee](https://gitee.com/ppnt/tools-ocr) | [github](https://github.com/litongjava/tools-ocr)
27+
28+
## document
29+
30+
https://tree-hole-ocr-docs.vercel.app/
31+
32+
## required
33+
34+
- Mac OS X 12.6 因为依赖 djl 0.25.0
35+
36+
## 安装
37+
38+
> - **安装路径请勿包含中文字符**
39+
> - 本程序使用 JavaFX 开发,提供的安装包中已经包含了 Java
40+
> -[release](https://github.com/litongjava/tools-ocr/releases/)下载最新版本解压安装即可
41+
42+
## 程序使用
43+
44+
### 截图
45+
46+
- 方法一:在程序主界面点击截图按钮;
47+
- 方法二:点击截图快捷键 F4。
48+
49+
### 圈选区域
50+
51+
进入截图界面后,按下鼠标左键,然后拖动即可圈选所要截取的区域;
52+
圈选结束后,可以对圈选的区域进行微调:
53+
54+
- 使用 **方向键**,可以对所选区域的右边界和上边界进行微调;
55+
- 使用 **Shift+方向键**,可以对所选区域的左边界和下边界进行微调;
56+
- 使用 **Ctrl+A**,可以全选整个屏幕。
57+
58+
### 确定圈选
59+
60+
圈选完成后,点击 `Enter` 或者 `Space` 键,或者鼠标左键双击即可确认圈选;确认圈选后,会自动对所选区域进行 OCR 文字识别。
61+
62+
![](readme_files/3.jpg)
63+
![](readme_files/4.jpg)
64+
65+
## 本地构建
66+
67+
### 下载模型并解压
68+
69+
```
70+
wget https://github.com/litongjava/tools-ocr/releases/download/model-ppocr-v4/ch_PP-OCRv4_rec_infer-onnx.zip
71+
wget https://github.com/litongjava/tools-ocr/releases/download/model-ppocr-v4/ch_PP-OCRv4_det_infer-onnx.zip
72+
```
73+
74+
解压模型
75+
76+
```
77+
mkdir models/ch_PP-OCRv4_rec_infer
78+
mkdir models/ch_PP-OCRv4_det_infer
79+
unzip /Users/mac/Downloads/ch_PP-OCRv4_rec_infer-onnx.zip -d models/ch_PP-OCRv4_rec_infer
80+
unzip /Users/mac/Downloads/ch_PP-OCRv4_det_infer-onnx.zip -d models/ch_PP-OCRv4_det_infer
81+
```
82+
83+
### 构建程序
84+
85+
你下载代码在本地进行构建,构建命令如下
86+
windows
87+
88+
```
89+
mkdir target\jfx\app
90+
cp -r models target\jfx\app
91+
mvn jfx:native -DskipTests -f pom.xml
92+
```
93+
94+
macos
95+
96+
```shell script
97+
rm -rf target/jfx/app
98+
mkdir -p target/jfx/app
99+
cp -r models target/jfx/app
100+
mvn jfx:native -DskipTests -f pom.xml
101+
```
102+
103+
## 查看系统运行日志
104+
105+
cd treehole.app/Contents/java/logs
106+
107+
## 注意事项
108+
109+
### MAC 权限设置
110+
111+
由于监控了截图快捷键,因此 MAC 需要开启相应的权限,请见下图:
112+
笔者设置如下
113+
114+
- Settings-->Security and Privacy-->Accessbility
115+
![MAC权限设置](readme_files/5.jpg)
116+
- Settings-->Security and Privacy-->Screen Recording
117+
![2](readme_files/2.jpg)
118+
119+
## 常用目录
120+
121+
- 日志目录/Applications/treehole.app/Contents/Java/logs
122+
- 临时图片保存目录 /Applications/treehole.app/Contents/Java
123+
124+
## TODO
125+
126+
- [x] PDF 识别
127+
- [x] 图片文字识别
128+
- [x] 识别结果文本对齐(暂未实现多分栏)
129+
- [x] 全屏模式下截图
130+
- [x] 添加正在识别动画
131+
- [x] 多屏支持
132+
- [ ] 文本翻译
133+
- [ ] 公式识别
134+
- [ ] 表格识别
135+
- [ ] 软件设置

readme.md

+97-68
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,136 @@
1-
# 树洞 OCR 文字识别
2-
3-
## 介绍
4-
- 本地OCR识别
5-
: 树洞OCR文字识别工具无需联网,通过调用本地OCR技术,基于Paddle OCR模型和深度学习框架如PyTorch、DJL,提供快速准确的文字识别。
6-
- 跨平台兼容
7-
: 基于java 1.8和JavaFX开发,支持在不同操作系统上运行,包括Mac OS X 12.6及以上版本。
8-
- 强大的功能支持
9-
: 除了基础的文字识别,还包括PDF识别、图片文字识别、快捷键截图识别等功能.
10-
## 主要依赖库
11-
- jdk 1.8
12-
- javafx
13-
- djl
14-
- pytorch
15-
- onnx
16-
- paddle ocr
17-
- opencv
18-
19-
## 开源地址
1+
# Tree Hole OCR
2+
3+
[English](./readme.md) | [中文](./readme-cn.md)
4+
5+
## Introduction
6+
7+
- Local OCR Recognition: Tree Hole OCR text recognition tool does not require internet connection. It leverages local OCR technology, based on Paddle OCR model and deep learning frameworks such as PyTorch, DJL, to provide fast and accurate text recognition.
8+
- Cross-platform compatibility: Developed with Java 1.8 and JavaFX, it supports operation on different operating systems, including Mac OS X 12.6 and above.
9+
- Powerful functionality: In addition to basic text recognition, it also includes PDF recognition, image text recognition, shortcut key screenshot recognition, and more.
10+
11+
## Dependencies Library
12+
13+
- JDK 1.8
14+
- JavaFX
15+
- DJL
16+
- PyTorch
17+
- ONNX
18+
- Paddle OCR
19+
- OpenCV
20+
21+
## Open Source Address
22+
2023
[gitee](https://gitee.com/ppnt/tools-ocr) | [github](https://github.com/litongjava/tools-ocr)
2124

22-
## document
25+
## Documentation
26+
2327
https://tree-hole-ocr-docs.vercel.app/
24-
## required
25-
- Mac OS X 12.6 因为依赖djl 0.25.0
2628

27-
## 安装
28-
> - **安装路径请勿包含中文字符**
29-
> - 本程序使用 JavaFX 开发,提供的安装包中已经包含了Java
30-
> -[release](https://github.com/litongjava/tools-ocr/releases/)下载最新版本解压安装即可
29+
## Requirements
30+
31+
- Mac OS X 12.6 due to dependency on DJL 0.25.0
32+
33+
## Installation
34+
35+
> - **Please do not include Chinese characters in the installation path**;
36+
> - This program is developed with JavaFX, and the installation package provided already includes Java.
37+
> - Download the latest version from [release](https://github.com/litongjava/tools-ocr/releases/) and unzip it for installation.
38+
39+
## Using the Program
40+
41+
### Screenshot
42+
43+
- Method one: Click the screenshot button on the main interface of the program;
44+
- Method two: Press the screenshot shortcut key F4.
45+
46+
### Selecting Area
47+
48+
After entering the screenshot interface, press and hold the left mouse button, then drag to select the area you want to capture;
49+
After completing the selection, you can fine-tune the selected area:
50+
51+
- Use **arrow keys** to adjust the right and top borders of the selected area;
52+
- Use **Shift + arrow keys** to adjust the left and bottom borders of the selected area;
53+
- Use **Ctrl + A** to select the entire screen.
3154

55+
### Confirm Selection
3256

33-
## 程序使用
34-
### 启动截图
35-
- 方法一:在程序主界面点击截图按钮;
36-
- 方法二:点击截图快捷键 F4。
57+
After completing the selection, press `Enter` or `Space` key, or double-click the left mouse button to confirm the selection; Once confirmed, the program will automatically perform OCR text recognition on the selected area.
3758

38-
### 圈选区域
39-
进入截图界面后,按下鼠标左键,然后拖动即可圈选所要截取的区域;
40-
圈选结束后,可以对圈选的区域进行微调:
41-
- 使用 **方向键**,可以对所选区域的右边界和上边界进行微调;
42-
- 使用 **Shift+方向键**,可以对所选区域的左边界和下边界进行微调;
43-
- 使用 **Ctrl+A**,可以全选整个屏幕。
59+
- image
4460

45-
### 确定圈选
46-
圈选完成后,点击 `Enter` 或者 `Space` 键,或者鼠标左键双击即可确认圈选;确认圈选后,会自动对所选区域进行 OCR 文字识别。
61+
![](readme_files/3.jpg)
4762

48-
![](readme_files/3.jpg)
49-
![](readme_files/4.jpg)
63+
- result:
64+
65+
![](readme_files/4.jpg)
66+
67+
## Local Build
68+
69+
### Download and Unzip the Models
5070

51-
## 本地构建
52-
### 下载模型并解压
5371
```
5472
wget https://github.com/litongjava/tools-ocr/releases/download/model-ppocr-v4/ch_PP-OCRv4_rec_infer-onnx.zip
5573
wget https://github.com/litongjava/tools-ocr/releases/download/model-ppocr-v4/ch_PP-OCRv4_det_infer-onnx.zip
5674
```
57-
解压模型
75+
76+
Unzip the models
77+
5878
```
5979
mkdir models/ch_PP-OCRv4_rec_infer
6080
mkdir models/ch_PP-OCRv4_det_infer
6181
unzip /Users/mac/Downloads/ch_PP-OCRv4_rec_infer-onnx.zip -d models/ch_PP-OCRv4_rec_infer
6282
unzip /Users/mac/Downloads/ch_PP-OCRv4_det_infer-onnx.zip -d models/ch_PP-OCRv4_det_infer
6383
```
6484

65-
### 构建程序
66-
你下载代码在本地进行构建,构建命令如下
85+
### Build the Program
86+
87+
You can download the code and build it locally. The build commands are as follows:
6788
windows
89+
6890
```
6991
mkdir target\jfx\app
7092
cp -r models target\jfx\app
7193
mvn jfx:native -DskipTests -f pom.xml
7294
```
7395

7496
macos
97+
7598
```shell script
7699
rm -rf target/jfx/app
77100
mkdir -p target/jfx/app
78101
cp -r models target/jfx/app
79102
mvn jfx:native -DskipTests -f pom.xml
80103
```
81104

82-
## 查看系统运行日志
105+
## View System Operating Log
106+
83107
cd treehole.app/Contents/java/logs
84-
## 注意事项
85-
### MAC权限设置
86-
由于监控了截图快捷键,因此MAC需要开启相应的权限,请见下图:
87-
88-
![MAC权限设置](http://img.ifish.fun/Fo31NZQIhPNF6m7gOorRGDuKvaZ_)
89-
笔者设置如下
90-
![1](readme_files/1.jpg)
91-
![2](readme_files/2.jpg)
92-
93-
## 常用目录
94-
- 日志目录/Applications/treehole.app/Contents/Java/logs
95-
- 临时图片保存目录 /Applications/treehole.app/Contents/Java
108+
109+
## Notices
110+
111+
### MAC Permission Settings
112+
113+
Since screenshot shortcuts are monitored, MAC needs appropriate permissions settings, as shown below:
114+
115+
- Settings --> Security and Privacy --> Accessibility
116+
![MAC Permission Settings](readme_files/5.jpg)
117+
- Settings --> Security and Privacy --> Screen Recording
118+
![2](readme_files/2.jpg)
119+
120+
## Common Directories
121+
122+
- Log directory /Applications/treehole.app/Contents/Java/logs
123+
- Temporary image saving directory /Applications/treehole.app/Contents/Java
124+
96125
## TODO
97-
- [x] PDF识别
98-
- [x] 图片文字识别
99-
- [x] 识别结果文本对齐(暂未实现多分栏)
100-
- [x] 全屏模式下截图
101-
- [x] 添加正在识别动画
102-
- [x] 多屏支持
103-
- [ ] 文本翻译
104-
- [ ] 公式识别
105-
- [ ] 表格识别
106-
- [ ] 软件设置
107126

127+
- [x] PDF Recognition
128+
- [x] Image Text Recognition
129+
- [x] Recognition result text alignment (multi-column yet to be implemented)
130+
- [x] Full screen mode screenshot
131+
- [x] Adding recognition animation
132+
- [x] Multi-screen support
133+
- [ ] Text Translation
134+
- [ ] Formula Recognition
135+
- [ ] Table Recognition
136+
- [ ] Software Settings

readme_files/5.jpg

246 KB
Loading

0 commit comments

Comments
 (0)