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
Upload folder using huggingface_hub
Browse files- weights/layout/README.md +26 -0
- weights/ocr/README.md +41 -0
weights/layout/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- mlx
|
| 6 |
+
- object-detection
|
| 7 |
+
- document-layout
|
| 8 |
+
library_name: mlx-vlm
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# indic-layout-mlx (layout stage, float32)
|
| 12 |
+
|
| 13 |
+
MLX conversion of the **IndicDocLayout** stage of
|
| 14 |
+
[bodhan-ai/indic-ocr](https://huggingface.co/bodhan-ai/indic-ocr)
|
| 15 |
+
(`weights/layout`, PP-DocLayoutV3/RT-DETR 33M, 37 classes + reading order).
|
| 16 |
+
|
| 17 |
+
```python
|
| 18 |
+
from pathlib import Path
|
| 19 |
+
from mlx_vlm.utils import load_model
|
| 20 |
+
model = load_model(Path("HashNuke/indic-layout-mlx"))
|
| 21 |
+
model.eval()
|
| 22 |
+
print(model.detect("page.png", conf=0.5))
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
Original model: `bodhan-ai/indic-ocr` (gated, Indic Open Model License v1.0).
|
| 26 |
+
Converted with `mlx_vlm.models.indic_ocr.convert_layout --dtype float32`.
|
weights/ocr/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- as
|
| 5 |
+
- bn
|
| 6 |
+
- hi
|
| 7 |
+
- mr
|
| 8 |
+
- ta
|
| 9 |
+
- te
|
| 10 |
+
tags:
|
| 11 |
+
- mlx
|
| 12 |
+
- ocr
|
| 13 |
+
- indic
|
| 14 |
+
library_name: mlx-vlm
|
| 15 |
+
pipeline_tag: image-text-to-text
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# indic-ocr-mlx (OCR stage, bf16)
|
| 19 |
+
|
| 20 |
+
MLX conversion of the **IndicBlockOCR** stage of
|
| 21 |
+
[bodhan-ai/indic-ocr](https://huggingface.co/bodhan-ai/indic-ocr)
|
| 22 |
+
(`weights/ocr`, Qwen3.5-0.8B, bf16, **not quantized**).
|
| 23 |
+
|
| 24 |
+
Use with `mlx-vlm` `indic_ocr` model support
|
| 25 |
+
(`mlx_vlm/models/indic_ocr`):
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
from mlx_vlm import load
|
| 29 |
+
from mlx_vlm.models.indic_ocr.pipeline import IndicOCRParser
|
| 30 |
+
from mlx_vlm.utils import load_model
|
| 31 |
+
from pathlib import Path
|
| 32 |
+
|
| 33 |
+
layout = load_model(Path("HashNuke/indic-layout-mlx"))
|
| 34 |
+
ocr, processor = load("HashNuke/indic-ocr-mlx")
|
| 35 |
+
page = IndicOCRParser(layout, ocr, processor).parse("page.png")
|
| 36 |
+
print(page.markdown)
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
Original model: `bodhan-ai/indic-ocr` (gated, Indic Open Model License v1.0).
|
| 40 |
+
Converted with `mlx_vlm.convert --dtype bfloat16`; `config.json`
|
| 41 |
+
`model_type` rewritten to `indic_ocr`.
|