提交 8412d44d authored 作者: Glenn Jocher's avatar Glenn Jocher

update datasets.py to add detect.py --source glob_command feature

上级 eae33303
...@@ -70,10 +70,12 @@ class LoadImages: # for inference ...@@ -70,10 +70,12 @@ class LoadImages: # for inference
def __init__(self, path, img_size=640): def __init__(self, path, img_size=640):
p = str(Path(path)) # os-agnostic p = str(Path(path)) # os-agnostic
p = os.path.abspath(p) # absolute path p = os.path.abspath(p) # absolute path
if os.path.isdir(p): if '*' in p:
files = sorted(glob.glob(os.path.join(p, '*.*'))) files = sorted(glob.glob(p)) # glob
elif os.path.isdir(p):
files = sorted(glob.glob(os.path.join(p, '*.*'))) # dir
elif os.path.isfile(p): elif os.path.isfile(p):
files = [p] files = [p] # files
else: else:
raise Exception('ERROR: %s does not exist' % p) raise Exception('ERROR: %s does not exist' % p)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论