class_docstr: How2 Video Retriver.
  Reference usage of FAISS:
  https://github.com/fairinternal/fairseq-py/blob/paraphrase_pretraining/fairseq/data/multilingual_faiss_dataset.py
class_docstr_tok: ["How2","Video","Retriver",".","Reference","usage","of","FAISS",":","https",":","\/\/github.com\/fairinternal\/fairseq-py\/blob\/paraphrase_pretraining\/fairseq\/data\/multilingual_faiss_dataset.py"]
code: def __init__(
      self, hidden_size, cent, db_type, examples_per_cent_to_train
  ):
      if db_type == "flatl2":
          quantizer = faiss.IndexFlatL2(hidden_size)  # the other index
          self.db = faiss.IndexIVFFlat(
              quantizer, hidden_size, cent, faiss.METRIC_L2
          )
      elif db_type == "pq":
          self.db = faiss.index_factory(
              hidden_size, f"IVF{cent}_HNSW32,PQ32"
          )
      else:
          raise ValueError("unknown type of db", db_type)
      self.train_thres = cent * examples_per_cent_to_train
      self.train_cache = []
      self.train_len = 0
      self.videoid_to_vectoridx = {}
      self.vectoridx_to_videoid = None
      self.make_direct_maps_done = False
  
imports: import os
  import numpy
  import pickle
  import time
  from collections import defaultdict
  from ..utils import get_local_rank, print_on_rank0
label_desc: Use image node_id 1 to create a new VectorRetriever object from inherited base classes: object with example: obj = VectorRetriever(hidden_size, cent, db_type, examples_per_cent_to_train)