https://github.com/sitammeur/got-ocr-litserve
Leverage GOT-OCR2's optical character recognition capabilities using LitServe.
https://github.com/sitammeur/got-ocr-litserve
artificial-intelligence deep-learning fastapi got-ocr20 lightning-ai litserve optical-character-recognition python pytorch transformers
Last synced: 9 months ago
JSON representation
Leverage GOT-OCR2's optical character recognition capabilities using LitServe.
- Host: GitHub
- URL: https://github.com/sitammeur/got-ocr-litserve
- Owner: sitammeur
- License: apache-2.0
- Created: 2025-02-12T22:10:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-14T23:33:20.000Z (over 1 year ago)
- Last Synced: 2025-08-13T20:57:06.709Z (11 months ago)
- Topics: artificial-intelligence, deep-learning, fastapi, got-ocr20, lightning-ai, litserve, optical-character-recognition, python, pytorch, transformers
- Language: Python
- Homepage: https://lightning.ai/sitammeur/studios/deploy-got-ocr2-model
- Size: 1.07 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GOT-OCR2 LitServe
[](https://lightning.ai/sitammeur/studios/deploy-got-ocr2-model)
GOT-OCR2 is a versatile OCR model handling various document types, including tables, charts, and formulas. It outputs plain text, but further processing enables formatted output. Interactive OCR with region specification is also supported. This project shows how to create a self-hosted, private API that deploys [optical character recognition model](https://huggingface.co/stepfun-ai/GOT-OCR-2.0-hf) with LitServe, an easy-to-use, flexible serving engine for AI models built on FastAPI.
## Project Structure
The project is structured as follows:
- `server.py`: The file containing the main code for the web server.
- `client.py`: The file containing the code for client-side requests.
- `LICENSE`: The license file for the project.
- `README.md`: The README file that contains information about the project.
- `images`: The folder containing test images for the OCR model.
- `assets`: The folder containing screenshots for working on the application.
- `.gitignore`: The file containing the list of files and directories to be ignored by Git.
## Tech Stack
- Python (for the programming language)
- PyTorch (for the deep learning framework)
- Hugging Face Transformers Library (for the model)
- LitServe (for the serving engine)
## Getting Started
To get started with this project, follow the steps below:
1. Run the server: `python server.py`
2. Upon running the server successfully, you will see uvicorn running on port 8000.
3. Open a new terminal window.
4. Run the client: `python client.py`
Now, you can see the model's output based on the input request. The model will generate OCR output for the input image.
## Usage
The project can be used to serve the GOT-OCR2.0 model using LitServe. It allows you to input an image and receive the OCR output, suggesting potential use cases in the real world, such as document scanning, text extraction, and more.
## Contributing
Contributions are welcome! If you would like to contribute to this project, please raise an issue to discuss the changes you want to make. Once the changes are approved, you can create a pull request.
## License
This project is licensed under the [Apache-2.0 License](LICENSE).
## Contact
If you have any questions or suggestions about the project, please contact me on my GitHub profile.
Happy coding! 🚀