bbbc006_input.py 文件源码

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

项目:dcan-tensorflow 作者: lisjin 项目源码 文件源码
def get_read_input(eval_data=False):
    """
    Fetch input data row by row from CSV files.
    Args:
        eval_data: Bool representing whether to read from train or test directories.
    Returns:
        read_input: An object representing a single example.
        reshaped_image: Image of type tf.float32, reshaped to correct dimensions.
    """
    # Create queues that produce the filenames and labels to read.
    pref = 'test' if eval_data else 'train'
    all_files_queue = tf.train.string_input_producer([pref + '.csv'])

    # Read examples from files in the filename queue.
    read_input = read_bbbc006(all_files_queue)
    reshaped_image = tf.cast(read_input.uint8image, tf.float32)
    read_input.label = tf.cast(read_input.label, tf.int32)

    return read_input, reshaped_image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号