![]() Which is what tensorflow will uses gracefully. Then use the squeeze function to remove to unnecessary final dimension like so: If you are looking to process a 3D image and have batches of them in this configuration Here we want to resize the 3-d image to dimensions of (50,60,70)Ī tensor is already 4D, with 1D allocated to 'batch_size' and the other 3D allocated for width, height, depth. Where x will be the 3-d tensor either grayscale or RGB resized_along_width is the final resized tensor. Resized_along_width = resize_by_axis(resized_along_depth,50,70,1,True) Resized_along_depth = resize_by_axis(x,50,60,2, True) Stack_img = tf.stack(resized_list, axis=ax) Unstack_img_depth_list = tf.unstack(image, axis = ax) Stack_img = tf.squeeze(tf.stack(resized_list, axis=ax)) Resized_list.append(tf.image.resize_images(i, ,method=0)) My approach to this would be to resize the image along two axis, in the code I paste below, I resample along depth and then width def resize_by_axis(image, dim_1, dim_2, ax, is_grayscale):
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |