summaryrefslogtreecommitdiff
path: root/megapixels/commands/faiss/build_faiss.py
blob: fc6b37ce490869f4d836da46669820af4cee0e02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
Index all of the FAISS datasets
"""

import os
import glob
import click
import faiss
import time
import numpy as np

from app.utils.file_utils import load_recipe, load_csv_safe
from app.settings import app_cfg as cfg
from app.processors.faiss import build_all_faiss_databases

@click.command()
@click.pass_context
def cli(ctx):
  """build the FAISS index.
    - looks for all datasets in faiss/metadata/
    - uses the recipe above by default
    - however you can override this by adding a new recipe in faiss/recipes/{name}.json
  """
  build_all_faiss_databases()