system_main.py 文件源码

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

项目:VGG_Face_Caffe_Model 作者: PatienceKai 项目源码 文件源码
def compar_pic(path1,path2):
    global net
    #??????
    X=read_image(path1)
    test_num=np.shape(X)[0]
    #X  ?? ?????
    out = net.forward_all(data = X)
    #fc7??????,??????
    feature1 = np.float64(out['fc7'])
    feature1=np.reshape(feature1,(test_num,4096))
    #np.savetxt('feature1.txt', feature1, delimiter=',')

    #??????
    X=read_image(path2)
    #X  ?? ?????
    out = net.forward_all(data=X)
    #fc7??????,??????
    feature2 = np.float64(out['fc7'])
    feature2=np.reshape(feature2,(test_num,4096))
    #np.savetxt('feature2.txt', feature2, delimiter=',')
    #????????cos?,??????????
    predicts=pw.cosine_similarity(feature1, feature2)
    return  predicts
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号