Code Monkey home page Code Monkey logo

davar-lab-ocr's Introduction

About

This is a fork from https://github.com/hikopensource/DAVAR-Lab-OCR with modified setup script and added docker web service for LGPMA table extraction model inference.

Web service setup

Download model maskrcnn-lgpma-pub-e12-pub.pth from Google Drive and place it in models directory.

Running service locally

  • Run setup.sh locally and it should install and build all required components.
  • Then you can run web service using uvicorn uvicorn src.web:app --host 0.0.0.0 --port 8000

Running service from docker container

  • Run docker build -f docker/Dockerfile -t <tag> .
  • Then you can start the container with web service with docker run -d -p 8000:8000 -t <tag>

Usage

When the web service is running, you can use http protocol to process table images or set processing device.

Service endpoints

  • /extract_table_structure/ - returns json with the table data obtained from model.
  • /get_device/ - returns the name of the device used by model, either cpu or cuda.
  • /set_device/{device}/ - tries to set processing device as device and returns json with currently used device and method output - either success or failure

Example

import requests

filename = ...
with open(filename, "rb") as f:
    response = requests.post(url="http://0.0.0.0:8000/extract_table_structure", files={"input_file": f})

davar-lab-ocr's People

Contributors

qiaoliang6 avatar davar-lab avatar fszatkowski avatar icedream2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.