code: def encode_images(
      self, images, region_flag=False, region_geo_sampler=False
  ):
      image_features = self.get_model().get_vision_tower()(images)
      projected_image_features = self.get_model().mm_projector(
          image_features
      )
  
      if region_flag:
          if region_geo_sampler:
              new_region_feature_map = image_features
          else:
              new_region_feature_map = (
                  self.get_model().region_fea_adapter(image_features)
              )
      else:
          new_region_feature_map = None
  
      return (
          image_features,
          projected_image_features,
          new_region_feature_map,
      )
  
imports: from abc import ABC, abstractmethod
  import torch
  import torch.nn
  import torch.nn.functional
  import math
  from .multimodal_encoder.builder import build_vision_tower
  import pdb
  from ferret.constants import IGNORE_INDEX, IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_PATCH_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
label_desc: Use image node_id 3 for calling the FERRETMetaForCausalLM obj's underlying member method code with example usage: obj.encode_images(images, region_flag, region_geo_sampler) and returns: image_features,  projected_image_features,  new_region_feature_map