bbox
Bbox related features.
Classes:
| Name | Description |
|---|---|
BboxFeature |
Feature representing a bounding box. |
BoundingBoxesFeature |
Feature representing a list of bounding boxes within a single image. |
BboxFeature
#
Feature representing a bounding box.
This feature represents a single bbox in YOLO format for object detection tasks described by positional coordinates, class category, and detection score.
Bounding boxes follow the YOLO format, where each box is parameterized by:
- center_x and center_y: normalized coordinates of the box center within the image.
- width and height: normalized dimensions of the box.
- class: category index or label of the detected object.
- score: confidence score associated with the detection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[int] or list[str]
|
List of category identifiers or labels corresponding to the possible object classes. |
required |
Notes
- This feature is mostly meant to be used through
BoundingBoxesFeature
Methods:
| Name | Description |
|---|---|
to_model |
Convert to a |
from_model |
Instantiate from a json response. |
Attributes:
| Name | Type | Description |
|---|---|---|
categories |
list[int] | list[str]
|
|
name |
Literal['BBOX']
|
|
categories: list[int] | list[str]
#
name: Literal['BBOX'] = 'BBOX'
#
to_model() -> BBoxFeatureType
#
Convert to a ListFeatureTypeInput instance.
Returns:
| Type | Description |
|---|---|
ListFeatureTypeInput
|
Model-level representation of the bounding boxes feature, including the serialized box structure and category information. |
Source code in src/xpdeep/dataset/feature/feature_types/bbox.py
from_model(feature_type_input: BBoxFeatureType) -> BboxFeature
#
BoundingBoxesFeature
#
Feature representing a list of bounding boxes within a single image.
This feature encodes object detections as a collection of bounding boxes, each described by positional coordinates, class category, and detection score. It provides a structured way to represent outputs from object detection models or annotated datasets.
Bounding boxes follow the YOLO format, where each box is parameterized by:
- center_x and center_y: normalized coordinates of the box center within the image.
- width and height: normalized dimensions of the box.
- class: category index or label of the detected object.
- score: confidence score associated with the detection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[int] or list[str]
|
List of category identifiers or labels corresponding to the possible object classes. |
required |
Notes
- Bounding boxes are represented as a list of homogeneous sub-features.
- This feature is typically used to represent detections within a single image or frame.
- Current limitation: Xpdeep does not yet support variable numbers of detections per instance. Please pad bounding box lists to a uniform length before using this feature.
Attributes:
| Name | Type | Description |
|---|---|---|
items |
str
|
|
Methods:
| Name | Description |
|---|---|
__attrs_post_init__ |
Update categories. |