Skip to content

Commit 56d4078

Browse files
NicolasHugpmeiervfdev-5
authored
Add docs for UniformTemporalSubsample (#7325)
Co-authored-by: Philip Meier <[email protected]> Co-authored-by: vfdev <[email protected]>
1 parent 877ffd9 commit 56d4078

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/source/transforms.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ Miscellaneous
192192
v2.Lambda
193193
v2.SanitizeBoundingBox
194194
v2.ClampBoundingBox
195+
v2.UniformTemporalSubsample
195196

196197
.. _conversion_transforms:
197198

torchvision/transforms/v2/_temporal.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77

88

99
class UniformTemporalSubsample(Transform):
10+
"""[BETA] Uniformly subsample ``num_samples`` indices from the temporal dimension of the video.
11+
12+
.. betastatus:: UniformTemporalSubsample transform
13+
14+
Videos are expected to be of shape ``[..., T, C, H, W]`` where ``T`` denotes the temporal dimension.
15+
16+
When ``num_samples`` is larger than the size of temporal dimension of the video, it
17+
will sample frames based on nearest neighbor interpolation.
18+
19+
Args:
20+
num_samples (int): The number of equispaced samples to be selected
21+
"""
22+
1023
_transformed_types = (is_simple_tensor, datapoints.Video)
1124

1225
def __init__(self, num_samples: int):

0 commit comments

Comments
 (0)