Giter VIP home page Giter VIP logo

Comments (2)

JarrentWu1031 avatar JarrentWu1031 commented on May 27, 2024

Hi, thank you for your greate work! I find that your code was not normalized with the pre trained ImageNet value, as shown in the title. So I add this to the code, but when I use the trained weight to test, the performance is not good. brad_pitt_stylized_in2 In contrast, I remove regularization and get the same result as yours. brad_pitt_stylized_in2 So why this difference? Can you tell me the reason? thank you!

Hello, Zhang! Thanks for your appreciation. Our code is based on the pytorch implementation of the AdaIN paper. As you can see in issue 13, the original implementation does not involve input normalization, too. I guess it might not be necessary to pre-normalize the input images in stylization tasks. You could try to add pre-normalization during and see how it works in the inference stage.

from ccpl.

zhangquanwei962 avatar zhangquanwei962 commented on May 27, 2024

Hi, thank you for your greate work! I find that your code was not normalized with the pre trained ImageNet value, as shown in the title. So I add this to the code, but when I use the trained weight to test, the performance is not good. brad_pitt_stylized_in2 In contrast, I remove regularization and get the same result as yours. brad_pitt_stylized_in2 So why this difference? Can you tell me the reason? thank you!

Hello, Zhang! Thanks for your appreciation. Our code is based on the pytorch implementation of the AdaIN paper. As you can see in issue 13, the original implementation does not involve input normalization, too. I guess it might not be necessary to pre-normalize the input images in stylization tasks. You could try to add pre-normalization during and see how it works in the inference stage.

Thank you for your reply. I guess that I have found why the difference occuried.
def denormalzation(tensor, device): mean = torch.tensor([0.485, 0.456, 0.406]).reshape(-1, 1, 1).to(device) std = torch.tensor([0.229, 0.224, 0.225]).reshape(-1, 1, 1).to(device) tensor = torch.clamp(tensor * std + mean, 0, 1) return tensor
I made a mistake that I used the torch.clamp(tensor * mean + std). Thank you again. It's really not necessary. I will verify the modified results.

from ccpl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.