data_input.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:cnn_picture_gazebo 作者: liuyandong1988 项目源码 文件源码
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??
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号