faria-models / README.md
pavan-synkrato360's picture
Update README.md
3f94e68 verified
---
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"
}
}
}
}
```