Skip to content

Commit 06345f1

Browse files
committed
Merge branch 'dev' of github.com:luxonis/luxonis-ml into dev
2 parents d1df4a3 + 2fb83e2 commit 06345f1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

luxonis_ml/data/loaders/luxonis_loader.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def __getitem__(self, idx: int) -> LuxonisLoaderOutput:
137137
aug_input_data = []
138138
label_to_task = {}
139139
nk = 0
140+
ns = 0
140141
for img, annotations in loaded_anns:
141142
label_dict: Dict[LabelType, np.ndarray] = {}
142143
for task in sorted(list(annotations.keys())):
@@ -147,6 +148,8 @@ def __getitem__(self, idx: int) -> LuxonisLoaderOutput:
147148
annotations.pop(task)
148149
if label_type == LabelType.KEYPOINTS:
149150
nk = (array.shape[1] - 1) // 3
151+
if label_type == LabelType.SEGMENTATION:
152+
ns = array.shape[0]
150153

151154
aug_input_data.append((img, label_dict))
152155

@@ -155,7 +158,7 @@ def __getitem__(self, idx: int) -> LuxonisLoaderOutput:
155158
random.setstate(random_state)
156159
np.random.set_state(np_random_state)
157160

158-
img, aug_annotations = self.augmentations(aug_input_data, nk=nk)
161+
img, aug_annotations = self.augmentations(aug_input_data, nk=nk, ns=ns)
159162
for label_type, array in aug_annotations.items():
160163
out_dict[label_to_task[label_type]] = (array, label_type)
161164

0 commit comments

Comments
 (0)