> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/workflows/blocks/blocks/run-a-model/ocr-model.md).

# OCR Model

Extract text from an image using DocTR optical character recognition.

Retrieve the characters in an image using DocTR Optical Character Recognition (OCR).

This block returns the text within an image.

You may want to use this block in combination with a detections-based block (i.e. ObjectDetectionBlock). An object detection model could isolate specific regions from an image (i.e. a shipping container ID in a logistics use case) for further processing. You can then use a DynamicCropBlock to crop the region of interest before running OCR.

Using a detections model then cropping detections allows you to isolate your analysis on particular regions of an image.

### Type identifier

Use the following identifier in step `"type"` field: `roboflow_core/ocr_model@v1` to add the block as a step in your workflow.

### Properties

| **Name** | **Type** | **Description**                   | Refs |
| -------- | -------- | --------------------------------- | ---- |
| `name`   | `str`    | Unique name of step in workflows. | ❌    |

The **Refs** column marks possibility to parametrise the property with dynamic values available in `workflow` runtime. See *Bindings* for more info.

### Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds `OCR Model` in version `v1` has.

<details>

<summary>Input and output bindings</summary>

* input
  * `images` ([*`image`*](/workflows/developer-guide/developer-guide/kinds/image.md)): The image to infer on..
* output
  * `result` ([`string`](/workflows/developer-guide/developer-guide/kinds/string.md)): String value.
  * `predictions` ([`object_detection_prediction`](/workflows/developer-guide/developer-guide/kinds/object-detection-prediction.md)): Prediction with detected bounding boxes in form of sv.Detections(...) object.
  * `parent_id` ([`parent_id`](/workflows/developer-guide/developer-guide/kinds/parent-id.md)): Identifier of parent for step output.
  * `root_parent_id` ([`parent_id`](/workflows/developer-guide/developer-guide/kinds/parent-id.md)): Identifier of parent for step output.
  * `prediction_type` ([`prediction_type`](/workflows/developer-guide/developer-guide/kinds/prediction-type.md)): String value with type of prediction.

</details>

<details>

<summary>Example JSON definition</summary>

```json
{
	    "name": "<your_step_name_here>",
	    "type": "roboflow_core/ocr_model@v1",
	    "images": "$inputs.image"
	}
```

</details>
