convolution

Vectorizing 2D Convolutions in NumPy

Vectorizing 2D Convolutions in NumPy Question: I know there are various optimized off-the-shelf functions available for performing 2D convolutions, but just for the sake of understanding, I am trying to implement my own 2D convolution function. The following is what I done as of now: convoluted = [] # TODO: Vectorize for i in range(0, …

Total answers: 2

Strided convolution of 2D in numpy

Strided convolution of 2D in numpy Question: I tried to implement strided convolution of a 2D array using for loop i.e arr = np.array([[2,3,7,4,6,2,9], [6,6,9,8,7,4,3], [3,4,8,3,8,9,7], [7,8,3,6,6,3,4], [4,2,1,8,3,4,6], [3,2,4,1,9,8,3], [0,1,3,9,2,1,4]]) arr2 = np.array([[3,4,4], [1,0,2], [-1,0,3]]) def stride_conv(arr1,arr2,s,p): beg = 0 end = arr2.shape[0] final = [] for i in range(0,arr1.shape[0]-1,s): k = [] for j …

Total answers: 6

Face comparison (Not recognition or detection) using OpenCV and Keras?

Face comparison (Not recognition or detection) using OpenCV and Keras? Question: First of all here is my github link for the question. And here is my question: I would like to do a face comparison function using Python. And I can successfully(?) recognize faces using OpenCV. Now, how do I do the comparison thing? What …

Total answers: 4

Convolve2d just by using Numpy

Convolve2d just by using Numpy Question: I am studying image-processing using Numpy and facing a problem with filtering with convolution. I would like to convolve a gray-scale image. (convolve a 2d Array with a smaller 2d Array) Does anyone have an idea to refine my method ? I know that scipy supports convolve2d but I …

Total answers: 4

Tensorflow Strides Argument

Tensorflow Strides Argument Question: I am trying to understand the strides argument in tf.nn.avg_pool, tf.nn.max_pool, tf.nn.conv2d. The documentation repeatedly says strides: A list of ints that has length >= 4. The stride of the sliding window for each dimension of the input tensor. My questions are: What do each of the 4+ integers represent? Why …

Total answers: 4