From 8412d44dced167353b914b798f86c72f7f89a058 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 12 Jul 2020 14:22:15 -0700 Subject: [PATCH] update datasets.py to add detect.py --source glob_command feature --- utils/datasets.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utils/datasets.py b/utils/datasets.py index e88ce76..cc5411f 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -70,10 +70,12 @@ class LoadImages: # for inference def __init__(self, path, img_size=640): p = str(Path(path)) # os-agnostic p = os.path.abspath(p) # absolute path - if os.path.isdir(p): - files = sorted(glob.glob(os.path.join(p, '*.*'))) + if '*' in 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): - files = [p] + files = [p] # files else: raise Exception('ERROR: %s does not exist' % p)