--- license: apache-2.0 library_name: PaddleOCR language: - en - zh pipeline_tag: image-to-text tags: - OCR - PaddlePaddle - PaddleOCR - table_structure_recognition --- # SLANeXt_wireless ## 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_wireless 69.65 -- -- 351M
**Note**: The accuracy of SLANeXt_wireless comes from the results of joint testing with SLANeXt_wired. ## Model Usage ```python import requests from PIL import Image from transformers import AutoImageProcessor, AutoModelForTableRecognition model_path="PaddlePaddle/SLANeXt_wireless_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']) ```