1 回答
TA贡献1860条经验 获得超9个赞
经过进一步的研究,我能够通过改变来管理:
images = list(image)
extracted_patches = tf.image.extract_patches(images=images,
sizes=[1,int(0.25*image_height),int(0.25*image_width),3],
strides=[1,int(0.25*image_height),int(0.25*image_width),3],
rates=[1,1,1,1],
padding="SAME")
到 :
image = tf.expand_dims(image ,0)
extracted_patches = tf.image.extract_patches(images=image,
sizes=[1,int(0.25*image_height),int(0.25*image_width),1],
strides=[1,int(0.25*image_height),int(0.25*image_width),1],
rates=[1,1,1,1],
padding="SAME")
然后重塑以获得3通道图像:
patches = tf.reshape(extracted_patches,[-1,int(0.25*image_height),int(0.25*image_width),3])
添加回答
举报