class_docstr: Deep feature extractor.
  
  Extracts the deep (appearance) features from the input regions.
docstr: Extract deep features using CLIP encoder.
  
  Args:
      batch (Tensor): Batch of RGB input images of shape (N, 3, H, W)
      boxes (Tensor): Bounding box coordinates of shaspe (M, 5). First column indicates batch index of the bbox.
      batch_size (int): Number of images in the batch.
  
  Returns:
      Tensor: Deep feature tensor of shape (M, 512)
docstr_tok: ["Extract","deep","features","using","CLIP","encoder",".","Args",":","batch","(","Tensor",")",":","Batch","of","RGB","input","images","of","shape","(","N",",","3",",","H",",","W",")","boxes","(","Tensor",")",":","Bounding","box","coordinates","of","shaspe","(","M",",","5",")",".","First","column","indicates","batch","index","of","the","bbox",".","batch_size","(","int",")",":","Number","of","images","in","the","batch",".","Returns",":","Tensor",":","Deep","feature","tensor","of","shape","(","M",",","512",")"]
code: def forward(
      self, batch: Tensor, boxes: Tensor, batch_size: int
  ) -> Tensor:
      """Extract deep features using CLIP encoder.
  
      Args:
          batch (Tensor): Batch of RGB input images of shape (N, 3, H, W)
          boxes (Tensor): Bounding box coordinates of shaspe (M, 5). First column indicates batch index of the bbox.
          batch_size (int): Number of images in the batch.
  
      Returns:
          Tensor: Deep feature tensor of shape (M, 512)
      """
      rgb_regions = roi_align(batch, boxes, output_size=[224, 224])
  
      features = []
      batched_regions = torch.split(rgb_regions, batch_size)
      with torch.no_grad():
          features = torch.vstack(
              [
                  self.encoder.encode_image(self.transform(batch))
                  for batch in batched_regions
              ]
          )
  
      return features
  
imports: from __future__ import annotations
  from enum import Enum
  import torch
  from torch import Tensor, nn
  from torchvision.models.detection import KeypointRCNN_ResNet50_FPN_Weights, keypointrcnn_resnet50_fpn
  from torchvision.models.detection.roi_heads import keypointrcnn_inference
  from torchvision.ops import roi_align
  from torchvision.transforms import Normalize
  from anomalib.models.ai_vad.clip import clip
label_desc: Use image node_id 2 for calling the DeepExtractor obj's underlying member method code with example usage: obj.forward(batch, boxes, batch_size) and returns: features