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

Normalization twice in Clipper #10

Open
lzy00codeforfun opened this issue Oct 17, 2022 · 1 comment
Open

Normalization twice in Clipper #10

lzy00codeforfun opened this issue Oct 17, 2022 · 1 comment

Comments

@lzy00codeforfun
Copy link

Hi,

Here in the Clipper, before encoding the image, the code seems normalize the latent twice. Is this correct?

def embed_image(self, image): ` 
        """Expects images in -1 to 1 range""" 
        clip_in = F.interpolate(image, self.clip_size, mode="area")
        clip_in = self.normalize(0.5*clip_in + 0.5).clamp(0,1)
        return self.clip.encode_image(self.normalize(clip_in))
@justinpinkney
Copy link
Owner

Oh you're right, that looks like a minor bug. Thanks for spotting will update in a bit.

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

2 participants