Fix img2label_paths() order (#3720)

* Fix `img2label_paths()` order

* fix, 1
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-06-21 22:50:56 +02:00
1 parent 1f69d12591
commit b83e1a4adc
1 file changed
+1 -1
+1 -1
View File
@@ -348,7 +348,7 @@ class LoadStreams: # multiple IP or RTSP cameras
def img2label_paths(img_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
return ['txt'.join(x.replace(sa, sb, 1).rsplit(x.split('.')[-1], 1)) for x in img_paths]
return [sb.join(x.rsplit(sa, 1)).rsplit('.', 1)[0] + '.txt' for x in img_paths]
class LoadImagesAndLabels(Dataset): # for training/testing