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

<a id="model-zoo-zai-org-glm-ocr"></a>

# zai-org/GLM-OCR

<a href="../../plugins/plugins_ecosystem/glm_ocr.html" target="_blank">
    <img src="https://img.shields.io/badge/Plugin-glm_\_ocr-orange" alt="From Plugin">
</a>

#### NOTE
This is a [remotely-sourced model](../remote.md#model-zoo-remote) from the
[glm_ocr](../../plugins/plugins_ecosystem/glm_ocr.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.

GLM-OCR is a vision-language model for document understanding. Supports text recognition, formula recognition, table recognition, and custom structured extraction via JSON prompts..

**Details**

- Model name: `zai-org/GLM-OCR`
- Model source: [https://huggingface.co/zai-org/GLM-OCR](https://huggingface.co/zai-org/GLM-OCR)
- Model author: zai-org
- Model license: Apache-2.0
- Exposes embeddings? no
- Tags: `ocr, document-understanding, visual-document-retrieval`

**Requirements**

- Packages: `torch, transformers`
- 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/glm_ocr")

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("zai-org/GLM-OCR")

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

session = fo.launch_app(dataset)
```
