PyTorch weights (safetensors format) for the full PP-OCRv5 family, converted bit-exactly from the official PaddlePaddle .pdparams dynamic-graph weights — inference outputs are identical to the original PaddleOCR down to float32 precision.
Text Detection: 2 models (mobile / server)
Text Recognition (base): 2 models covering Simplified Chinese / Traditional Chinese / English / Japanese
Text Recognition (multilingual): 11 models covering 100+ languages (Korean, French, German, Russian, Arabic, Devanagari, Thai, Greek, Tamil, Telugu, etc.)
This repo contains weights + configs + dictionaries only, not inference code. For inference, use PaddleOCR2Pytorch, or follow the "Custom Python Inference" section below.
.
├── README.md / README_zh.md
├── LICENSE # Apache 2.0
├── config.json # Repo metadata + model index
│
├── ptocr_v5_*.safetensors # 15 PP-OCRv5 weights at root (stable URLs)
├── ptocr_v5_server_{det,rec}.pth # Legacy pth copies of V5 server (kept)
│
├── configs/
│ ├── det/PP-OCRv5/
│ │ ├── PP-OCRv5_mobile_det.yml
│ │ └── PP-OCRv5_server_det.yml
│ └── rec/PP-OCRv5/
│ ├── PP-OCRv5_mobile_rec.yml # zh / zh-Hant / en / ja
│ ├── PP-OCRv5_server_rec.yml
│ └── multi_language/ # 11 multilingual rec yamls
│ ├── en_PP-OCRv5_mobile_rec.yaml
│ ├── korean_PP-OCRv5_mobile_rec.yml
│ ├── latin_PP-OCRv5_mobile_rec.yml # French / German / Spanish / ... (40+ Latin-script)
│ ├── eslav_PP-OCRv5_mobile_rec.yml # Russian / Belarusian / Ukrainian
│ ├── cyrillic_PP-OCRv5_mobile_rec.yaml # 33 Cyrillic-script languages
│ ├── arabic_PP-OCRv5_mobile_rec.yaml # Arabic / Persian / Uyghur / Urdu / ...
│ ├── devanagari_PP-OCRv5_mobile_rec.yaml # Hindi / Marathi / Nepali / Sanskrit / ...
│ ├── th_PP-OCRv5_mobile_rec.yaml # Thai
│ ├── el_PP-OCRv5_mobile_rec.yaml # Greek
│ ├── ta_PP-OCRv5_mobile_rec.yaml # Tamil
│ └── te_PP-OCRv5_mobile_rec.yaml # Telugu
│
├── dicts/ # Character set dictionaries (required for rec)
│ ├── ppocrv5_dict.txt # base (zh / zh-Hant / en / ja)
│ └── ppocrv5_<lang>_dict.txt # 11 multilingual dicts
│
└── legacy/ # Older PP-OCR v2/v3/v4 weights (kept for back-compat)
├── ch_ptocr_mobile_v2.0_cls_infer.pth
├── ch_ptocr_v4_det_infer.pth
├── ch_ptocr_v4_rec_infer.pth
├── en_ptocr_v3_det_infer.pth
└── en_ptocr_v4_rec_infer.pth
All rec yamls use relative character_dict_path: ./dicts/.... After git clone or snapshot_download, paths resolve correctly with no modification required.
Model Catalog
Text Detection
Weight
Config
Use case
Size
ptocr_v5_mobile_det.safetensors
configs/det/PP-OCRv5/PP-OCRv5_mobile_det.yml
Mobile / CPU-friendly
~14 MB
ptocr_v5_server_det.safetensors
configs/det/PP-OCRv5/PP-OCRv5_server_det.yml
Server / high-accuracy
~101 MB
Text Recognition (Base)
Weight
Config
Languages
Size
ptocr_v5_mobile_rec.safetensors
configs/rec/PP-OCRv5/PP-OCRv5_mobile_rec.yml
Simplified / Traditional Chinese, English, Japanese
~31 MB
ptocr_v5_server_rec.safetensors
configs/rec/PP-OCRv5/PP-OCRv5_server_rec.yml
same as above, higher accuracy
~128 MB
Text Recognition (Multilingual)
All multilingual rec models share the same architecture (SVTR_LCNet + PPLCNetV3); they differ only by character dictionary. File size 23–28 MB each.
Weight
Supported languages
ptocr_v5_en_mobile_rec.safetensors
English (dedicated model optimized for English-only scenarios)
PaddleOCR2Pytorch base_ocr_v20.py auto-detects .safetensors vs .pth by extension (backward compatible).
Custom Python Inference
A minimal skeleton showing how to load the weights and run a forward pass. You still need the network definitions from the PaddleOCR2Pytorch pytorchocr/modeling/ package.
python
1import sys, numpy as np, cv2, torch, yaml
2from safetensors.torch import load_file
34# Requires https://github.com/frotms/PaddleOCR2Pytorch on PYTHONPATH5sys.path.insert(0,"/path/to/PaddleOCR2Pytorch")6from pytorchocr.modeling.architectures.base_model import BaseModel
7from pytorchocr.postprocess import build_post_process
89HF_REPO ="/path/to/hf_repo"# the path returned by snapshot_download10yml_path =f"{HF_REPO}/configs/rec/PP-OCRv5/multi_language/korean_PP-OCRv5_mobile_rec.yml"11weight_path =f"{HF_REPO}/ptocr_v5_korean_mobile_rec.safetensors"1213# 1. load config + dictionary14withopen(yml_path, encoding="utf-8")as f:15 cfg = yaml.safe_load(f)16dict_path = cfg["Global"]["character_dict_path"]# './dicts/ppocrv5_korean_dict.txt'17dict_abs =f"{HF_REPO}/{dict_path.lstrip('./')}"18withopen(dict_abs, encoding="utf-8")as f:19 chars =[l.strip("\n\r")for l in f]20n_char =len(chars)+2# +1 blank, +1 space (if use_space_char)2122# 2. build network + load weights (safetensors = zero-code-exec, mmap-fast)23cfg["Architecture"]["Head"]["out_channels_list"]={24"CTCLabelDecode": n_char,25"SARLabelDecode": n_char +2,26"NRTRLabelDecode": n_char +3,27}28net = BaseModel(cfg["Architecture"], out_channels=n_char)29net.load_state_dict(load_file(weight_path, device="cpu"))30net.eval()3132# 3. preprocess (resize to [3, 48, 320], normalize to [-1, 1])33img = cv2.imread("input_word.jpg")34h, w = img.shape[:2]35ratio = w / h
36tw =min(int(48* ratio),320)37img = cv2.resize(img,(tw,48))38canvas = np.zeros((48,320,3), dtype=np.uint8)39canvas[:,:tw]= img
40x = canvas.astype(np.float32).transpose(2,0,1)/255.041x =(x -0.5)/0.542x = torch.from_numpy(x).unsqueeze(0)4344# 4. forward + CTC decode45with torch.no_grad():46 logits = net(x)47post_op = build_post_process({48"name":"CTCLabelDecode",49"character_dict_path": dict_abs,50"use_space_char":True,51})52result = post_op(logits)53print("prediction:", result)# e.g. [('바탕으로', 0.9998)]
Runtime Dependencies
torch >= 1.13
safetensors >= 0.4
numpy, pillow, opencv-python
pyyaml, shapely, pyclipper
scikit-image # required by det post-processing
Conversion & Verification
Source weights: official PaddlePaddle .pdparams from https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/
Verification: end-to-end inference was run on macOS Apple Silicon (M-series) CPU; multilingual rec outputs are bit-exact with the original PaddleOCR .pdparams (float32 values match to 8 decimal places).
Sample inference results (CPU, < 0.7 s / image):
Sample
Prediction
Confidence
Chinese word_1.jpg
韩国小馆
0.99797755
Korean korean/1.jpg
바탕으로
0.99977183
French french/1.jpg
de l'amendement,
0.99656343
Arabic arabic/ar_1.jpg
الكيصياوي
0.68281130
Legacy Files (legacy/)
Older PP-OCR (v2 / v3 / v4) checkpoints previously at the repo root have been moved into legacy/ for clarity. They are still present and continue to work — just add the legacy/ prefix to your path.
If you were previously using any of these URLs at the root: