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
|
Download weights/layout/README.md from HashNuke/indic-ocr-mlx: direct link, hf CLI and curl.
- Browser
- Download file 1.67 kB
-
https://huggingface.co/HashNuke/indic-ocr-mlx/resolve/main/weights/layout/README.md
- Command line
-
hf download hf://HashNuke/indic-ocr-mlx/weights/layout/README.md
-
curl -L -o README.md https://huggingface.co/HashNuke/indic-ocr-mlx/resolve/main/weights/layout/README.md
1.67 kB
| 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). | |