diff --git a/src/common/validation.py b/src/common/validation.py index 97f58f8..1c50d6e 100644 --- a/src/common/validation.py +++ b/src/common/validation.py @@ -5,6 +5,7 @@ from common.utils import PSNR, cal_ssim, logger_info, _rgb2ycbcr, modcrop from pathlib import Path from PIL import Image import time +from datetime import timedelta def val_image_pair(model, hr_image, lr_image, output_image_path=None, device='cuda'): with torch.inference_mode(): @@ -70,7 +71,7 @@ def valid_steps(model, datasets, config, log_prefix=""): len(test_dataset), np.mean(lr_areas), total_area, - total_time + timedelta(seconds=total_time) ] results.append(row) column_names = [ @@ -82,7 +83,7 @@ def valid_steps(model, datasets, config, log_prefix=""): 'Image count', 'AVG image area', 'Total area', - 'Total time, s' + 'Total time' ] config.logger.info("\n" + str(pd.DataFrame([row], columns=column_names).set_index('Dataset').T)) config.writer.flush()