From a0fa99c4db33f4b9790f946548eadea2cd4becfc Mon Sep 17 00:00:00 2001 From: Dhruv Nair Date: Fri, 16 Jun 2023 05:36:28 +0530 Subject: [PATCH] Comet Updates (#3186) Co-authored-by: Glenn Jocher --- ultralytics/yolo/utils/callbacks/comet.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ultralytics/yolo/utils/callbacks/comet.py b/ultralytics/yolo/utils/callbacks/comet.py index bbf93ab..94aeb8f 100644 --- a/ultralytics/yolo/utils/callbacks/comet.py +++ b/ultralytics/yolo/utils/callbacks/comet.py @@ -46,7 +46,7 @@ def _scale_confidence_score(score): def _should_log_confusion_matrix(): - return os.getenv('COMET_EVAL_LOG_CONFUSION_MATRIX', 'true').lower() == 'true' + return os.getenv('COMET_EVAL_LOG_CONFUSION_MATRIX', 'false').lower() == 'true' def _should_log_image_predictions(): @@ -67,11 +67,12 @@ def _create_experiment(args): return try: comet_mode = _get_comet_mode() - experiment = _get_experiment_type(comet_mode, args.project) + _project_name = os.getenv('COMET_PROJECT_NAME', args.project) + experiment = _get_experiment_type(comet_mode, _project_name) experiment.log_parameters(vars(args)) experiment.log_others({ 'eval_batch_logging_interval': _get_eval_batch_logging_interval(), - 'log_confusion_matrix': _should_log_confusion_matrix(), + 'log_confusion_matrix_on_eval': _should_log_confusion_matrix(), 'log_image_predictions': _should_log_image_predictions(), 'max_image_predictions': _get_max_image_predictions_to_log(), }) experiment.log_other('Created from', 'yolov8') @@ -195,7 +196,7 @@ def _create_prediction_metadata_map(model_predictions): def _log_confusion_matrix(experiment, trainer, curr_step, curr_epoch): - """Log the confusion matrix to Weights and Biases experiment.""" + """Log the confusion matrix to Comet experiment.""" conf_mat = trainer.validator.confusion_matrix.matrix names = list(trainer.data['names'].values()) + ['background'] experiment.log_confusion_matrix(