image_processing.py 文件源码

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

项目:TAC-GAN 作者: dashayushman 项目源码 文件源码
def load_image_inception(image_file, image_size=128):
    img = skimage.io.imread(image_file)
    # GRAYSCALE
    if len(img.shape) == 2:
        img_new = np.ndarray((img.shape[0], img.shape[1], 3), dtype='uint8')
        img_new[:, :, 0] = img
        img_new[:, :, 1] = img
        img_new[:, :, 2] = img
        img = img_new

    if image_size != 0:
        img = skimage.transform.resize(img, (image_size, image_size), mode='reflect')

    return img.astype('int32')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号