convert.py 文件源码

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

项目:TF-Examples 作者: CharlesShang 项目源码 文件源码
def load_mean_bgr():
    """ bgr mean pixel value image, [0, 255]. [height, width, 3] """
    with open("data/ResNet_mean.binaryproto", mode='rb') as f:
        data = f.read()
    blob = caffe_pb2.BlobProto()
    blob.ParseFromString(data)

    mean_bgr = caffe.io.blobproto_to_array(blob)[0]
    assert mean_bgr.shape == (3, 224, 224)

    return mean_bgr.transpose((1, 2, 0))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号