File size: 4,328 Bytes
3f94e68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
---
license: apache-2.0

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 `(cx, cy, w, h)`          |

**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`
2. Filter by confidence threshold
3. Convert `(cx, cy, w, h)``(x1, y1, x2, y2)`
4. Scale boxes to image size

---

### `nemotron_table_structure.onnx` (~200 MB)

Table structure recognition.

- **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                        |
| `orig_sizes` | `[1, 2]`            | int64   | `[height, width]`                |

**Outputs**

| Name    | Shape    | Type    |
|---------|----------|---------|
| labels  | `[N]`    | float32 |
| boxes   | `[N, 4]` | float32 |
| scores  | `[N]`    | float32 |

**Class labels**

| Index | Label  |
|-------|--------|
| 1     | cell   |
| 2     | row    |
| 3     | column |
| 4     | header |

---

## Installation

```bash
curl -fsSL https://raw.githubusercontent.com/exto360-inc/faria-install/main/install.sh | bash -s -- --features idp
```

Or download manually:

```bash
# 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
```

---

## 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"
      }
    }
  }
}
```