Update img2label_paths() (#1414)

This commit is contained in:
Jacobsolawetz 2020-11-17 06:26:06 -06:00 committed by GitHub
parent 97c6a59dd1
commit 8d2d6d2349
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -337,7 +337,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
def img2label_paths(img_paths): def img2label_paths(img_paths):
# Define label paths as a function of image paths # Define label paths as a function of image paths
sa, sb = os.sep + 'images' + os.sep, os.sep + 'labels' + os.sep # /images/, /labels/ substrings sa, sb = os.sep + 'images' + os.sep, os.sep + 'labels' + os.sep # /images/, /labels/ substrings
return [x.replace(sa, sb, 1).replace(x.split('.')[-1], 'txt') for x in img_paths] return [x.replace(sa, sb, 1).replace('.' + x.split('.')[-1], '.txt') for x in img_paths]
try: try:
f = [] # image files f = [] # image files