emoji-safe default logging (#8888)

* emoji-safe default logging

* implement everywhere
This commit is contained in:
Glenn Jocher authored and GitHub committed 2022-08-06 12:30:08 +02:00
1 parent 73ed7a5e7a
commit 8f28ea4945
6 files changed
+24 -22

No files matched your search

+3 -3
View File
@@ -38,7 +38,7 @@ from models.common import DetectMultiBackend
from utils.callbacks import Callbacks
from utils.dataloaders import create_dataloader
from utils.general import (LOGGER, check_dataset, check_img_size, check_requirements, check_yaml,
coco80_to_coco91_class, colorstr, emojis, increment_path, non_max_suppression, print_args,
coco80_to_coco91_class, colorstr, increment_path, non_max_suppression, print_args,
scale_coords, xywh2xyxy, xyxy2xywh)
from utils.metrics import ConfusionMatrix, ap_per_class, box_iou
from utils.plots import output_to_target, plot_images, plot_val_study
@@ -274,7 +274,7 @@ def run(
pf = '%20s' + '%11i' * 2 + '%11.3g' * 4 # print format
LOGGER.info(pf % ('all', seen, nt.sum(), mp, mr, map50, map))
if nt.sum() == 0:
LOGGER.warning(emojis(f'WARNING: no labels found in {task} set, can not compute metrics without labels ⚠️'))
LOGGER.warning(f'WARNING: no labels found in {task} set, can not compute metrics without labels ⚠️')
# Print results per class
if (verbose or (nc < 50 and not training)) and nc > 1 and len(stats):
@@ -365,7 +365,7 @@ def main(opt):
if opt.task in ('train', 'val', 'test'): # run normally
if opt.conf_thres > 0.001: # https://github.com/ultralytics/yolov5/issues/1466
LOGGER.info(emojis(f'WARNING: confidence threshold {opt.conf_thres} > 0.001 produces invalid results ⚠️'))
LOGGER.info(f'WARNING: confidence threshold {opt.conf_thres} > 0.001 produces invalid results ⚠️')
run(**vars(opt))
else: