MCPcopy Create free account
hub / github.com/NVIDIA/DALI / get_video_input_cases

Function get_video_input_cases

dali/test/python/sequences_test_utils.py:424–448  ·  view source on GitHub ↗
(seq_layout, rng, larger_shape=(512, 288), smaller_shape=(384, 216))

Source from the content-addressed store, hash-verified

422
423
424def get_video_input_cases(seq_layout, rng, larger_shape=(512, 288), smaller_shape=(384, 216)):
425 max_batch_size = 8
426 max_num_frames = 16
427 cases = []
428 w, h = larger_shape
429 larger = vid_source(max_batch_size, 1, max_num_frames, w, h, seq_layout)
430 w, h = smaller_shape
431 smaller = vid_source(max_batch_size, 2, max_num_frames, w, h, seq_layout)
432 cases.append(smaller)
433 samples = [sample for batch in [smaller[0], larger[0], smaller[1]] for sample in batch]
434 rng.shuffle(samples)
435 # test variable batch size
436 case2 = [
437 samples[0:1],
438 samples[1 : 1 + max_batch_size],
439 samples[1 + max_batch_size : 2 * max_batch_size],
440 samples[2 * max_batch_size : 3 * max_batch_size],
441 ]
442 cases.append(case2)
443 frames_idx = seq_layout.find("F")
444 if frames_idx == 0:
445 # test variadic number of frames in different sequences
446 case3 = [[sample[: rng.randint(1, sample.shape[0])] for sample in batch] for batch in case2]
447 cases.append(case3)
448 return cases
449
450
451@pipeline_def

Callers 2

test_videoFunction · 0.90
video_suite_helperFunction · 0.85

Calls 3

vid_sourceFunction · 0.85
appendMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected