b078a27def328cfc16dc7ab17f2537b8593544f1,models/shift_net/shiftnet_model.py,ShiftNetModel,set_input,#ShiftNetModel#,114
Before Change
// For masking inputs with offline random masks.
if not self.opt.isTrain and self.opt.offline_testing:
self.mask_global = Image.open(os.path.join("masks", os.path.splitext(os.path.basename(self.image_paths[0]) )[0]+"_mask.png"))
self.mask_global = transforms.ToTensor()(self.mask_global).unsqueeze(0).type_as(real_A).byte()
After Change
self.mask_global = self.mask_global.narrow(0,0,1).narrow(1,0,1)
// create mask online
if not self.opt.offline_loading_mask:
if self.opt.mask_type == "center":
self.mask_global.zero_()
self.mask_global[:, :, int(self.opt.fineSize/4) + self.opt.overlap : int(self.opt.fineSize/2) + int(self.opt.fineSize/4) - self.opt.overlap,\
int(self.opt.fineSize/4) + self.opt.overlap: int(self.opt.fineSize/2) + int(self.opt.fineSize/4) - self.opt.overlap] = 1
self.rand_t, self.rand_l = int(self.opt.fineSize/4) + self.opt.overlap, int(self.opt.fineSize/4) + self.opt.overlap
elif self.opt.mask_type == "random":
self.mask_global = self.create_random_mask().type_as(self.mask_global).view_as(self.mask_global)
else:
raise ValueError("Mask_type [%s] not recognized." % self.opt.mask_type)
// For loading mask offline, we also need to change "opt.mask_type" and "opt.mask_sub_type"
// to avoid forgetting such settings.
else:
self.opt.mask_type = "random"
self.opt.mask_sub_type = "island"
self.set_latent_mask(self.mask_global)
real_A.narrow(1,0,1).masked_fill_(self.mask_global, 0.)/ǘ*123.0/255.0 - 1.0
real_A.narrow(1,1,1).masked_fill_(self.mask_global, 0.)/ǘ*104.0/255.0 - 1.0
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: Zhaoyi-Yan/Shift-Net_pytorch
Commit Name: b078a27def328cfc16dc7ab17f2537b8593544f1
Time: 2019-04-27
Author: yanzhaoyi@outlook.com
File Name: models/shift_net/shiftnet_model.py
Class Name: ShiftNetModel
Method Name: set_input
Project Name: pyinstaller/pyinstaller
Commit Name: 09a68eb00215859005835514a5d04b01f936ed1d
Time: 2020-10-18
Author: h.goebel@crazy-compilers.com
File Name: PyInstaller/depend/analysis.py
Class Name: PyiModuleGraph
Method Name: _make_toc
Project Name: pyinstaller/pyinstaller
Commit Name: 7b4edb7daa687534aa9a35eac467fe2933dbc364
Time: 2018-03-12
Author: nicholsonc@google.com
File Name: PyInstaller/hooks/hook-usb.py
Class Name:
Method Name: