Shortcuts

VideoClassificationData

class flash.video.classification.data.VideoClassificationData(train_dataset=None, val_dataset=None, test_dataset=None, predict_dataset=None, input=None, input_transform=None, output_transform=None, data_fetcher=None, val_split=None, batch_size=4, num_workers=0, sampler=None)[source]

Data module for Video classification tasks.

classmethod from_labelstudio(export_json=None, train_export_json=None, val_export_json=None, test_export_json=None, predict_export_json=None, data_folder=None, train_data_folder=None, val_data_folder=None, test_data_folder=None, predict_data_folder=None, train_transform=None, val_transform=None, test_transform=None, predict_transform=None, val_split=None, multi_label=False, clip_sampler='random', clip_duration=2, clip_sampler_kwargs=None, video_sampler=torch.utils.data.RandomSampler, decode_audio=False, decoder='pyav', **data_module_kwargs)[source]

Creates a DataModule object from the given export file and data directory using the Input of name FOLDERS from the passed or constructed InputTransform.

Parameters
  • export_json (Optional[str]) – path to label studio export file

  • train_export_json (Optional[str]) – path to label studio export file for train set,

  • export_json if specified (overrides) –

  • val_export_json (Optional[str]) – path to label studio export file for validation

  • test_export_json (Optional[str]) – path to label studio export file for test

  • predict_export_json (Optional[str]) – path to label studio export file for predict

  • data_folder (Optional[str]) – path to label studio data folder

  • train_data_folder (Optional[str]) – path to label studio data folder for train data set,

  • data_folder if specified (overrides) –

  • val_data_folder (Optional[str]) – path to label studio data folder for validation data

  • test_data_folder (Optional[str]) – path to label studio data folder for test data

  • predict_data_folder (Optional[str]) – path to label studio data folder for predict data

  • train_transform (Optional[Dict[str, Callable]]) – The dictionary of transforms to use during training which maps InputTransform hook names to callable transforms.

  • val_transform (Optional[Dict[str, Callable]]) – The dictionary of transforms to use during validation which maps InputTransform hook names to callable transforms.

  • test_transform (Optional[Dict[str, Callable]]) – The dictionary of transforms to use during testing which maps InputTransform hook names to callable transforms.

  • predict_transform (Optional[Dict[str, Callable]]) – The dictionary of transforms to use during predicting which maps InputTransform hook names to callable transforms.

  • data_fetcher – The BaseDataFetcher to pass to the DataModule.

  • input_transform – The InputTransform to pass to the DataModule. If None, cls.input_transform_cls will be constructed and used.

  • val_split (Optional[float]) – The val_split argument to pass to the DataModule.

  • multi_label (Optional[bool]) – Whether the label are multi encoded.

  • clip_sampler (Optional[str]) – Defines how clips should be sampled from each video.

  • clip_duration (float) – Defines how long the sampled clips should be for each video.

  • clip_sampler_kwargs (Optional[Dict[str, Any]]) – Additional keyword arguments to use when constructing the clip sampler.

  • video_sampler (Type[Sampler]) – Sampler for the internal video container. This defines the order videos are decoded and, if necessary, the distributed split.

  • decode_audio (bool) – If True, also decode audio from video.

  • decoder (str) – Defines what type of decoder used to decode a video.

  • data_module_kwargs (Any) – Additional keyword arguments to use when constructing the datamodule.

Return type

VideoClassificationData

Returns

The constructed data module.

Examples:

data_module = DataModule.from_labelstudio(
    export_json='project.json',
    data_folder='label-studio/media/upload',
    val_split=0.8,
)
Read the Docs v: latest
Versions
latest
stable
0.5.2
0.5.1
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0post1
Downloads
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.