mirror of
https://github.com/ultralytics/yolov5.git
synced 2025-06-03 14:49:29 +08:00
update datasets.py to add detect.py --source glob_command feature
This commit is contained in:
parent
eae33303d6
commit
8412d44dce
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user