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

Method update

scripts/util_image.py:770–783  ·  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

768 return torch.tile(torch.tensor(weights, device=device), (nbatches, 3, 1, 1))
769
770 def update(self, pch_res, index_infos):
771 '''
772 Input:
773 pch_res: n x c x pch_size x pch_size, float
774 index_infos: (h_start, h_end, w_start, w_end)
775 '''
776 if index_infos is None:
777 w_start, w_end = self.w_start, self.w_end
778 h_start, h_end = self.h_start, self.h_end
779 else:
780 h_start, h_end, w_start, w_end = index_infos
781
782 self.im_res[:, :, h_start:h_end, w_start:w_end] += pch_res
783 self.pixel_count[:, :, h_start:h_end, w_start:w_end] += 1
784
785 def update_gaussian(self, pch_res, index_infos):
786 '''

Callers 1

inferenceFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected