class_docstr: ShanghaiTech Dataset class.
  
  Args:
      task (TaskType): Task type, 'classification', 'detection' or 'segmentation'
      root (Path | str): Path to the root of the dataset
      scene (int): Index of the dataset scene (category) in range [1, 13]
      transform (A.Compose): Albumentations Compose object describing the transforms that are applied to the inputs.
      split (Split): Split of the dataset, usually Split.TRAIN or Split.TEST
      clip_length_in_frames (int, optional): Number of video frames in each clip.
      frames_between_clips (int, optional): Number of frames between each consecutive video clip.
      target_frame (VideoTargetFrame): Specifies the target frame in the video clip, used for ground truth retrieval
class_docstr_tok: ["ShanghaiTech","Dataset","class",".","Args",":","task","(","TaskType",")",":","Task","type",",","'classification","'",",","'detection","'","or","'segmentation'","root","(","Path","|","str",")",":","Path","to","the","root","of","the","dataset","scene","(","int",")",":","Index","of","the","dataset","scene","(","category",")","in","range","[","1",",","13","]","transform","(","A.Compose",")",":","Albumentations","Compose","object","describing","the","transforms","that","are","applied","to","the","inputs",".","split","(","Split",")",":","Split","of","the","dataset",",","usually","Split.TRAIN","or","Split.TEST","clip_length_in_frames","(","int",",","optional",")",":","Number","of","video","frames","in","each","clip",".","frames_between_clips","(","int",",","optional",")",":","Number","of","frames","between","each","consecutive","video","clip",".","target_frame","(","VideoTargetFrame",")",":","Specifies","the","target","frame","in","the","video","clip",",","used","for","ground","truth","retrieval"]
code: def __init__(
      self,
      task: TaskType,
      root: Path | str,
      scene: int,
      transform: A.Compose,
      split: Split,
      clip_length_in_frames: int = 1,
      frames_between_clips: int = 1,
      target_frame: VideoTargetFrame = VideoTargetFrame.LAST,
  ):
      super().__init__(
          task,
          transform,
          clip_length_in_frames,
          frames_between_clips,
          target_frame,
      )
  
      self.root = root
      self.scene = scene
      self.split = split
      self.indexer_cls = (
          ShanghaiTechTrainClipsIndexer
          if self.split == Split.TRAIN
          else ShanghaiTechTestClipsIndexer
      )
  
imports: from __future__ import annotations
  import logging
  from pathlib import Path
  from shutil import move
  from typing import Any
  import albumentations
  import numpy
  import pandas
  import torch
  from pandas import DataFrame
  from torch import Tensor
  from anomalib.data.base import AnomalibVideoDataModule, AnomalibVideoDataset
  from anomalib.data.base.video import VideoTargetFrame
  from anomalib.data.task_type import TaskType
  from anomalib.data.utils import DownloadInfo, InputNormalizationMethod, Split, ValSplitMode, download_and_extract, get_transforms, read_image
  from anomalib.data.utils.video import ClipsIndexer, convert_video
label_desc: Use image node_id 1 to create a new ShanghaiTechDataset object from inherited base classes: AnomalibVideoDataset with example: obj = ShanghaiTechDataset(task, root, scene, transform, split, clip_length_in_frames, frames_between_clips, target_frame)