Skip to content
ModelListedExternal
Download

ViTOCR Base

This repository contains a pure Transformer-based checkpoint for Khmer OCR. Images are patch-embedded and encoded by a Transformer encoder, then decoded autoregressively.

KindOtherVersionRevision 468778f

Model source

Kind
Other
File size
640 MB
Version
vRevision 468778f
Updated
Sep 25, 2026
Downloads
6
Tasks
Captioning
Source
Hugging Face

Source description

ViTOCR

This repository contains a pure Transformer-based checkpoint for Khmer OCR. Images are patch-embedded and encoded by a Transformer encoder, then decoded autoregressively.

Installation

pip install onnxruntime pillow torch torchvision numpy

Get the inference script

Download from this model repo:

curl -L -o onnx_inference.py https://huggingface.co/metythorn/ViTOCR-base/resolve/main/onnx_inference.py

Or copy onnx_inference.py from the repository files into your project directory.

Usage

from onnx_inference import ONNXPredictor

predictor = ONNXPredictor(
    model_path="model.onnx",
    config_path="config.json",
    providers=["CPUExecutionProvider"],  # or include CUDAExecutionProvider if available
)
result = predictor.predict("sample_image.png")
print("Predicted text:", result)

Sources

1 source
Hugging FacePrimaryVersion 468778fa9bcfbd15efec007a4752b158939a04b0
huggingface.co/metythorn/ViTOCR-base/tree/468778fa9bcfbd15efec007a4752b158939a04b0

Verified Sep 11

Model artifacts

1 artifact

model.onnx

onnx · 640 MB · SHA-256 c7b0c7e492f8…219d · Hugging Face

Download file

Source excerpts

2 excerpts

--- language: - km license: apache-2.0 tags: - ocr - transformer - vision pipeline_tag: image-to-text --- # ViTOCR This repository contains a pure Transformer-based checkpoint for Khmer OCR. Images are patch-embedded and encoded by a Transformer encoder, then decoded autoregressively. ## Installation ```python pip install onnxruntime pillow torch torchvision numpy ``` ## Get the inference script Download from this model repo: ```bash curl -L -o onnx_inference.py https://huggingface.co/metythorn/ViTOCR-base/resolve/main/onnx_inference.py ``` Or copy `onnx_inference.py` from the repository files into your project directory. ## Usage ```python from onnx_inference import ONNXPredictor predictor = ONNXPredictor( model_path="model.onnx", config_path="config.json", providers=["CPUExecutionProvider"], # or include CUDAExecutionProvider if available ) result = predictor.predict("sample_image.png") print("Predicted text:", result) ```

Source context: 6 downloads · 0 likes · Pipeline image-to-text · Repo metythorn/ViTOCR-base