From 034619c220a1ebffb34cdc2ac1742916421a8207 Mon Sep 17 00:00:00 2001 From: daniel03c1 Date: Sat, 5 Nov 2022 00:16:54 +0900 Subject: [PATCH] fix app_mask --- TensoRF/models/tensoRF.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/TensoRF/models/tensoRF.py b/TensoRF/models/tensoRF.py index aec1048..f4ec39d 100644 --- a/TensoRF/models/tensoRF.py +++ b/TensoRF/models/tensoRF.py @@ -137,6 +137,14 @@ def compute_appfeature(self, points): plane = min_max_quantize(self.app_plane[idx], self.grid_bit) line = min_max_quantize(self.app_line[idx], self.grid_bit) + if self.use_mask: + mask = torch.sigmoid(self.app_plane_mask[idx]) + plane = (plane * (mask >= 0.5) - plane * mask).detach() \ + + plane * mask + mask = torch.sigmoid(self.app_line_mask[idx]) + line = (line * (mask >= 0.5) - line * mask).detach() \ + + line * mask + if self.use_dwt: plane = inverse(plane, self.dwt_level)