Downloads · 30 days
0
kavayam/table-transformer-structure-recognition-v1.1-all-onnx
table-transformer-structure-recognition-v1.1-all-onnx is a machine learning model from kavayam. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Converted and published by KavayaM Technologies.
Downloads · 30 days
0
Access
Public
Updated Sep 14, 2026
Repo size
231 MB
Likes
0
Public
Click a slice to open those files.
.onnx116 MB · 50%
From the Hugging Face model README
Converted and published by KavayaM Technologies.
An ONNX export of microsoft/table-transformer-structure-recognition-v1.1-all, for direct execution via onnxruntime, with no PyTorch installation required.
Weights are unmodified from the source model above, trained by Microsoft on PubTables-1M and FinTabNet.c (Smock et al., 2023). This repository only adds the ONNX export -- no fine-tuning, no weight changes. MIT-licensed, same as the source model.
Exported via torch.onnx.export(), opset 15, using the legacy
(non-dynamo) exporter. The dynamo-based exporter (dynamo=True,
default on current PyTorch) fails on this model with a version-conversion
error (No Adapter To Version $17 for Resize) when targeting opset 15;
the legacy exporter's native per-opset op emission does not hit this
issue.
Compared against the live PyTorch model's raw output
(pred_logits/pred_boxes) on a single real table-image crop, maximum
absolute difference:
| pred_logits | pred_boxes | |
|---|---|---|
| CPU (onnxruntime CPUExecutionProvider) | 0.000029 | 0.000002 |
GPU (onnxruntime CUDAExecutionProvider, NVIDIA_TF32_OVERRIDE=0) | 0.000027 | 0.000003 |
Both within ordinary floating-point export/inference noise. The GPU
figure requires NVIDIA_TF32_OVERRIDE=0 -- without it, GPUs that default
to TF32 (Ampere/Ada/Hopper) show a substantially larger difference from
reduced-precision matmul, unrelated to export correctness.
This checks raw tensor output only, on one input. It does not benchmark accuracy or speed on any particular document set -- those depend on the documents in question, not on a property of this file.
model.onnx -- the exported graphmodel.onnx.data -- externalized weights (required alongside
model.onnx; ONNX externalizes weights above a size threshold into
this companion file)from huggingface_hub import hf_hub_download
import onnxruntime as ort
onnx_path = hf_hub_download(
repo_id="kavayam/table-transformer-structure-recognition-v1.1-all-onnx",
filename="model.onnx",
)
hf_hub_download(
repo_id="kavayam/table-transformer-structure-recognition-v1.1-all-onnx",
filename="model.onnx.data",
) # must be downloaded alongside model.onnx, in the same directory
session = ort.InferenceSession(onnx_path, providers=["CPUExecutionProvider"])
# Input: "pixel_values", a (1, 3, H, W) float32 array, ImageNet-normalized
# after resizing the longer side to 1000px -- see Microsoft's reference
# implementation (https://github.com/microsoft/table-transformer/blob/main/src/inference.py,
# structure_transform) for the exact steps.
pred_logits, pred_boxes = session.run(
["pred_logits", "pred_boxes"], {"pixel_values": pixel_values}
)