roimehrez / contextualloss Goto Github PK
View Code? Open in Web Editor NEWThe Contextual Loss
Home Page: http://cgm.technion.ac.il/Computer-Graphics-Multimedia/Software/Contextual/
The Contextual Loss
Home Page: http://cgm.technion.ac.il/Computer-Graphics-Multimedia/Software/Contextual/
Hello~
I want to ask if your paper for cat-dog ,female-male and flowers datasets is public.
Could you provide this datasets.
Thank you very much!
hello, I am trying to re-implement your paper Learning to Maintain Natural Image Statistics, when you adopted srgan, did you train the Discriminator Net to get the results or just Generator Net?
Thanks a lot
hello, I am trying to re-implement your paper Learning to Maintain Natural Image Statistics. In Section4.1 Proposed solution ,you said L2 loss is computed at low resolution, but in Equation(9) below, L2 loss is computed between G(s) and y, which are generated images and target images, they are high resolution, which is correct?
@roimehrez Hello, Could you provide the pre-trained model for SR task or release the results of Set5, Set14, B100, PIRM_Val datasets?
is there a pretrained model for puppet control and how to test it out?
In the experiment on the surface normal estimation, the paper mentions the reduction of the features to 65 by 65 through random sampling after extraction of the 5x5 patches. Was this done by sampling 65x65 pixels from the (5x5xn) patches that were extracted?
In utils/helper.py,
def read_image(file_name, resize=True, fliplr=False):
image = np.float32(scipy.misc.imread(file_name))
if resize:
image = scipy.misc.imresize(image, size=config.TRAIN.resize, interp='bilinear', mode=None)
if fliplr:
image = np.fliplr(image)
return np.expand_dims(image, axis=0)
Given image in np.float32, it will automatically rescale the image. For example:
>>> b
array([[ 1., 2.],
[ 3., 4.]], dtype=float32)
>>> scipy.misc.imresize(b,(4,4))
array([[ 0, 21, 64, 85],
[ 43, 64, 107, 128],
[128, 149, 192, 213],
[170, 191, 234, 255]], dtype=uint8)
If the image is in the type uint8, then the behavior is expected:
>>> c
array([[1, 2],
[3, 4]], dtype=uint8)
>>> scipy.misc.imresize(c,(4,4))
array([[1, 1, 2, 2],
[2, 2, 3, 3],
[3, 3, 4, 4],
[3, 3, 4, 4]], dtype=uint8)
You can use cv2.resize to avoid auto rescaling.
hello, I am working on SISR recently and I am trying to combine different loss function together, such as L1 loss, perceptural loss and contextual loss, I wanna know what is the value of contextual loss, just the magnitude. because ,what I calculate is that the contextual loss is very very small,I donot know wheather it works
Hope your resopnse, thank you so much
I am trying to use the pretrained model for quick start. But it is producing some results which I don't think are correct.
As far as I understand, the provided pre trained model is to warp trump animation to some target images.
So it should be like the one in Fig 1 (left) in https://arxiv.org/pdf/1803.02077.pdf
I really appreciate you that you can give me some hints if there is something wrong I've done.
Thanks for sharing your code. Id like to use contextual losses in neural style code to reproduce fig 7 of "The Contextual Loss for Image Transformation with Non-Aligned Data" paper.
I'm wondering if you have used the default parameters of the neural style, such as learning rate, weights, #iters this line:
CONTENT_WEIGHT = 5e0
CONTENT_WEIGHT_BLEND = 1
STYLE_WEIGHT = 5e2
TV_WEIGHT = 1e2
STYLE_LAYER_WEIGHT_EXP = 1
LEARNING_RATE = 1e1
BETA1 = 0.9
BETA2 = 0.999
EPSILON = 1e-08
STYLE_SCALE = 1.0
ITERATIONS = 1000
VGG_PATH = 'imagenet-vgg-verydeep-19.mat'
POOLING = 'max'
Dear authors,
Thanks for your excellent work!
Which layers' features should I use for contextual loss? Do you have any empirical suggestions?
Thanks in advance and have a nice day~
Best,
Shuyue
June 19, 2022
in the paper "The Contextual Loss for Image Transformation with Non-Aligned Data", x_i and y_j need to reduce the mean of the sum of y_j to compute cosine_distance, but i didn't find this operation in either create_using_L2 or create_using_dotP
请问使用这个代码是否可以实现semantic style transfer,如果可以的话要如何使用呢?
I am confused with the code "A = Tvec @ tf.transpose(Ivec)" in CSFlow.py . What does @ mean and what does the code do ?
Hello, I was looking for your implementation for L2 on LF images. could you show me where is it please ?
Hi I really like the paper. One question is that in your super-resolution paper you optimize the contextual loss with conv3_4 features. How about directly minimizing the perceptual loss for the conv3_4 features? What's the visual difference. Thanks!
Is it possible to provide the code for unpaired domain transfer (Fig. 11). In each iteration, do you minimize the loss between a random input and a random style image?
Sorry to disturb you , but is CX for pytorch 0.4.0 or 1.1.0?
Hi, I'm trying to run the script single_image_animation.py following your instructions.
However, the results are not good. I put the models and image results in https://drive.google.com/open?id=1fWtUtbiE4NxibnYd1gEReh5UaDDZqtYQ
I try to test with the provided model. It seems good.
My configuration is ubuntu16, tensorflow(1.2), cuda(8.0), cudnn(5.1).
Can you help me on the retraining? Thanks.
Hi, thanks for your code. I am pretty interested in the comparison between the contextual loss and the nearest neighbor search in the feature domain. The contextual loss is defined in a heuristic manner. If I understand correctly, nearest neighbor search is equivalent to minimizing the KL-divergence. Why in the paper the contextual loss always gives less artifact? Is there any intuitive explanation for this?
Thanks a lot!
Dear, thanks for the awesome work!
In the file CSFlow.py, i'm confused with the code 'A = Tvec @ tf.transpose(Ivec)' (Line 44), what dose '@' mean?
The paper proposes to use the Cosine distance when computing the distance d_{ij} in Equ. 2, which is computed by the function 'create_using_dotP'. I noticed there is another function 'create_using_L2' in 'CSFlow.py'. I am somewhat confused about it. I would be very appreciated if you could explain it.
Thank you!
Hi, I try to use your pytorch version contextual loss for style transfer. Both the content and style use contextual loss. But the result seems not meaningful. The pytorch code use L2 distance which is different from the paper (cosine distance). I wonder whether I need to normalize the features before feeding them into the contextual loss. Is there any suggestion for my failure on style transfer? Thanks a lot!
what is "123.6800, 116.7790, 103.9390" and could you tell me how did you get this data?
when I run the code in the ubuntu with python3 tensorflow_gpu1.3 there are some errors in the CSFlow.py line 111and line 44, because the ":" and the "@" in the code .I do not know why ?but when I run the code using windows there will be no errors?
Line 37 in 775546b
Dear,
sorry for bothering.
I am trying to train for Single image Animation with the code you provided, but the results I tested were strange.
This is the result of 10 epoch, but i can't get the same effect as you. the generated image looks a lot like the original image, such as appearance and glasses.
Can you give me some advice? thank you a lot!
Hi
Is it possible to train the network with original VGG input size 224*224
Thanks
Hello,
I can not download the pre-trained model and data for the example for this repository, can anyone email me. Thank you very much.
ps: [email protected]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.