tlc.core.export.annotation_utils¶
Common utilities for annotation detection in exporters.
Module Contents¶
Classes¶
Class |
Description |
|---|---|
Enumeration of supported annotation types for export. |
Functions¶
Function |
Description |
|---|---|
Detect the annotation type and column name for a table. |
|
Check if the table has a bounding box column. |
|
Check if the table has a keypoints column. |
|
Check if the table has an oriented bounding box column. |
|
Check if the table has a segmentation column. |
API¶
- class AnnotationType¶
Bases:
enum.EnumEnumeration of supported annotation types for export.
- BOUNDING_BOXES = bounding_boxes¶
- KEYPOINTS = keypoints¶
- ORIENTED_BOUNDING_BOXES = oriented_bounding_boxes¶
- SEGMENTATION = segmentation¶
- detect_annotation_type( ) tuple[AnnotationType, str]¶
Detect the annotation type and column name for a table.
If annotation_column_name is provided, it validates that column and returns its type. Otherwise, it auto-detects the annotation type by checking columns in order: bounding boxes, segmentation, keypoints, oriented bounding boxes.
- Parameters:
table – The table to analyze.
annotation_column_name – Optional specific column name to use.
- Returns:
A tuple of (annotation_type, column_name).
- Raises:
ValueError – If no compatible annotation column is found.
- detect_bounding_box_column(
- table: Table,
Check if the table has a bounding box column.
- Parameters:
table – The table to check.
- Returns:
A tuple of (is_bb_table, column_name).
- detect_keypoints_column(
- table: Table,
Check if the table has a keypoints column.
Keypoints columns have INSTANCES with VERTICES_2D (2D points) and bounds (X_MAX, Y_MAX).
- Parameters:
table – The table to check.
- Returns:
A tuple of (is_keypoints_table, column_name).