From 0a51437ac5e12dec6babc7b0782e1d32225bd85e Mon Sep 17 00:00:00 2001 From: River-Zhang <3190100057@zju.edu.cn> Date: Tue, 26 Dec 2023 10:21:47 +0800 Subject: [PATCH] updata normal --- lib/dataset/Evaluator.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/dataset/Evaluator.py b/lib/dataset/Evaluator.py index 0c4ab82..6e2dad9 100644 --- a/lib/dataset/Evaluator.py +++ b/lib/dataset/Evaluator.py @@ -91,23 +91,19 @@ def calculate_normal_consist(self, normal_path): - src_normal_arr = (make_grid(torch.cat(src_normal_imgs, dim=0), nrow=4) - + 1.0) * 0.5 # [0,1] - tgt_normal_arr = (make_grid(torch.cat(tgt_normal_imgs, dim=0), nrow=4) - + 1.0) * 0.5 # [0,1] - # src_norm = torch.norm(src_normal_arr, dim=0, keepdim=True) - # tgt_norm = torch.norm(tgt_normal_arr, dim=0, keepdim=True) + src_normal_arr = make_grid(torch.cat(src_normal_imgs, dim=0), nrow=4,padding=0) # [0,1] + tgt_normal_arr = make_grid(torch.cat(tgt_normal_imgs, dim=0), nrow=4,padding=0) # [0,1] + src_norm = torch.norm(src_normal_arr, dim=0, keepdim=True) + tgt_norm = torch.norm(tgt_normal_arr, dim=0, keepdim=True) - # src_norm[src_norm == 0.0] = 1.0 - # tgt_norm[tgt_norm == 0.0] = 1.0 + src_norm[src_norm == 0.0] = 1.0 + tgt_norm[tgt_norm == 0.0] = 1.0 - # src_normal_arr /= src_norm - # tgt_normal_arr /= tgt_norm + src_normal_arr /= src_norm + tgt_normal_arr /= tgt_norm - # # sim_mask = self.get_laplacian_2d(tgt_normal_arr).to(self.device) - - # src_normal_arr = (src_normal_arr + 1.0) * 0.5 - # tgt_normal_arr = (tgt_normal_arr + 1.0) * 0.5 + src_normal_arr = (src_normal_arr + 1.0) * 0.5 + tgt_normal_arr = (tgt_normal_arr + 1.0) * 0.5 error = ((