pulsatrix
Loading...
Searching...
No Matches
pulsatrix::UniformFrameSampleTransform Class Reference

Samples num_frames evenly-spaced frames from a clip Tensor (sample.fields[0], shape (T, C, H, W) – VideoFrameDirectoryDataset's convention), producing an (N, C, H, W) Tensor – deliberately identical in shape convention to Phase 2's image Dataset/Transform outputs (ImageFolderDataset, ResizeTransform, etc.): a video clip, once frame-sampled, is just a batch of images from this codebase's perspective. More...

#include <video_transforms.hpp>

Inheritance diagram for pulsatrix::UniformFrameSampleTransform:
Collaboration diagram for pulsatrix::UniformFrameSampleTransform:

Public Member Functions

 UniformFrameSampleTransform (int64_t num_frames, DeviceBackend *backend)
 
Sample apply (Sample sample) const override
 
- Public Member Functions inherited from pulsatrix::Transform
virtual ~Transform ()=default
 

Detailed Description

Samples num_frames evenly-spaced frames from a clip Tensor (sample.fields[0], shape (T, C, H, W) – VideoFrameDirectoryDataset's convention), producing an (N, C, H, W) Tensor – deliberately identical in shape convention to Phase 2's image Dataset/Transform outputs (ImageFolderDataset, ResizeTransform, etc.): a video clip, once frame-sampled, is just a batch of images from this codebase's perspective.

Note
Needs a DeviceBackend to allocate the differently-shaped output Tensor, matching ResizeTransform/CenterCropTransform's (Phase 2) and ResampleTransform's (Phase 4) precedent.

Constructor & Destructor Documentation

◆ UniformFrameSampleTransform()

pulsatrix::UniformFrameSampleTransform::UniformFrameSampleTransform ( int64_t  num_frames,
DeviceBackend *  backend 
)
inline

Member Function Documentation

◆ apply()

Sample pulsatrix::UniformFrameSampleTransform::apply ( Sample  sample) const
overridevirtual
Exceptions
std::invalid_argumentif num_frames exceeds the clip's actual frame count – external boundary: num_frames is caller-supplied configuration.

Implements pulsatrix::Transform.


The documentation for this class was generated from the following file: