matsui528/rii

Examples of applications

matsui528 opened this issue · 1 comments

Some examples of application.

For example meta-data search by pandas and feature search by Rii (Fig. 5 in the paper):

import pandas as pd
import rii
# Read data
df = pd.read_csv('metadata.csv')
engine = pkl.load(open('rii_densenet.pkl', 'rb'))
# Metadata search
S = df[(df['data']<500) & (df['country']=='Egypt')]['ID']
S = np.sort(np.array(S)) # Target identifiers
# ANN for subset
q = # Read query feature
result = engine.query(q=q, target_ids=S, topk=3)

A simple demo is added in #12