Metadata-Version: 2.4
Name: asterocr
Version: 1.0.0
Summary: AsterOCR: High-Performance Non-Autoregressive Vietnamese Optical Character Recognition Engine
Author-email: asterxlabs <contact@asterxlabs.com>
License: MIT
Project-URL: Homepage, https://huggingface.co/asterxlabs/asternet-vietnamese-ocr
Project-URL: Bug Tracker, https://github.com/asterxlabs/asterOCR/issues
Project-URL: Demo Space, https://huggingface.co/spaces/asterxlabs/asternet-vietnamese-ocr-demo
Keywords: ocr,vietnamese,document-ai,text-recognition,onnx,deep-learning
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.20.0
Requires-Dist: Pillow>=8.0.0
Requires-Dist: onnxruntime>=1.14.0
Requires-Dist: huggingface_hub>=0.19.0
Provides-Extra: torch
Requires-Dist: torch>=2.0.0; extra == "torch"
Provides-Extra: all
Requires-Dist: torch>=2.0.0; extra == "all"
Requires-Dist: gradio>=4.0.0; extra == "all"

# AsterOCR 🇻🇳

**AsterOCR** is a state-of-the-art, ultra-fast neural Vietnamese Optical Character Recognition (OCR) engine. Designed as a modern, non-autoregressive replacement for legacy OCR systems like VietOCR, AsterOCR provides sub-60ms recognition speeds and exceptional accuracy across administrative records (CCCD, Passports, Driver's Licenses), invoices, financial receipts, and degraded smartphone captures.

[![PyPI Version](https://img.shields.io/badge/pypi-v1.0.0-blue.svg)](https://pypi.org/project/asterocr/)
[![Hugging Face Model](https://img.shields.io/badge/Hugging%20Face-Model%20Hub-yellow.svg)](https://huggingface.co/asterxlabs/asternet-vietnamese-ocr)
[![Live Demo](https://img.shields.io/badge/Gradio-Live%20Demo-orange.svg)](https://huggingface.co/spaces/asterxlabs/asternet-vietnamese-ocr-demo)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

---

## ⚡ Quickstart (Python)

### 1. Installation

```bash
pip install asterocr
```

*(No heavy PyTorch installation required! Uses high-performance ONNX Runtime by default.)*

### 2. Python API

```python
from asterocr import AsterOCR

# Initialize engine (automatically downloads weights on first run)
ocr = AsterOCR()

# Recognize text from file path, PIL Image, or bytes
text = ocr.predict("path/to/invoice.jpg")
print(text)
# Output: CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM
```

### 3. Command Line Interface (CLI)

```bash
asterocr path/to/image.jpg
```

---

## 🌐 Cross-Platform Distribution Ecosystem

AsterOCR models are exported in universal **ONNX format** (~40MB) hosted on Hugging Face Hub:

| Platform | Package | Engine | Status |
| :--- | :--- | :--- | :--- |
| **Python** | `asterocr` | `onnxruntime` / `torch` | ✅ Ready (PyPI) |
| **Node.js** | `@asterxlabs/asterocr` | `onnxruntime-node` | ✅ Ready (npm) |
| **Flutter** | `asterocr_flutter` | `onnxruntime_flutter` | ✅ Ready (pub.dev) |
| **Hugging Face** | `asterxlabs/asternet-vietnamese-ocr` | Model Hub & Space Demo | ✅ Active |

---

## 📊 Benchmarks vs Industry Standard

| Metric | VietOCR (Transformer) | AsterOCR v1.0 | Improvement |
| :--- | :---: | :---: | :---: |
| **Exact Match (EM)** | 71.4% | **86.0%** | **+14.6%** |
| **Character Error Rate (CER)** | 7.82% | **3.45%** | **-55.8%** |
| **CPU Inference Latency** | 340ms | **60.2ms** | **5.6x faster** |
| **Model Size** | 145 MB | **40.76 MB** | **72% smaller** |

---

## 📜 License

MIT License © 2026 asterxlabs.
