Spaces:
Runtime error
Runtime error
Download datatypes/datatypes.py from Abijith/Table-Detection-and-Recognition-using-DETR: direct link, hf CLI and curl.
- Browser
- Download file 1.4 kB
-
https://huggingface.co/spaces/Abijith/Table-Detection-and-Recognition-using-DETR/resolve/main/datatypes/datatypes.py
- Command line
-
hf download hf://spaces/Abijith/Table-Detection-and-Recognition-using-DETR/datatypes/datatypes.py
-
curl -L -o datatypes.py https://huggingface.co/spaces/Abijith/Table-Detection-and-Recognition-using-DETR/resolve/main/datatypes/datatypes.py
1.4 kB
| import os | |
| from dataclasses import dataclass, field | |
| from enum import Enum | |
| from typing import List, Dict | |
| class DetectionLabels(Enum): | |
| table = 0 | |
| table_column = 1 | |
| table_row = 2 | |
| table_column_header = 3 | |
| table_projected_row_header = 4 | |
| table_spanning_cell = 5 | |
| class ExtractionContext(Enum): | |
| document = 1 | |
| table = 2 | |
| row = 3 | |
| class Cell: | |
| cellindex : int = 0 | |
| value : str = '' | |
| prob : float = 0.5 | |
| class Row: | |
| rowindex : int = 0 | |
| extracted_cells : List[Cell]= field(default_factory=lambda: []) | |
| class TableRecognitionData: | |
| scores : List = field(default_factory=lambda: []) | |
| labels : List = field(default_factory=lambda: []) | |
| boxes : List = field(default_factory=lambda: []) | |
| class TableRecognitionOrdered: | |
| recognized_row : List = field(default_factory=lambda: []) | |
| recognized_column : List = field(default_factory=lambda: []) | |
| class TableDetectionData: | |
| detection_score : float = 0.0 | |
| detection_label : int = 0 | |
| detection_box : List = field(default_factory=lambda: []) | |
| recognitiondata : TableRecognitionData = field(default_factory=lambda: []) | |
| ordered_recognitiondata : List[TableRecognitionOrdered] = field(default_factory=lambda: []) | |
| extracted_rows : List[Row] = field(default_factory=lambda: []) | |
| class ImageData: | |
| tables: List[TableDetectionData] | |