PP-OCRv6tinyrec is the most lightweight recognition model in the PP-OCRv6 series. It uses LCNetV4 as the backbone with a direct reshape projection instead of an encoder neck,…
PP-OCRv6_tiny_rec
This model was contributed to Hugging Face Transformers on 2026-05-19.
PP-OCRv6_tiny_rec
Overview
PP-OCRv6_tiny_rec is the most lightweight recognition model in the PP-OCRv6 series. It uses LCNetV4 as the backbone with a direct reshape projection instead of an encoder neck, and a CTC+NRTR multi-head decoder. The model supports 49 languages and contains 1.1M parameters.
Model Architecture
Usage
Single input inference
The example below demonstrates how to detect text with PP-OCRv6_tiny_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_tiny_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_tiny_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_tiny_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)
PPOCRV6TinyRecForTextRecognition
[[autodoc]] PPOCRV6TinyRecForTextRecognition
PPOCRV6TinyRecConfig
[[autodoc]] PPOCRV6TinyRecConfig
PPOCRV6TinyRecModel
[[autodoc]] PPOCRV6TinyRecModel
PPOCRV6SmallRecImageProcessor
[[autodoc]] PPOCRV6SmallRecImageProcessor
Source and license
Source: Transformers documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.