code: def get_encodings(im_paths, method="cnn"):
      import imagededup.utils.data_generator as data_generator
      from imagededup.methods import PHash, CNN
  
      if method == "cnn":
          data_generator.DataGenerator = get_data_gen(im_paths)
          deduper = CNN()
          encodings = deduper.encode_images("/")
      elif method == "phash":
          deduper = PHash()
          encodings = run_parallel(deduper, im_paths)
      else:
          raise ValueError(f"Method {method} unknown")
      return encodings, deduper
  
file_path: gluon-cv/gluoncv/torch/data/gluoncv_motion_dataset/ingestion/duplicate_remover.py
imports: import logging
  from pathlib import Path, PosixPath
  from collections import defaultdict
  import tqdm
  from ..dataset import GluonCVMotionDataset, get_vis_thumb_location
  from ..utils.ingestion_utils import get_chunked_id_map
label_desc: Use image node_id 8 for calling a global function with example usage: get_encodings(im_paths, method) and returns: encodings,  deduper