Code Monkey home page Code Monkey logo

contextualloss's People

Contributors

roimehrez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

contextualloss's Issues

datasets

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!

A question about contextual loss usage in super-resolution

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?

puppet control

is there a pretrained model for puppet control and how to test it out?

Question about Normal Estimation

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?

There seems a bug in helper.py

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.

contextual loss for Single image super resolution

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

sample test issue

I am trying to use the pretrained model for quick start. But it is producing some results which I don't think are correct.
00010_out
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.

Semantic style transfer

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'

some confusions about computing cosine_distance in code

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

请问使用这个代码是否可以实现semantic style transfer,如果可以的话要如何使用呢?

Confusion

I am confused with the code "A = Tvec @ tf.transpose(Ivec)" in CSFlow.py . What does @ mean and what does the code do ?

Comparison of contextual loss and perceptual loss

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!

Code for Unpaired domain transfer

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?

Pytorch version

Sorry to disturb you , but is CX for pytorch 0.4.0 or 1.1.0?

Comparison with nearest neighbor search

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!

Questions about the code in CSFlow.py

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!

Optimization result

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!

11144Some run errors?

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?

train issue

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.
image
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!

Input size

Hi
Is it possible to train the network with original VGG input size 224*224
Thanks

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.