Giter Site home page Giter Site logo

vitlp's Introduction

ViTLP

This repository releases code of paper Visually Guided Generative Text-Layout Pre-training for Document Intelligence (NAACL-2024).

We provide the pre-trained checkpoint ViTLP-medium (380M). The pre-trained ViTLP model can natively perform OCR text localization and recognition, which is accessible at Huggingface. Clone (or download) ViTLP checkpoint weight to the directory ./ckpts/ViTLP-medium.

pip install -r requirements.txt
git clone ViTLP && cd ViTLP

# Clone ViTLP-medium checkpoint
mkdir -p ckpts/ViTLP-medium
git clone https://huggingface.co/veason/ViTLP-medium ckpts/ViTLP-medium

Demo

With the checkpoint and dependencies set (see requirements.txt), run the demo as

python ocr.py

Upload a document image and have a shot

See detailed inference code at decode.py and run batch decode by

bash decode.sh

Preset FAQ

  • Why is ViTLP-medium (380M)?

    When I commenced this project, it was on the eve of LLMs (precisely speaking, ChatGPT). ViTLP-base presented in our paper, is actually a rather small pre-trained model. We know it is expected to scale up ViTLP in this LLM era. However, the pre-training scale is commonly constrained by computation resources and the pre-training dataset scale, in which context ViTLP-medium (380M) is the largest pre-training scale so far we can support.

    Besides, this scale of ViTLP also brings inference sweetness including speed and memory usage. Typically, OCR on a page of a document image can be processed within 5~10 seconds in an Nvidia 4090, which is comparable to (and faster than) most OCR engines (and LLMs).

Note

ViTLP is pronounced /ˈvai·tlp/ (vital). The first version of our paper was submitted to OpenReview in June 2023.

vitlp's People

Contributors

veason-silverbullet avatar

Stargazers

 avatar Divyesh Sonigra avatar  avatar Pathik Prashant Ghugare avatar Alexander Dicke avatar  avatar pe653 avatar Mark4396 avatar mingming avatar  avatar Huy Q Can avatar Mahmoud Rusty Abdelkader avatar  avatar Vikram Kalabi avatar Haoli Bai avatar Call Me Maybe avatar  avatar senlinuc avatar Phạm Văn Lĩnh avatar  avatar  avatar  avatar

Watchers

Mahmoud Rusty Abdelkader avatar Neo Mohsenvand avatar  avatar  avatar  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.