Jacobsolawetz
commited on
Update img2label_paths() (#1414)
Browse files- utils/datasets.py +1 -1
utils/datasets.py
CHANGED
@@ -337,7 +337,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
|
|
337 |
def img2label_paths(img_paths):
|
338 |
# Define label paths as a function of image paths
|
339 |
sa, sb = os.sep + 'images' + os.sep, os.sep + 'labels' + os.sep # /images/, /labels/ substrings
|
340 |
-
return [x.replace(sa, sb, 1).replace(x.split('.')[-1], 'txt') for x in img_paths]
|
341 |
|
342 |
try:
|
343 |
f = [] # image files
|
|
|
337 |
def img2label_paths(img_paths):
|
338 |
# Define label paths as a function of image paths
|
339 |
sa, sb = os.sep + 'images' + os.sep, os.sep + 'labels' + os.sep # /images/, /labels/ substrings
|
340 |
+
return [x.replace(sa, sb, 1).replace('.' + x.split('.')[-1], '.txt') for x in img_paths]
|
341 |
|
342 |
try:
|
343 |
f = [] # image files
|