data_helpers.py 文件源码

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

项目:leaf-classification 作者: MWransky 项目源码 文件源码
def augment_data(images, labels):
    more_images = np.zeros((8*images.shape[0], images.shape[1], images.shape[2],))
    more_labels = np.zeros((8*labels.shape[0]))
    for i in range(labels.shape[0]):
        for j in range(8):
            rotation = j*90
            more_images[8*i+j] = ndimage.rotate(images[i], rotation)
            more_labels[8*i+j] = labels[i]
    return shuffle(more_images, more_labels)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号