| Model | FP32 | Task |
|---|---|---|
| table-transformer-structure-recognition-v1.1-all | model.onnx | table structure recognition (rows, columns, merged cells) |
# onnxruntime-gpu for run it on GPU
pip install onnxruntime opencv-python numpy
Every model folder has the same layout:
src/helper.py = onnx session builder (provider selection, threads, memory options)src/example.py = full pipeline: image preprocess, inference, postprocessonnx/ = the model fileRun the commands from the repository root.
Test images used by the examples:
python3 table-transformer-structure-recognition-v1.1-all/src/example.py Table_1.jpg
0.999784 | table column | [446, 3, 929, 393]
0.999746 | table column | [943, 4, 1118, 393]
0.999231 | table column | [1263, 3, 1390, 393]
0.999151 | table column | [153, 4, 313, 393]
0.999050 | table column | [1513, 4, 1639, 394]
Note:
pixel_values, the only input, with a dynamic shape.logits [1, 125, 7] (raw, apply the softmax) and pred_boxes [1, 125, 4] as[centerX, centerY, width, height] in the 0..1 range: multiply by the table crop size.table, table column, table row, table column header, table projected row header,table spanning cell, no object (dropped).table spanning cell box marks the cells to merge.