class_docstr: AI-VAD model.
  
  Args:
      box_score_thresh (float): Confidence threshold for region extraction stage.
      persons_only (bool): When enabled, only regions labeled as person are included.
      min_bbox_area (int): Minimum bounding box area. Regions with a surface area lower than this value are excluded.
      max_bbox_overlap (float): Maximum allowed overlap between bounding boxes.
      enable_foreground_detections (bool): Add additional foreground detections based on pixel difference between
          consecutive frames.
      foreground_kernel_size (int): Gaussian kernel size used in foreground detection.
      foreground_binary_threshold (int): Value between 0 and 255 which acts as binary threshold in foreground
          detection.
      n_velocity_bins (int): Number of discrete bins used for velocity histogram features.
      use_velocity_features (bool): Flag indicating if velocity features should be used.
      use_pose_features (bool): Flag indicating if pose features should be used.
      use_deep_features (bool): Flag indicating if deep features should be used.
      n_components_velocity (int): Number of components used by GMM density estimation for velocity features.
      n_neighbors_pose (int): Number of neighbors used in KNN density estimation for pose features.
      n_neighbors_deep (int): Number of neighbors used in KNN density estimation for deep features.
docstr: Forward pass through AI-VAD model.
  
  Args:
      batch (Tensor): Input image of shape (N, L, C, H, W)
  Returns:
      list[Tensor]: List of bbox locations for each image.
      list[Tensor]: List of per-bbox anomaly scores for each image.
      list[Tensor]: List of per-image anomaly scores.
docstr_tok: ["Forward","pass","through","AI-VAD","model",".","Args",":","batch","(","Tensor",")",":","Input","image","of","shape","(","N",",","L",",","C",",","H",",","W",")","Returns",":","list","[","Tensor","]",":","List","of","bbox","locations","for","each","image",".","list","[","Tensor","]",":","List","of","per-bbox","anomaly","scores","for","each","image",".","list","[","Tensor","]",":","List","of","per-image","anomaly","scores","."]
code: def forward(
      self, batch: Tensor
  ) -> tuple[list[Tensor], list[Tensor], list[Tensor]]:
      """Forward pass through AI-VAD model.
  
      Args:
          batch (Tensor): Input image of shape (N, L, C, H, W)
      Returns:
          list[Tensor]: List of bbox locations for each image.
          list[Tensor]: List of per-bbox anomaly scores for each image.
          list[Tensor]: List of per-image anomaly scores.
      """
      self.flow_extractor.eval()
      self.region_extractor.eval()
      self.feature_extractor.eval()
  
      # 1. get first and last frame from clip
      first_frame = batch[:, 0, ...]
      last_frame = batch[:, -1, ...]
  
      # 2. extract flows and regions
      with torch.no_grad():
          flows = self.flow_extractor(first_frame, last_frame)
          regions = self.region_extractor(first_frame, last_frame)
  
      # 3. extract pose, appearance and velocity features
      features_per_batch = self.feature_extractor(
          first_frame, flows, regions
      )
  
      if self.training:
          return features_per_batch
  
      # 4. estimate density
      box_scores = []
      image_scores = []
      for features in features_per_batch:
          box, image = self.density_estimator(features)
          box_scores.append(box)
          image_scores.append(image)
  
      box_locations = [batch_item["boxes"] for batch_item in regions]
      return box_locations, box_scores, image_scores
  
file_path: anomalib/src/anomalib/models/ai_vad/torch_model.py
imports: from __future__ import annotations
  import torch
  from torch import Tensor, nn
  from anomalib.models.ai_vad.density import CombinedDensityEstimator
  from anomalib.models.ai_vad.features import FeatureExtractor
  from anomalib.models.ai_vad.flow import FlowExtractor
  from anomalib.models.ai_vad.regions import RegionExtractor
label_desc: Use image node_id 2 for calling the AiVadModel obj's underlying member method code with example usage: obj.forward(batch) and returns: box_locations,  box_scores,  image_scores, features_per_batch