AnyListen / tools-ocr

树洞 OCR 文字识别(一款跨平台的 OCR 小工具)
https://ifish.fun
GNU Lesser General Public License v3.0
2.99k stars 477 forks source link
cross-platform javafx mac ocr screenshot windows

Tree Hole OCR

English | 中文

Introduction

Dependencies Library

Open Source Address

gitee | github

Documentation

https://tree-hole-ocr-docs.vercel.app/

Requirements

Installation

  • Please do not include Chinese characters in the installation path;
  • This program is developed with JavaFX, and the installation package provided already includes Java.
  • Download the latest version from release and unzip it for installation.

Using the Program

Screenshot

Selecting Area

After entering the screenshot interface, press and hold the left mouse button, then drag to select the area you want to capture; After completing the selection, you can fine-tune the selected area:

Confirm Selection

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.

Local Build

Download and Unzip the Models

wget https://github.com/litongjava/tools-ocr/releases/download/model-ppocr-v4/ch_PP-OCRv4_rec_infer-onnx.zip
wget https://github.com/litongjava/tools-ocr/releases/download/model-ppocr-v4/ch_PP-OCRv4_det_infer-onnx.zip

Unzip the models

mkdir models/ch_PP-OCRv4_rec_infer
mkdir models/ch_PP-OCRv4_det_infer
unzip /Users/mac/Downloads/ch_PP-OCRv4_rec_infer-onnx.zip -d models/ch_PP-OCRv4_rec_infer
unzip /Users/mac/Downloads/ch_PP-OCRv4_det_infer-onnx.zip -d models/ch_PP-OCRv4_det_infer

Build the Program

You can download the code and build it locally. The build commands are as follows: windows

mkdir target\jfx\app
cp -r models target\jfx\app
mvn jfx:native -DskipTests -f pom.xml

macos

rm -rf target/jfx/app
mkdir -p target/jfx/app
cp -r models target/jfx/app
mvn jfx:native -DskipTests -f pom.xml

View System Operating Log

cd treehole.app/Contents/java/logs

Notices

MAC Permission Settings

Since screenshot shortcuts are monitored, MAC needs appropriate permissions settings, as shown below:

Common Directories

TODO