aoiandroid/PP-DocLayoutV3-safetensors-CoreML
019
PP-DocLayoutV3 safetensors Core ML (mlprogram)
Private distribution of the Core ML export for PaddlePaddle/PP-DocLayoutV3_safetensors, built for TranslateBlue on-device layout detection.
Source weights: PaddlePaddle/PP-DocLayoutV3 / PP-DocLayoutV3_safetensors.
Files
Input / output (in-package)
Preprocessing
Match PPDocLayoutV3ImageProcessor:
- Resize to 800×800 (bicubic,
antialias=Falsein Transformers export) - Rescale:
pixel / 255 - Normalize: mean
[0,0,0], std[1,1,1]
See preprocessor_config.json.
Post-processing (not in Core ML)
Apply the same logic as PPDocLayoutV3ImageProcessor.post_process_object_detection in Python or Swift:
- Sigmoid + top-k on
logits - Reading order from
order_logits - Optional polygon masks require full PyTorch path (masks omitted in this export)
Conversion notes
- Export script: TranslateBlue
Scripts/export_pp_doclayout_v3_safetensors_coreml/ numpy<2.4required for coremltools convert (coremltools#2633)compute_precision=float32(fp16 MIL cast diverges)- Fixed 800×800 input (trace); other sizes are unsupported
Parity (reference)
On bus.jpg (TranslateBlue smoke):
License
Apache 2.0 (same family as PaddlePaddle/PP-DocLayoutV3).
