awentzonline / image-analogies

Generate image analogies using neural matching and blending.
MIT License
3.53k stars 283 forks source link

Flip the filter for finding matched patch #36

Open Huihui94 opened 7 years ago

Huihui94 commented 7 years ago

In the patches.py file, there is a method called find_patch_matches. I wonder to know why the third and forth dimension of b should be changed to b[:, :, ::-1, ::-1] if convs is None: convs = K.conv2d(a, b[:, :, ::-1, ::-1], border_mode='valid') Thank you so much!

gjpicker commented 6 years ago

the filter_flip=True is the default param of conv2d ,which belong to theano.sandbox.cuda.dnn.dnn_conv or theano.tensor.nnet that is latest update to replace dnn

so , conv2d(input,b[:, :, ::-1, ::-1]) is equal to conv2d(input,b,filter_flip=False) where filter_flip is explictly defined to False in func's param .

otherwise ,filter_flip is explained in this_link