Skip to content

Commit b30e1c7

Browse files
authored
add min_bbox_visibility to loader
1 parent af4ab23 commit b30e1c7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

luxonis_ml/data/loaders/luxonis_loader.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def __init__(
4848
exclude_empty_annotations: bool = False,
4949
color_space: Literal["RGB", "BGR", "GRAY"] = "RGB",
5050
seed: int | None = None,
51+
min_bbox_visibility: float = 0.0,
5152
bbox_area_threshold: float = 0.0004,
5253
*,
5354
keep_categorical_as_strings: bool = False,
@@ -96,6 +97,8 @@ def __init__(
9697
to C{"RGB"}.
9798
@type seed: Optional[int]
9899
@param seed: The random seed to use for the augmentations.
100+
@type min_bbox_visibility: float
101+
@param min_bbox_visibility: Minimum fraction of the original bounding box that must remain visible after augmentation.
99102
@type bbox_area_threshold: float
100103
@param bbox_area_threshold: Minimum area threshold for bounding boxes to be considered valid. In the range [0, 1].
101104
Default is 0.0004, which corresponds to a small area threshold to remove invalid bboxes and respective keypoints.
@@ -222,6 +225,7 @@ def __init__(
222225
width,
223226
keep_aspect_ratio,
224227
seed,
228+
min_bbox_visibility,
225229
bbox_area_threshold,
226230
)
227231

@@ -439,6 +443,7 @@ def _init_augmentations(
439443
width: int | None,
440444
keep_aspect_ratio: bool,
441445
seed: int | None = None,
446+
min_bbox_visibility: float = 0.0,
442447
bbox_area_threshold: float = 0.0004,
443448
) -> AugmentationEngine | None:
444449
if isinstance(augmentation_config, PathType):
@@ -481,6 +486,7 @@ def _init_augmentations(
481486
keep_aspect_ratio=keep_aspect_ratio,
482487
is_validation_pipeline="train" not in self.view,
483488
seed=seed,
489+
min_bbox_visibility=min_bbox_visibility,
484490
bbox_area_threshold=bbox_area_threshold,
485491
)
486492

0 commit comments

Comments
 (0)