glenn-jocher commited on
Commit
b83e1a4
1 Parent(s): 1f69d12

Fix `img2label_paths()` order (#3720)

Browse files

* Fix `img2label_paths()` order

* fix, 1

Files changed (1) hide show
  1. utils/datasets.py +1 -1
utils/datasets.py CHANGED
@@ -348,7 +348,7 @@ class LoadStreams: # multiple IP or RTSP cameras
348
  def img2label_paths(img_paths):
349
  # Define label paths as a function of image paths
350
  sa, sb = os.sep + 'images' + os.sep, os.sep + 'labels' + os.sep # /images/, /labels/ substrings
351
- return ['txt'.join(x.replace(sa, sb, 1).rsplit(x.split('.')[-1], 1)) for x in img_paths]
352
 
353
 
354
  class LoadImagesAndLabels(Dataset): # for training/testing
 
348
  def img2label_paths(img_paths):
349
  # Define label paths as a function of image paths
350
  sa, sb = os.sep + 'images' + os.sep, os.sep + 'labels' + os.sep # /images/, /labels/ substrings
351
+ return [sb.join(x.rsplit(sa, 1)).rsplit('.', 1)[0] + '.txt' for x in img_paths]
352
 
353
 
354
  class LoadImagesAndLabels(Dataset): # for training/testing