Image-Text-to-Text
Safetensors
MLX
mlx-vlm
indic_ocr
ocr
document-parsing
layout-analysis
reading-order
indic
Instructions to use HashNuke/indic-ocr-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use HashNuke/indic-ocr-mlx with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("HashNuke/indic-ocr-mlx") config = load_config("HashNuke/indic-ocr-mlx") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
File size: 1,668 Bytes
6a0d82c 3ca5518 6a0d82c 3ca5518 6a0d82c 3ca5518 6a0d82c 3ca5518 6a0d82c 3ca5518 6a0d82c 3ca5518 6a0d82c 3ca5518 6a0d82c 3ca5518 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | ---
tags:
- mlx
- object-detection
- document-layout
- reading-order
library_name: mlx-vlm
license: other
license_name: indic-open-model-license-1.0
license_link: https://huggingface.co/HashNuke/indic-ocr-mlx/blob/main/LICENSE.md
base_model: bodhan-ai/indic-ocr
---
# IndicDocLayout (MLX)
Built with IndicDocLayout from Bodhan AI / AI4Bharat.
The layout stage of [IndicOCR (MLX)](https://huggingface.co/HashNuke/indic-ocr-mlx):
a 37-class PP-DocLayoutV3 fine-tune that predicts document regions and reading
order. The weights are float32, about 33M parameters (133 MB).
Use an mlx-vlm checkout with `pp_doclayout_v3` support. This example downloads
only the layout stage; it does not load the OCR model.
```python
from pathlib import Path
from huggingface_hub import snapshot_download
from mlx_vlm.utils import load_model
root = Path(snapshot_download(
"HashNuke/indic-ocr-mlx", allow_patterns=["weights/layout/*"]
))
model = load_model(root / "weights/layout")
model.eval()
records = model.detect("page.png", conf=0.5)
for record in sorted(records, key=lambda item: item["reading_order"]):
print(record)
```
Replace `page.png` with an image path. Records contain `bbox` in
`[y0, x0, y1, x1]` order, normalized to 0–1000, plus `label`, one-based
`reading_order`, and `score`. The detector does not transcribe text.
This fine-tune is distinct from the stock 25-class
[PP-DocLayout V3 (MLX)](https://huggingface.co/HashNuke/pp-doclayout-v3-mlx).
The source weights are from [bodhan-ai/indic-ocr](https://huggingface.co/bodhan-ai/indic-ocr)
under the [Indic Open Model License v1.0](https://huggingface.co/HashNuke/indic-ocr-mlx/blob/main/LICENSE.md).
|