tags: - onnx - document-understanding - layout-detection - table-detection - faria pipeline_tag: object-detection --- # Faria ONNX Models Pre-exported ONNX models used by [Faria](https://github.com/exto360-inc/faria), a document processing library with ML-powered layout detection and table extraction. These files are ready for direct use with ONNX Runtime — no Python or conversion step required. ## Models ### `detr_layout_detection.onnx` (~350 MB) Document layout detection. Identifies structural elements across a page. - **Source:** [`cmarkea/detr-layout-detection`](https://huggingface.co/cmarkea/detr-layout-detection) - **ONNX opset:** 14 **Input** | Name | Shape | Type | |------|-------|------| | `pixel_values` | `[batch, 3, 800, 800]` | float32 | **Outputs** | Name | Shape | Type | Description | |------|-------|------|-------------| | `logits` | `[batch, 100, 12]` | float32 | Class scores (11 classes + no-object) | | `pred_boxes` | `[batch, 100, 4]` | float32 | Normalized boxes in `(cx, cy, w, h)` format | **Class labels (DocLayNet)** | Index | Label | |-------|-------| | 0 | Caption | | 1 | Footnote | | 2 | Formula | | 3 | List-item | | 4 | Page-footer | | 5 | Page-header | | 6 | Picture | | 7 | Section-header | | 8 | Table | | 9 | Text | | 10 | Title | | 11 | (no object) | **Post-processing** 1. Apply softmax to `logits` to get class probabilities 2. Filter detections by confidence threshold 3. Convert boxes from `(cx, cy, w, h)` to `(x1, y1, x2, y2)` 4. Scale boxes from `[0, 1]` to image dimensions --- ### `nemotron_table_structure.onnx` (~200 MB) Table structure recognition. Detects cells, rows, columns, and headers within a detected table region. - **Source:** [`nvidia/nemotron-table-structure-v1`](https://huggingface.co/nvidia/nemotron-table-structure-v1) - **ONNX opset:** 18 **Inputs** | Name | Shape | Type | Description | |------|-------|------|-------------| | `input` | `[1, 3, 1024, 1024]` | float32 | RGB image, normalized | | `orig_sizes` | `[1, 2]` | int64 | Original image `[height, width]` | **Outputs** | Name | Shape | Type | Description | |------|-------|------|-------------| | `labels` | `[N]` | float32 | Class label per detection | | `boxes` | `[N, 4]` | float32 | Normalized boxes `[x1, y1, x2, y2]` | | `scores` | `[N]` | float32 | Confidence score per detection | **Class labels** | Index | Label | |-------|-------| | 1 | cell | | 2 | row | | 3 | column | | 4 | header | --- ## Installation These models are installed automatically by the [faria-install](https://github.com/exto360-inc/faria-install) script: ```bash curl -fsSL https://raw.githubusercontent.com/exto360-inc/faria-install/main/install.sh | bash -s -- --features idp Or download directly: # Layout detection curl -fsSL https://huggingface.co/pavan-synkrato360/faria-models/resolve/main/detr_layout_detection.onnx \ -o detr_layout_detection.onnx # Table structure curl -fsSL https://huggingface.co/pavan-synkrato360/faria-models/resolve/main/nemotron_table_structure.onnx \ -o nemotron_table_structure.onnx Export These are custom ONNX exports from their respective source models. The export scripts are in the faria-install repository under models/ if you need to re-export. --- **`config.json`** ```json { "models": { "detr_layout_detection": { "filename": "detr_layout_detection.onnx", "task": "document-layout-detection", "source": "cmarkea/detr-layout-detection", "onnx_opset": 14, "input": { "pixel_values": [1, 3, 800, 800] }, "outputs": { "logits": [1, 100, 12], "pred_boxes": [1, 100, 4] }, "classes": [ "Caption", "Footnote", "Formula", "List-item", "Page-footer", "Page-header", "Picture", "Section-header", "Table", "Text", "Title" ] }, "nemotron_table_structure": { "filename": "nemotron_table_structure.onnx", "task": "table-structure-recognition", "source": "nvidia/nemotron-table-structure-v1", "onnx_opset": 18, "inputs": { "input": [1, 3, 1024, 1024], "orig_sizes": [1, 2] }, "outputs": { "labels": ["N"], "boxes": ["N", 4], "scores": ["N"] }, "classes": { "1": "cell", "2": "row", "3": "column", "4": "header" } } } }