윤영준 윤영준 2023-06-29
something is weird about this gamma correction
@6f62307973748e5c59fbcbb38089b2bb94e45e7c
model/Generator.py
--- model/Generator.py
+++ model/Generator.py
@@ -35,12 +35,12 @@
         return ret
 
     def binary_diff_mask(self, clean, dirty, thresold=0.1):
-        clean = torch.pow(clean, 2.2)
-        dirty = torch.pow(dirty, 2.2)
+        # this parts corrects gamma, and always remember, sRGB values are not in linear scale with lights intensity
+        clean = torch.pow(clean, 0.45)
+        dirty = torch.pow(dirty, 0.45)
         diff = torch.abs(clean - dirty)
         diff = torch.sum(diff, dim=1)
-        # this line is certainly cause problem for quantization
-        # like, hardcoding it, what could go wrong?
+
         bin_diff = (diff > thresold).to(clean.dtype)
 
         return bin_diff
Add a comment
List