ultralytics 8.0.116 NAS, DVC, YOLOv5u updates (#3124)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-06-11 20:39:32 +02:00 committed by GitHub
parent 095b856e75
commit f4e8b39fc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 63 additions and 41 deletions

View file

@ -224,6 +224,11 @@ def set_logging(name=LOGGING_NAME, verbose=True):
'propagate': False}}})
def emojis(string=''):
"""Return platform-dependent emoji-safe version of string."""
return string.encode().decode('ascii', 'ignore') if WINDOWS else string
class EmojiFilter(logging.Filter):
"""
A custom logging filter class for removing emojis in log messages.
@ -533,6 +538,7 @@ def get_user_config_dir(sub_dir='Ultralytics'):
# GCP and AWS lambda fix, only /tmp is writeable
if not is_dir_writeable(str(path.parent)):
path = Path('/tmp') / sub_dir
LOGGER.warning(f"WARNING ⚠️ user config directory is not writeable, defaulting to '{path}'.")
# Create the subdirectory if it does not exist
path.mkdir(parents=True, exist_ok=True)
@ -544,11 +550,6 @@ USER_CONFIG_DIR = Path(os.getenv('YOLO_CONFIG_DIR', get_user_config_dir())) # U
SETTINGS_YAML = USER_CONFIG_DIR / 'settings.yaml'
def emojis(string=''):
"""Return platform-dependent emoji-safe version of string."""
return string.encode().decode('ascii', 'ignore') if WINDOWS else string
def colorstr(*input):
"""Colors a string https://en.wikipedia.org/wiki/ANSI_escape_code, i.e. colorstr('blue', 'hello world')."""
*args, string = input if len(input) > 1 else ('blue', 'bold', input[0]) # color arguments, string