Skip to content

Commit

Permalink
updata normal
Browse files Browse the repository at this point in the history
  • Loading branch information
River-Zhang committed Dec 26, 2023
1 parent f09f4f1 commit 0a51437
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions lib/dataset/Evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ((
Expand Down

0 comments on commit 0a51437

Please sign in to comment.