TimeReverse

Targets:
image
mask
bboxes
keypoints
volume
mask3d
Image Types:uint8, float32

Reverse the time axis of a spectrogram image, also known as time inversion.

Time inversion of a spectrogram is analogous to the random flip of an image, an augmentation technique widely used in the visual domain. This can be relevant in the context of audio classification tasks when working with spectrograms. The technique was successfully applied in the AudioCLIP paper, which extended CLIP to handle image, text, and audio inputs.

This transform is implemented as a subclass of HorizontalFlip since reversing time in a spectrogram is equivalent to flipping the image horizontally.

Arguments
p
float
0.5

probability of applying the transform. Default: 0.5.

Notes

This transform is functionally identical to HorizontalFlip but provides a more semantically meaningful name when working with spectrograms and other time-series visualizations.