File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments