<!-- # hard line break macro for HTML -->

<a id="model-zoo-lightonai-lightonocr-2-1b"></a>

# lightonai/LightOnOCR-2-1B

<a href="../../plugins/plugins_ecosystem/lightonocr_2.html" target="_blank">
    <img src="https://img.shields.io/badge/Plugin-LightOnOCR--2-orange" alt="From Plugin">
</a>

#### NOTE
This is a [remotely-sourced model](../remote.md#model-zoo-remote) from the
[LightOnOCR-2](../../plugins/plugins_ecosystem/lightonocr_2.html) plugin, maintained by the community.
It is not part of FiftyOne core and may have special installation requirements.
Please review the plugin documentation and license before use.

LightOnOCR is a 2.1B-parameter vision-language model optimized for optical character recognition. It uses a chat-based interface to extract text from images with high accuracy across various document types, handwritten text, and scene text..

**Details**

- Model name: `lightonai/LightOnOCR-2-1B`
- Model source: [https://huggingface.co/lightonai/LightOnOCR-2-1B](https://huggingface.co/lightonai/LightOnOCR-2-1B)
- Model author: LightOn AI
- Model license: Apache-2.0
- Exposes embeddings? no
- Tags: `ocr, text-extraction, VLM, document-understanding`

**Requirements**

- Packages: `huggingface-hub, transformers, torch, torchvision, pillow`
- CPU support
  - yes
- GPU support
  - yes

**Example usage**

```python
import fiftyone as fo
import fiftyone.zoo as foz

foz.register_zoo_model_source("https://github.com/harpreetsahota204/LightOnOCR-2")

dataset = foz.load_zoo_dataset(
    "coco-2017",
    split="validation",
    dataset_name=fo.get_default_dataset_name(),
    max_samples=50,
    shuffle=True,
)

model = foz.load_zoo_model("lightonai/LightOnOCR-2-1B")

dataset.apply_model(model, label_field="predictions")

session = fo.launch_app(dataset)
```
