Image-Text-to-Text
PaddleOCR
Safetensors
English
Chinese
multilingual
paddleocr_vl
ERNIE4.5
PaddlePaddle
image-to-text
ocr
document-parse
layout
table
formula
chart
conversational
custom_code
Eval Results
Run this model with HF Jobs
Run PaddlePaddle/PaddleOCR-VL on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/PaddlePaddle/PaddleOCR-VL. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/PaddlePaddle/PaddleOCR-VL on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/PaddlePaddle/PaddleOCR-VL. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/PaddlePaddle/PaddleOCR-VL. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use PaddlePaddle/PaddleOCR-VL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PaddleOCR
How to use PaddlePaddle/PaddleOCR-VL with PaddleOCR:
# See https://www.paddleocr.ai/latest/version3.x/pipeline_usage/PaddleOCR-VL.html to installation from paddleocr import PaddleOCRVL pipeline = PaddleOCRVL(pipeline_version="v1") output = pipeline.predict("path/to/document_image.png") for res in output: res.print() res.save_to_json(save_path="output") res.save_to_markdown(save_path="output") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files140 unmodified lines141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200140 unmodified lines**For more usage details and parameter explanations, see the [documentation](https://www.paddleocr.ai/latest/en/version3.x/pipeline_usage/PaddleOCR-VL.html).**## PaddleOCR-VL-0.9B Usage with transformersCurrently, we support inference using the PaddleOCR-VL-0.9B model with the `transformers` library, which can recognize texts, formulas, tables, and chart elements. In the future, we plan to support full document parsing inference with `transformers`. Below is a simple script we provide to support inference using the PaddleOCR-VL-0.9B model with `transformers`.> [!NOTE]> Note: We currently recommend using the official method for inference, as it is faster and supports page-level document parsing. The example code below only supports element-level recognition.```pythonfrom PIL import Imageimport torchfrom transformers import AutoModelForCausalLM, AutoProcessorDEVICE = "cuda" if torch.cuda.is_available() else "cpu"CHOSEN_TASK = "ocr" # Options: 'ocr' | 'table' | 'chart' | 'formula'PROMPTS = {"ocr": "OCR:","table": "Table Recognition:","formula": "Formula Recognition:","chart": "Chart Recognition:",}model_path = "PaddlePaddle/PaddleOCR-VL"image_path = "test.png"image = Image.open(image_path).convert("RGB")model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True, torch_dtype=torch.bfloat16).to(DEVICE).eval()processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)messages = [{"role": "user","content": [{"type": "image", "image": image},{"type": "text", "text": PROMPTS[CHOSEN_TASK]},]}]inputs = processor.apply_chat_template(messages,tokenize=True,add_generation_prompt=True,return_dict=True,return_tensors="pt").to(DEVICE)outputs = model.generate(**inputs, max_new_tokens=1024)outputs = processor.batch_decode(outputs, skip_special_tokens=True)[0]print(outputs)```## Performance### Page-Level Document Parsing140 unmodified lines141142143144145146140 unmodified lines**For more usage details and parameter explanations, see the [documentation](https://www.paddleocr.ai/latest/en/version3.x/pipeline_usage/PaddleOCR-VL.html).**## Performance### Page-Level Document Parsing
README.md-54