code: def generate_kNN_utk_to_cc_similarity_gender_analysis(
      utk_cc_input_data, apply_l2_norm=True, k_values=None
  ):
      k_values = k_values or [1, 5, 10, 50]
      print(
          f"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ {utk_cc_input_data['model_name']} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
      )
      (
          test_image_paths,
          test_metadata,
          train_image_paths,
          train_metadata,
          test_features,
          test_img_indices,
          train_features,
          train_img_indices,
      ) = load_labels_images_features_metadata(utk_cc_input_data)
  
      # UTK has gender labels and Race labels , CC has gender labels and skintone scale labels.
      # Only gender is properly aligned for these so we only focus on gender similarity.
      filtered_cc_map, out_test_featues = parse_cc_data(
          test_metadata,
          test_image_paths,
          test_img_indices,
          test_features,
      )
      filtered_utk_map, out_train_features = parse_utk_data(
          train_metadata,
          train_image_paths,
          train_img_indices,
          train_features,
      )
      (
          output_gender_precision_fairness_indicator,
          output_gender_precision_attributes_count_map,
      ) = get_gender_precision_fairness_indicator(
          filtered_utk_map,
          filtered_cc_map,
          out_train_features,
          out_test_featues,
          apply_l2_norm=apply_l2_norm,
          k_values=k_values,
      )
      df = convert_and_print_dataframe(
          output_gender_precision_fairness_indicator,
          utk_cc_input_data["model_name"],
      )
      return df
  
file_path: vissl/projects/fairness_indicators/similarity_search/inference_casual_conversations.py
imports: import numpy
  import pandas
  import torch
  from vissl.utils.io import load_file
label_desc: Use image node_id 9 for calling a global function with example usage: generate_kNN_utk_to_cc_similarity_gender_analysis(utk_cc_input_data, apply_l2_norm, k_values) and returns: df