docs: model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: onnxruntime
|
| 3 |
+
pipeline_tag: object-detection
|
| 4 |
+
license: mit
|
| 5 |
+
base_model: microsoft/table-transformer-detection
|
| 6 |
+
tags:
|
| 7 |
+
- table-detection
|
| 8 |
+
- table-structure-recognition
|
| 9 |
+
- tatr
|
| 10 |
+
- table-transformer
|
| 11 |
+
- onnx
|
| 12 |
+
- gmft
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Microsoft Table Transformer (TATR) — ONNX re-export
|
| 16 |
+
|
| 17 |
+
Re-export of Microsoft's Table Transformer to ONNX, packaged the way [GMFT](https://github.com/conjuncts/gmft) consumes it. Used by [ScanIndex](https://github.com/welcomyou/scanindex) for table detection + structure recognition during DOCX export.
|
| 18 |
+
|
| 19 |
+
## Variants
|
| 20 |
+
|
| 21 |
+
| Subdir | Upstream | Task |
|
| 22 |
+
|---|---|---|
|
| 23 |
+
| `gmft_onnx/detection/model.onnx` | [`microsoft/table-transformer-detection`](https://huggingface.co/microsoft/table-transformer-detection) | Detect table bounding boxes on a page |
|
| 24 |
+
| `gmft_onnx/structure/model.onnx` | [`microsoft/table-transformer-structure-recognition-v1.1-all`](https://huggingface.co/microsoft/table-transformer-structure-recognition-v1.1-all) | Detect rows / columns / cells inside a cropped table |
|
| 25 |
+
|
| 26 |
+
Each subdir also contains the HF `config.json` + preprocessor metadata so `transformers` / `optimum` can wrap the ONNX directly.
|
| 27 |
+
|
| 28 |
+
## Loading
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
from huggingface_hub import snapshot_download
|
| 32 |
+
local = snapshot_download("welcomyou/gmft-tatr-onnx", local_dir="models")
|
| 33 |
+
# Detection: f"{local}/gmft_onnx/detection/model.onnx"
|
| 34 |
+
# Structure: f"{local}/gmft_onnx/structure/model.onnx"
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
## Re-export reproduction
|
| 38 |
+
|
| 39 |
+
See [train-convert/gmft/convert/export_gmft_tatr_to_onnx.py](https://github.com/welcomyou/scanindex/blob/main/train-convert/gmft/convert/export_gmft_tatr_to_onnx.py).
|
| 40 |
+
|
| 41 |
+
## License
|
| 42 |
+
|
| 43 |
+
MIT, inherited from Microsoft Table Transformer.
|