TrWebOCR

开源易用的中文离线OCR,识别率媲美大厂,并且提供了易用的web页面及web的接口,方便人类日常工作使用或者其他程序来调用~

APACHE-2.0 License

Stars
2.6K

TrWebOCR-OCR

TrWebOCR Tr http web

tornado

  • Python 3.6+
  • Ubuntu 16.04
  • Ubuntu 18.04
  • CentOS 7
  • Docker

WindowsMacOSDocker Linux

  • CPU: 1
  • : 2G
  • SWAP: 2G

  1. python3.7 miniconda

pip install -r requirements.txt

8089gpu

python backend/main.py [--port=8089][--open_gpu=0]
# --port  8089  
# --open_gpu gpu 0(1
tr 2.3.0 https://github.com/myhub/tr
Server is running: http://192.168.31.95:8089
Now version is: cpu

Docker

Dockerfile Pull

# dockerfile 
docker build -t trwebocr:latest .

# 
docker run -itd --rm -p 8089:8089 --name trwebocr trwebocr:latest 
#  dockerhub pull
docker pull mmmz/trwebocr:latest

# 
docker run -itd --rm -p 8089:8089 --name trwebocr mmmz/trwebocr:latest 

80898089run-p 8089:8089 dockerIP8089

wiki

  • Python File
import requests
url = 'http://192.168.31.108:8089/api/tr-run/'
img1_file = {
    'file': open('img1.png', 'rb')
}
res = requests.post(url=url, data={'compress': 0}, files=img1_file)
  • Python Base64
import requests
import base64
def img_to_base64(img_path):
    with open(img_path, 'rb')as read:
        b64 = base64.b64encode(read.read())
    return b64
    
url = 'http://192.168.31.108:8089/api/tr-run/'
img_b64 = img_to_base64('./img1.png')
res = requests.post(url=url, data={'img': img_b64})

  • 20220123 tr2.3.1

    ~~CPU

  • 20220116

  • 20200817 Dockerfiledockertr2.3

  • 20200730 GPU/CPU

>>>

License

Apache 2.0

GitHub clone~

star (^.^)

Related Projects