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

Method update

scripts/util_image.py:667–680  ·  view source on GitHub ↗

Input: pch_res: pch_size x pch_size x 3, [0,1] index_infos: (h_start, h_end, w_start, w_end)

(self, pch_res, index_infos)

Source from the content-addressed store, hash-verified

665 return pch, (h_start, h_end, w_start, w_end)
666
667 def update(self, pch_res, index_infos):
668 '''
669 Input:
670 pch_res: pch_size x pch_size x 3, [0,1]
671 index_infos: (h_start, h_end, w_start, w_end)
672 '''
673 if index_infos is None:
674 w_start, w_end = self.w_start, self.w_end
675 h_start, h_end = self.h_start, self.h_end
676 else:
677 h_start, h_end, w_start, w_end = index_infos
678
679 self.im_res[h_start:h_end, w_start:w_end] += pch_res
680 self.pixel_count[h_start:h_end, w_start:w_end] += 1
681
682 def gather(self):
683 assert np.all(self.pixel_count != 0)

Callers 15

main.pyFile · 0.45
train_pipelineFunction · 0.45
save_response_contentFunction · 0.45
callbackFunction · 0.45
make_lmdb_from_imgsFunction · 0.45
dist_validationMethod · 0.45
nondist_validationMethod · 0.45
dist_validationMethod · 0.45
nondist_validationMethod · 0.45
__init__Method · 0.45
p_lossesMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected