MCPcopy Create free account
hub / github.com/IceClear/StableSR / update_gaussian

Method update_gaussian

scripts/util_image.py:785–798  ·  view source on GitHub ↗

Input: pch_res: n x c x pch_size x pch_size, float index_infos: (h_start, h_end, w_start, w_end)

(self, pch_res, index_infos)

Source from the content-addressed store, hash-verified

783 self.pixel_count[:, :, h_start:h_end, w_start:w_end] += 1
784
785 def update_gaussian(self, pch_res, index_infos):
786 '''
787 Input:
788 pch_res: n x c x pch_size x pch_size, float
789 index_infos: (h_start, h_end, w_start, w_end)
790 '''
791 if index_infos is None:
792 w_start, w_end = self.w_start, self.w_end
793 h_start, h_end = self.h_start, self.h_end
794 else:
795 h_start, h_end, w_start, w_end = index_infos
796
797 self.im_res[:, :, h_start:h_end, w_start:w_end] += pch_res * self.weight
798 self.pixel_count[:, :, h_start:h_end, w_start:w_end] += self.weight
799
800 def gather(self):
801 assert torch.all(self.pixel_count != 0)

Callers 2

mainFunction · 0.95
mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected