You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, regarding Figure 2, you can add an output during the network's forward process to access the feature maps for visualization.
please consider the following pseudo code (especially at "")
def forward_features(self, x):
x_size = (x.shape[2], x.shape[3])
x = self.patch_embed(x)
if self.ape:
x = x + self.absolute_pos_embed
x = self.pos_drop(x)
**feature_map = ""**
for layer in self.layers:
x = layer(x, x_size)
**if layer == 2:**
**feature_map = x**
x = self.norm(x) # b seq_len c
x = self.patch_unembed(x, x_size)
return x, feature_map
def forward(self, x):
self.mean = self.mean.type_as(x)
x = (x - self.mean) * self.img_range
if self.upsampler == 'pixelshuffle':
# for classical SR
x = self.conv_first(x)
**y, feature_map = (self.forward_features(x)**
** x= self.conv_after_body(y) + x**
x = self.conv_before_upsample(x)
x = self.conv_last(self.upsample(x))
x = x / self.img_range + self.mean
return x**, feature_map**
Thank you for your excellent works. Could you please tell me how Figure 2 was drawn? I would be grateful!
The text was updated successfully, but these errors were encountered: