

val_transform = Compose(
     [
         ApplyTransformToKey(
             key="video",
             transform=Compose(
                 [
                     UniformTemporalSubsample(num_frames_to_sample),
                     Lambda(lambda x: x / 255.0),
                     Normalize(mean, std),
                     Resize(resize_to),
                 ]
             ),
         ),
     ]
 )
val_dataset = pytorchvideo.data.Ucf101(
     data_path=os.path.join(dataset_root_path, "val"),
     clip_sampler=pytorchvideo.data.make_clip_sampler("uniform", clip_duration),
     decode_audio=False,
     transform=val_transform,
 )
test_dataset = pytorchvideo.data.Ucf101(
     data_path=os.path.join(dataset_root_path, "test"),
     clip_sampler=pytorchvideo.data.make_clip_sampler("uniform", clip_duration),
     decode_audio=False,
     transform=val_transform,
 )