FineTuning.py 文件源码

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

项目:DeepLearning 作者: corecai163 项目源码 文件源码
def deprocess_net_image(image):
    image = image.copy()    # use copy don't modify destructively
    image = image[::-1]     # BGR to RGB
    image = image.transpose(1,2,0) # CHW to HCW
    image += [123,117,104]  # undo mean subtraction

    # clamp values in [0,255]
    image[image < 0], image[image > 255] = 0 , 255

    # round and cast form float32 to uint8
    image = np.round(image)
    image = np.require(image,dtype=np.uint8)

    return image

# Load the 1000 ImageNet labels from 
# ilsvrc12/synset_words.txt, and the 5 style labels from finetune_flickr_style/style_names.txt.

# Load ImageNet labels to imagenet_labels
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号