check_file() update from yolov5
This commit is contained in:
@@ -43,6 +43,16 @@ def check_git_status():
|
||||
print(s[s.find('Your branch is behind'):s.find('\n\n')] + '\n')
|
||||
|
||||
|
||||
def check_file(file):
|
||||
# Searches for file if not found locally
|
||||
if os.path.isfile(file):
|
||||
return file
|
||||
else:
|
||||
files = glob.glob('./**/' + file, recursive=True) # find file
|
||||
assert len(files), 'File Not Found: %s' % file # assert file was found
|
||||
return files[0] # return first file if multiple found
|
||||
|
||||
|
||||
def load_classes(path):
|
||||
# Loads *.names file at 'path'
|
||||
with open(path, 'r') as f:
|
||||
|
||||
Reference in New Issue
Block a user