features.py 文件源码

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

项目:uhcsdb 作者: bdecost 项目源码 文件源码
def build_search_tree(datadir, featurename='vgg16_block5_conv3-vlad-64.h5'):

    ndim = 64
    features_file = os.path.join(datadir, featurename)
    print(features_file)

    global keys, features
    keys, features = load_features(features_file)

    print('reducing features')
    pca = PCA(n_components=ndim)
    features = pca.fit_transform(features)
    print('ready')

    print('building search tree')
    nn = NearestNeighbors()

    global nneighs
    nneighs = nn.fit(features)
    print('ready')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号