Unverified 提交 f9bab6b1 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Update datasets.py

上级 54a9e4f8
......@@ -295,16 +295,11 @@ class LoadImagesAndLabels(Dataset): # for training/testing
else:
raise Exception('%s does not exist' % subpath)
self.img_files = [x.replace('/', os.sep) for x in f if os.path.splitext(x)[-1].lower() in img_formats]
path = subpath
except:
# Maybe avoid handling bare exceptions
raise Exception('Error loading data from %s. See %s' % (path, help_url))
# Still need to do this for compatibility with the .npy and shape file saves
if isinstance(path, list):
path = str(Path(path[0]))
else:
path = str(Path(path))
n = len(self.img_files)
assert n > 0, 'No images found in %s. See %s' % (path, help_url)
bi = np.floor(np.arange(n) / batch_size).astype(np.int) # batch index
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论