code: def get_queries_features(
      cfg,
      temp_dir,
      eval_dataset_name,
      resize_img,
      spatial_levels,
      image_helper,
      eval_dataset,
      model,
      pca,
  ):
      features_queries = []
      num_queries = eval_dataset.get_num_query_images()
  
      num_queries = (
          num_queries
          if cfg.IMG_RETRIEVAL.NUM_QUERY_SAMPLES == -1
          else cfg.IMG_RETRIEVAL.NUM_QUERY_SAMPLES
      )
  
      logging.info(f"Getting features for queries: {num_queries}")
      q_fname_out_dir = None
      if q_fname_out_dir:
          q_fname_out_dir = (
              f"{temp_dir}/{eval_dataset_name}_S{resize_img}_q"
          )
          makedir(q_fname_out_dir)
  
      for idx in range(num_queries):
          if idx % LOG_FREQUENCY == 0:
              logging.info(f"Eval Query: {idx}"),
          q_fname_in = eval_dataset.get_query_filename(idx)
          # Optionally crop the query by the region-of-interest (ROI).
          roi = (
              eval_dataset.get_query_roi(idx)
              if cfg.IMG_RETRIEVAL.CROP_QUERY_ROI
              else None
          )
  
          q_fname_out = None
          if q_fname_out_dir:
              q_fname_out = f"{q_fname_out_dir}/{idx}.npy"
  
          if q_fname_out and g_pathmgr.exists(q_fname_out):
              query_feature = load_file(q_fname_out)
          else:
              query_feature = process_eval_image(
                  cfg,
                  q_fname_in,
                  roi,
                  q_fname_out,
                  spatial_levels,
                  image_helper,
                  model,
                  pca,
                  eval_dataset_name,
                  verbose=(idx == 0),
              )
          features_queries.append(query_feature)
  
      return features_queries
  
imports: import logging
  import os
  import sys
  from argparse import Namespace
  from typing import Any, List
  import numpy
  import torch
  import torchvision
  from classy_vision.generic.util import copy_model_to_gpu, load_checkpoint
  from iopath.common.file_io import g_pathmgr
  from vissl.config import AttrDict
  from vissl.hooks import default_hook_generator
  from vissl.models import build_model
  from vissl.utils.checkpoint import get_checkpoint_folder, init_model_from_consolidated_weights
  from vissl.utils.distributed_launcher import launch_distributed
  from vissl.utils.env import set_env_vars, setup_path_manager
  from vissl.utils.extract_features_utils import ExtractedFeaturesLoader
  from vissl.utils.hydra_config import compose_hydra_configuration, convert_to_attrdict, print_cfg
  from vissl.utils.instance_retrieval_utils.data_util import CopyDaysDataset, GenericInstanceRetrievalDataset, get_average_gem, InstanceRetrievalDataset, InstanceRetrievalImageLoader, InstreDataset, is_copdays_dataset, is_instre_dataset, is_oxford_paris_dataset, is_revisited_dataset, is_whiten_dataset, l2n, MultigrainResize, RevisitedInstanceRetrievalDataset, WhiteningTrainingImageDataset
  from vissl.utils.instance_retrieval_utils.rmac import get_rmac_descriptors
  from vissl.utils.io import load_file, makedir, save_file
  from vissl.utils.logger import setup_logging, shutdown_logging
  from vissl.utils.pca import load_pca, train_and_save_pca
  from vissl.utils.perf_stats import PerfStats, PerfTimer
label_desc: Use image node_id 7 for calling a global function with example usage: get_queries_features(cfg, temp_dir, eval_dataset_name, resize_img, spatial_levels, image_helper, eval_dataset, model, pca) and returns: features_queries