Our preprocessing pipeline is crytalized in VideoPreprocessor module, and it contains two different stages. We create scripts for both Linux and Windows OS, but below is an exposition when running on Linux.
- Stage 1
Resampling video with specified FPS → Rescale → Central crop -> Extract video stream (script). - Stage 2:
Split video into n non-overlapping video segments (clips) -> Temporal sampling -> Save as Pytorch tensor (.pt format) (script). - Stage 3:
Copy remaining files to preprocessed directory (script).
| Parameter | Default | Description |
|---|---|---|
device |
|
Device for preprocessing video with ffmpeg. Note that ffmpeg should be built with GPU acceleration. |
cpu_ratio |
|
Ratio b/t the utilization of cpu and gpu if device is both. |
save_root |
|
Output root of preprocessed videos. |
root |
|
Root of dataset, which is read by VideoFolderDataset class. |
loader |
|
Video loader api (check this). |
batch_size |
|
Dataloader batch size. |
processes |
|
Number of processes for multiprocessing. |
fn_name |
|
Which preprocessing stage to run. |
| Parameter | Default | Description |
|---|---|---|
run_async |
|
Waiting time when running in an async manner. |
wait_time |
|
Run ffmpeg in an async manner. |
| Parameter | Default | Description |
|---|---|---|
del_prev_result |
|
Delete previous stage result. |
include_labeled |
`` |
Also split labeled video into segements that will be used for train/ val later on. |
| Parameter | Default | Description |
|---|---|---|
vid_ext |
|
List of video extension string for being ignored when moving remaining files. |