Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Image normalization before feeding to the backbone model] #3

Open
shubhamkriitr opened this issue Dec 19, 2023 · 0 comments
Open

[Image normalization before feeding to the backbone model] #3

shubhamkriitr opened this issue Dec 19, 2023 · 0 comments

Comments

@shubhamkriitr
Copy link

shubhamkriitr commented Dec 19, 2023

Hi, in the following snippet the image (x) is being passed as is. However, the base model would expect normalized image. The image was not normalized elsewhere in the code. Is it supposed to be like this?

class RESNET_pre(nn.Module):
  def __init__(self):
      super(RESNET_pre, self).__init__()

      self.features = models.resnet18(pretrained=True)


  def forward(self, x):
      x = torch.unsqueeze(x, dim =0)
      x= self.features(x)
      x=nn.Sigmoid()(x)

      return x #output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant