ultralytics 8.0.78 Docker and confusion matrix updates (#2035)

Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
Co-authored-by: Yonghye Kwon <developer.0hye@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Abdul Manaf <75582860+AbdulManaf12@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-04-15 00:59:18 +02:00 committed by GitHub
parent 2c6fc0a444
commit 5c35dba22a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 43 additions and 34 deletions

View file

@ -220,13 +220,24 @@ def set_logging(name=LOGGING_NAME, verbose=True):
'propagate': False}}})
class EmojiFilter(logging.Filter):
"""
A custom logging filter class for removing emojis in log messages.
This filter is particularly useful for ensuring compatibility with Windows terminals
that may not support the display of emojis in log messages.
"""
def filter(self, record):
record.msg = emojis(record.msg)
return super().filter(record)
# Set logger
set_logging(LOGGING_NAME, verbose=VERBOSE) # run before defining LOGGER
LOGGER = logging.getLogger(LOGGING_NAME) # define globally (used in train.py, val.py, detect.py, etc.)
if WINDOWS: # emoji-safe logging
info_fn, warning_fn = LOGGER.info, LOGGER.warning
setattr(LOGGER, info_fn.__name__, lambda x: info_fn(emojis(x)))
setattr(LOGGER, warning_fn.__name__, lambda x: warning_fn(emojis(x)))
LOGGER.addFilter(EmojiFilter())
def yaml_save(file='data.yaml', data=None):