90

OCR Service:一个 OCR 服务的完整技术栈

 5 years ago
source link: https://github.com/onestraw/ocrservice?amp%3Butm_medium=referral
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

OCR Service

使用开源项目搭了一个 OCR 服务的完整技术栈

  • frontend 应用: UI完整拷贝自otiai10/ocrserver
  • 负载均衡器: Nginx
  • backend 业务层: Gin框架
  • worker 计算层: Tesseract
  • MQ 消息队列: RabbitMQ

Architecture

- - - -    - - - -
                      | APP |    | APP |
                      - - - -    - - - -
                         ^          ^
                         |          |
                         |          |
                         v          v
                     - - - - - - - - - -
                     |  Loadbalancer   |
                     - - - - - - - - - -
                       ^      ^       ^
                     /        |         \
                   /          |           \
                 /            |             \
                v             v              v
          - - - - - -     - - - - - -      - - - - - -
          | Backend |     | Backend |      | Backend |
          - - - - - -     - - - - - -      - - - - - -
              ^              |   ^               ^ 
              |              |   |               |
              v              v   |               v
          - - - - - - - - - - - - - - - - - - - - - - - -
          |                 | | | |                     |
          |  RabbitMQ       |q| |q|       RabbitMQ      |
          |                 | | | |                     |
          - - - - - - - - - - - - - - - - - - - - - - - -
              ^              |   ^            ^        ^ 
              |              |   |            |         \
              v              v   |            v          \
        - - - - - -      - - - - - -    - - - - - -    - - - - - -
        | Worker  |      | Worker  |    | Worker  |    | Worker  |
        - - - - - -      - - - - - -    - - - - - -    - - - - - -

Play with docker

build image

hub clone onestraw/ocrservice
cd ocrservice
docker build -t onestraw/ocrservice .

Play

docker-compose up -d
# 浏览器访问`127.0.0.1:10001` or
cd tests/ && ./runtest.sh
# ...
docker-compose logs
docker-compose down

Todo

  • 添加用户认证
  • 持久化存储
  • 高可用

Reference


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK