Comments (2)
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. In contrast, I remove regularization and get the same result as yours. 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.
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. In contrast, I remove regularization and get the same result as yours. 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)
- About the evaluation data for video style transfer HOT 2
- About the metircs of the artistic style transfer. HOT 1
- RuntimeError: Error(s) in loading state_dict for SCT
- 你好,国内无法翻墙,怎么获取vgg_normalised.pth?可以给个网盘连接吗? HOT 6
- What's "coral" the meaning of test.py code line 158? HOT 1
- cannot install channelnorm-cuda HOT 1
- Cannot untar the pretrained model HOT 2
- alpha not used HOT 1
- video
- about pretrained model HOT 1
- Error when loading pretrained SCT HOT 2
- unable to download vgg_normalized.pth HOT 1
- GPU to use HOT 1
- pre-trained models HOT 10
- hi,i want to ask some question HOT 4
- Supplementary file HOT 3
- add web demo/models/datasets to ECCV 2022 organization on Hugging Face
- error for running test.py (it seems that the pretrained sct_iter_160000.pth.tar is wrong for artistic style) HOT 2
- Missing _calc_feat_flatten_mean_std in function.py HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccpl.