opensi·si

PP-OCRv6smallrec is the mid-tier recognition model in the PP-OCRv6 series. It uses LCNetV4 as the backbone and EncoderWithLightSVTR as the recognition neck, with a CTC+NRTR…

PP-OCRv6_small_rec

This model was contributed to Hugging Face Transformers on 2026-05-19.

PP-OCRv6_small_rec

Overview

PP-OCRv6_small_rec is the mid-tier recognition model in the PP-OCRv6 series. It uses LCNetV4 as the backbone and EncoderWithLightSVTR as the recognition neck, with a CTC+NRTR multi-head decoder. The model supports 50 languages and contains 5.2M parameters.

Model Architecture

Usage

Single input inference

The example below demonstrates how to detect text with PP-OCRv6_small_rec using the AutoModel.

AutoModel

from io import BytesIO

from huggingface_hub.utils import httpx
from PIL import Image
from transformers import AutoImageProcessor, AutoModelForTextRecognition
from transformers.image_utils import load_image

model_path = "PaddlePaddle/PP-OCRv6_small_rec_safetensors"
model = AutoModelForTextRecognition.from_pretrained(model_path, device_map="auto")
image_processor = AutoImageProcessor.from_pretrained(model_path)

image_url = "https://huggingface.co/datasets/hf-internal-testing/transformers-synthetic-assets/resolve/main/images/paddle_general_ocr_rec_001.png"
image = load_image(image_url)
inputs = image_processor(images=image, return_tensors="pt").to(model.device)
outputs = model(**inputs)

results = image_processor.post_process_text_recognition(outputs)
for result in results:
    print(result)

Batched inference

Here is how you can do it with PP-OCRv6_small_rec using the AutoModel:

AutoModel

from io import BytesIO

from huggingface_hub.utils import httpx
from PIL import Image
from transformers import AutoImageProcessor, AutoModelForTextRecognition
from transformers.image_utils import load_image

model_path = "PaddlePaddle/PP-OCRv6_small_rec_safetensors"
model = AutoModelForTextRecognition.from_pretrained(model_path, device_map="auto")
image_processor = AutoImageProcessor.from_pretrained(model_path)

image_url = "https://huggingface.co/datasets/hf-internal-testing/transformers-synthetic-assets/resolve/main/images/paddle_general_ocr_rec_001.png"
image = load_image(image_url)
inputs = image_processor(images=[image, image], return_tensors="pt").to(model.device)
outputs = model(**inputs)

results = image_processor.post_process_text_recognition(outputs)
for result in results:
    print(result)

PPOCRV6SmallRecForTextRecognition

[[autodoc]] PPOCRV6SmallRecForTextRecognition

PPOCRV6SmallRecConfig

[[autodoc]] PPOCRV6SmallRecConfig

PPOCRV6SmallRecModel

[[autodoc]] PPOCRV6SmallRecModel