Skip to content

Commit

Permalink
renamed out_image_format to color_space
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlov721 committed Jan 16, 2025
1 parent 466baab commit da5e276
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions luxonis_ml/data/loaders/luxonis_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(
height: Optional[int] = None,
width: Optional[int] = None,
keep_aspect_ratio: bool = True,
out_image_format: Literal["RGB", "BGR"] = "RGB",
color_space: Literal["RGB", "BGR"] = "RGB",
*,
update_mode: UpdateMode = UpdateMode.ALWAYS,
) -> None:
Expand Down Expand Up @@ -88,8 +88,8 @@ def __init__(
@type keep_aspect_ratio: bool
@param keep_aspect_ratio: Whether to keep the aspect ratio of the
images. Defaults to C{True}.
@type out_image_format: Literal["RGB", "BGR"]
@param out_image_format: The format of the output images. Defaults
@type color_space: Literal["RGB", "BGR"]
@param color_space: The format of the output images. Defaults
to C{"RGB"}.
@type update_mode: UpdateMode
@param update_mode: Enum that determines the sync mode:
Expand All @@ -98,7 +98,7 @@ def __init__(
"""

self.logger = logging.getLogger(__name__)
self.out_image_format = out_image_format
self.color_space = color_space

self.dataset = dataset
self.sync_mode = self.dataset.is_remote
Expand Down Expand Up @@ -212,7 +212,7 @@ def __getitem__(self, idx: int) -> LoaderOutput:
else:
img, labels = self._load_with_augmentations(idx)

if self.out_image_format == "BGR":
if self.color_space == "BGR":
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)

return img, labels
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data/test_dataset_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_parking_lot_generate(
augmentation_config=augmentation_config,
height=height,
width=width,
out_image_format="BGR",
color_space="BGR",
keep_aspect_ratio=True,
)
for _, labels in loader:
Expand Down

0 comments on commit da5e276

Please sign in to comment.