View source on GitHub |
Samples a single segment of size num_steps
from a given sequence.
tfm.vision.preprocess_ops_3d.sample_sequence(
sequence: tf.Tensor,
num_steps: int,
random: bool,
stride: int,
seed: Optional[int] = None
) -> tf.Tensor
If random
is not True
, this function will simply sample the central window
of the sequence. Otherwise, a random offset will be chosen in a way that the
desired num_steps
might be extracted from the sequence.
Returns | |
---|---|
A single tf.Tensor with first dimension num_steps with the sampled
segment.
|