Open AlphaDragon009 opened 4 years ago
Nobody is interesting in this question ? or it is too simple to not want to answer ?
BTW: does anybody help me to change the code to 1 channel ? thanks !
class MeanShift(nn.Conv2d):
def init(
self, rgb_range,
rgb_mean=(0.4488, 0.4371, 0.4040), rgb_std=(1.0, 1.0, 1.0), sign=-1):
super(MeanShift, self).__init__(3, 3, kernel_size=1)
std = torch.Tensor(rgb_std)
self.weight.data = torch.eye(3).view(3, 3, 1, 1) / std.view(3, 1, 1, 1)
self.bias.data = sign * rgb_range * torch.Tensor(rgb_mean) / std
for p in self.parameters():
p.requires_grad = False
I trained my model using gray data by
We also need to modify or remove the MeanShift class in common.py.
I have removed it for now for my low-spec proof-of-concept project, but it should be easy enough to transform the function to work for 1 channel.
How can we use it to deal with gray or 1 channel data ? How many places I need to modified? Thanks !