2023.5.19 11:19 added spellchecker (pyenchant methods)
2023.5.21 18:56 added llama_spellcheck ([vanilla-llama](https://github.com/galatolofederico/vanilla-llama))
This project uses EasyOCR, Page-Dewarp, Vanilla-llama and Baidu Translator for implementation, aiming to learn the encapsulation and deployment of APIs on servers
Step1. Install OCR_Translator
git clone https://github.com/CodeRikka/OCR_Translator.git
cd OCR_Translator
pip install -r requirements.txt
Step2. Verify Page-Dewarp
page-dewarp -x 0 -y 0 pics/example6.jpg
Step3. GPU acceleration
If you wish to use GPU acceleration, please install the GPU version of torch and related packages. Check the Pytorch official website for tutorials.
pip uninstall torch torchvision torchaudio
# Modify the cuda version to your own version
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
Step4. Download Golang related packages
go get github.com/gin-gonic/gin
Step5. Modify the filePath
and outputPath
in the main.go
to an absolute address(optional)
See Vanilla-llama for tutorial
usage: python export.py [-r0 ROOT_0] [-r1 ROOT_1] [-o OUTPUT_PATH]
[-tl THRESH_LINE] [-tb THRESH_BOX]
[-e EXTRA_SIZE] [-f FONT_SIZE]
[--uid UID] [--bkey BKEY]
[-g GPU{True, False}] [-rs RESIZE{True, False}]
[-d DEWARP{True, False}]
[-m MODEL{0,1,2}] # updated on 23.05.18
[--llama {True, False}] # updated on 23.05.21
positional arguments: [-r0 ROOT_0] [-r1 ROOT_1] [-o OUTPUT_PATH]
use Page-Dewarp: python export.py [arguments] -d True
select ML model: [-m MODEL{0,1,2}] # using ML methods
0: Default
1: KMeans
2: AgglomerativeClustering
**These methods are still being tested**
**See export.py for further information**
use llama_correct: [--llama True]
remember to start the vanilla-llama server before you use this method
python single_thread.py
python multi_thread.py
make sure you are using the correct port
python posts/py_POST.py
curl -X POST https://example.com:25000/export -d root0=your/path/to/root0 -d root1=your/path/to/root1 ...