Image-to-Text
PaddleOCR
Safetensors
English
Chinese
slanext
OCR
PaddlePaddle
table_structure_recognition
Instructions to use PaddlePaddle/SLANeXt_wired_safetensors with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PaddleOCR
How to use PaddlePaddle/SLANeXt_wired_safetensors with PaddleOCR:
# 1. See https://www.paddlepaddle.org.cn/en/install to install paddlepaddle # 2. pip install paddleocr from paddleocr import TableStructureRecognition model = TableStructureRecognition(model_name="SLANeXt_wired_safetensors") 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") - Notebooks
- Google Colab
- Kaggle
SLANeXt_wired
Introduction
Table structure recognition is an important component of table recognition systems, capable of converting non-editable table images into editable table formats (such as HTML). The goal of table structure recognition is to identify the positions of rows, columns, and cells in tables. The performance of this module directly affects the accuracy and efficiency of the entire table recognition system. The table structure recognition module usually outputs HTML code for the table area, which is then passed as input to the tabl recognition pipeline for further processing.
| Model | Accuracy (%) | GPU Inference Time (ms) [Normal Mode / High Performance Mode] |
CPU Inference Time (ms) [Normal Mode / High Performance Mode] |
Model Storage Size (M) |
|---|---|---|---|---|
| SLANeXt_wired | 69.65 | -- | -- | 351M |
Note: The accuracy of SLANeXt_wired comes from the results of joint testing with SLANeXt_wireless.
Model Usage
import requests
from PIL import Image
from transformers import AutoImageProcessor, AutoModelForTableRecognition
model_path="PaddlePaddle/SLANeXt_wired_safetensors"
model = AutoModelForTableRecognition.from_pretrained(model_path, dtype=torch.float32, device_map="auto")
image_processor = AutoImageProcessor.from_pretrained(model_path)
image = Image.open(requests.get("https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/table_recognition.jpg", stream=True).raw)
inputs = image_processor(images=image, return_tensors="pt").to(model.device)
outputs = model(**inputs)
results = image_processor.post_process_table_recognition(outputs)
print(result['structure'])
print(result['structure_score'])
- Downloads last month
- 132