How to use from the
Use from the
PaddleOCR library
# 1. See https://www.paddlepaddle.org.cn/en/install to install paddlepaddle
# 2. pip install paddleocr

from paddleocr import TextDetection
model = TextDetection(model_name="PP-OCRv6-medium-det-mlx")
output = model.predict(input="path/to/image.png", batch_size=1)
for res in output:
    res.print()
    res.save_to_img(save_path="./output/")
    res.save_to_json(save_path="./output/res.json")

PP-OCRv6 medium text detection MLX

This is an MLX-format conversion of PaddlePaddle/PP-OCRv6_medium_det_safetensors for use with mlx-vlm.

import mlx.core as mx
from PIL import Image
from mlx_vlm import load

model, processor = load("mikoy92/PP-OCRv6-medium-det-mlx")
image = Image.open("document.png")

inputs = processor(image)
outputs = model(**inputs)
mx.eval(outputs.logits)

result = processor.post_process_object_detection(
    outputs,
    target_sizes=inputs["target_sizes"],
)[0]
print(result["boxes"])
Downloads last month
37
Safetensors
Model size
22M params
Tensor type
F32
·
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mikoy92/PP-OCRv6-medium-det-mlx

Finetuned
(1)
this model