DecoderTransform¶
- class torchcodec.transforms.DecoderTransform[source]¶
Base class for all decoder transforms.
A decoder transform is a transform that is applied by the decoder before returning the decoded frame. Applying decoder transforms to frames should be both faster and more memory efficient than receiving normally decoded frames and applying the same kind of transform.
Most
DecoderTransformobjects have a complementary transform in TorchVision, specificially in torchvision.transforms.v2. For such transforms, we ensure that:The names are the same.
Default behaviors are the same.
The parameters for the
DecoderTransformobject are a subset of the TorchVisionTransformobject.Parameters with the same name control the same behavior and accept a subset of the same types.
The difference between the frames returned by a decoder transform and the complementary TorchVision transform are such that a model should not be able to tell the difference.
Examples using
DecoderTransform:
Decoder Transforms: Applying transforms during decoding
Decoder Transforms: Applying transforms during decoding