Views
No views yet
| 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 |
1import requests
2from PIL import Image
3from transformers import AutoImageProcessor, AutoModelForTableRecognition
4
5model_path="PaddlePaddle/SLANeXt_wireless_safetensors"
6model = AutoModelForTableRecognition.from_pretrained(model_path, dtype=torch.float32, device_map="auto")
7image_processor = AutoImageProcessor.from_pretrained(model_path)
8
9image = Image.open(requests.get("https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/table_recognition.jpg", stream=True).raw)
10inputs = image_processor(images=image, return_tensors="pt").to(model.device)
11outputs = model(**inputs)
12
13results = image_processor.post_process_table_recognition(outputs)
14
15print(result['structure'])
16print(result['structure_score'])