code: def get_duplicates(
      im_paths, method="cnn", encodings=None, deduper=None, **kwargs
  ):
      from imagededup.methods import PHash, CNN
  
      if encodings is None:
          encodings, deduper = get_encodings(im_paths, method)
      if method == "cnn":
          deduper = deduper or CNN()
          assert isinstance(deduper, CNN)
          thresh = "min_similarity_threshold"
          if thresh not in kwargs:
              kwargs[thresh] = 0.9
      elif method == "phash":
          deduper = deduper or PHash()
          assert isinstance(deduper, PHash)
          thresh = "max_distance_threshold"
          if thresh not in kwargs:
              kwargs[thresh] = 10
      else:
          raise ValueError(f"Method {method} unknown")
      duplicates = deduper.find_duplicates(
          encoding_map=encodings, scores=True, **kwargs
      )
      return duplicates, 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 9 for calling a global function with example usage: get_duplicates(im_paths, method, encodings, deduper) and returns: duplicates,  encodings,  deduper