def get_batch(image, label, batch_size, crop_size):
#??????
distorted_image=tf.image.central_crop(image,33./37.)
distorted_image = tf.random_crop(distorted_image, [crop_size, crop_size, 3])#????,???
# # distorted_image = tf.image.random_flip_up_down(distorted_image)#??????
# distorted_image = tf.image.random_brightness(distorted_image,max_delta=50)#????
# distorted_image = tf.image.random_contrast(distorted_image,lower=0.2, upper=1.8)#?????
#??batch
#shuffle_batch????capacity????shuttle??????????????????batch???capacity?????
#?????????
images, label_batch = tf.train.shuffle_batch([distorted_image, label],batch_size=batch_size,
num_threads=4,capacity=50000,min_after_dequeue=10000)
# ????
#tf.image_summary('images', images)
return images, tf.reshape(label_batch, [batch_size])
#?????????????get_batch??
评论列表
文章目录