You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the stacking, convolution happens between an image of [B, H, W, 3] and kernels of [1, 3, 3, 3]. Note that both operands have 3 channels. And the default mode of ndimage.convolve is 'reflect'. Reflect is weird as detailed in this link, and would behave like this when both operands have 3 elements on some dimension (use 1d array for illustration):
ndimage.convolve([1, 2, 3], [1, 1, 1]) ==array([4, 6, 8])
# if 3 channels are convoluted against 3 channelsndimage.convolve([R, G, B], [1, 1, 1]) ==array([R+R+G, R+G+B, G+B+B])
# [B, G, R | R, G, B | B, G, R]# ^ [1, 1, 1]
This is not doing edge detection consistently over all channels, or over each channel. It is a weird combination that involves things like [R+R+G].
Proposal
If I understand it correctly, it would make more sense if we adopt one of these:
im1=ndimage.convolve(im, np.expand_dims(np.stack([tf1]*3, axis=-1), axis=0), mode='wrap') # wrap as [r,b,g,r,g,b] seqeuence
edge detection on luminance
More
This seems to be happening for TF operations as well. May change padding='SAME' to 'VALID'. It is very unlikely that this would affect training though.
Problem
Gaze-Shift-Net/operations_np.py
Line 106 in a727f63
With the stacking, convolution happens between an image of
[B, H, W, 3]
and kernels of[1, 3, 3, 3]
. Note that both operands have 3 channels. And the default mode ofndimage.convolve
is 'reflect'. Reflect is weird as detailed in this link, and would behave like this when both operands have 3 elements on some dimension (use 1d array for illustration):This is not doing edge detection consistently over all channels, or over each channel. It is a weird combination that involves things like [R+R+G].
Proposal
If I understand it correctly, it would make more sense if we adopt one of these:
More
This seems to be happening for TF operations as well. May change
padding='SAME'
to'VALID'
. It is very unlikely that this would affect training though.Gaze-Shift-Net/operations.py
Line 308 in a727f63
The text was updated successfully, but these errors were encountered: