g
e
n
r
e
t
.
p
y
gen_ret.py
genret.py
import argparse
import os
import pickle
import numpy as np
from pyretri.config import get_defaults_cfg, setup_cfg
from pyretri.index import build_index_helper, feature_loader
from pyretri.evaluate import build_evaluate_helper
cfg = get_defaults_cfg()
cfg = setup_cfg(cfg, 'configs/caltech.yaml', [])
print('load begin!')
query_fea_dir = '/data/features/caltech/query'
gallery_fea_dir = '/data/features/caltech/gallery'
query_fea, query_info, _ = feature_loader.load(query_fea_dir, cfg.index.feature_names)
gallery_fea, gallery_info, _ = feature_loader.load(gallery_fea_dir, cfg.index.feature_names)
print('load done!')
index_helper = build_index_helper(cfg.index)
index_result_info, query_fea, gallery_fea = index_helper.do_index(query_fea, query_info, gallery_fea)
np.save('/data/nextcloud/dbc2017/files/jupyter/PyRetri/index_result_info_finetune.npy',np.array(index_result_info))
print('Compute done!')