MCPcopy Create free account
hub / github.com/OpenGVLab/UniFormerV2 / get_random_sampling_rate

Function get_random_sampling_rate

slowfast/datasets/utils.py:371–380  ·  view source on GitHub ↗

When multigrid training uses a fewer number of frames, we randomly increase the sampling rate so that some clips cover the original span.

(long_cycle_sampling_rate, sampling_rate)

Source from the content-addressed store, hash-verified

369
370
371def get_random_sampling_rate(long_cycle_sampling_rate, sampling_rate):
372 """
373 When multigrid training uses a fewer number of frames, we randomly
374 increase the sampling rate so that some clips cover the original span.
375 """
376 if long_cycle_sampling_rate > 0:
377 assert long_cycle_sampling_rate >= sampling_rate
378 return random.randint(sampling_rate, long_cycle_sampling_rate)
379 else:
380 return sampling_rate
381
382
383def revert_tensor_normalize(tensor, mean, std):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected