Skip to content

Commit 06b11db

Browse files
committed
minor fix
1 parent d13f6d3 commit 06b11db

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

luxonis_ml/data/loaders/luxonis_loader.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,7 @@ def _load_data(self, idx: int) -> LoaderMultiOutput:
339339
if img.ndim == 2:
340340
img_gray = img[..., np.newaxis]
341341
elif img.ndim == 3 and img.shape[2] == 3:
342-
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)[
343-
..., np.newaxis
344-
]
342+
img_gray = img[..., 0:1]
345343
else:
346344
raise ValueError(
347345
f"Unsupported image format: shape {img.shape}"
@@ -350,7 +348,7 @@ def _load_data(self, idx: int) -> LoaderMultiOutput:
350348
img_dict[source_name] = img_gray
351349
else:
352350
img_dict[source_name] = cv2.cvtColor(
353-
cv2.imread(str(path)), cv2.COLOR_BGR2RGB
351+
cv2.imread(str(path), cv2.IMREAD_COLOR), cv2.COLOR_BGR2RGB
354352
)
355353

356354
labels_by_task: dict[str, list[Annotation]] = defaultdict(list)

0 commit comments

Comments
 (0)