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

Function create_ref_pipe

dali/test/python/operator_2/test_resize_seq.py:98–110  ·  view source on GitHub ↗
(channel_first, seq_len, interp, dtype, w, h, batch_size=2)

Source from the content-addressed store, hash-verified

96
97
98def create_ref_pipe(channel_first, seq_len, interp, dtype, w, h, batch_size=2):
99 pipe = dali.pipeline.Pipeline(batch_size, 1, 0, 0, exec_async=False, exec_pipelined=False)
100 with pipe:
101 layout = "FCHW" if channel_first else "FHWC"
102 ext = fn.external_source(GetSequences(channel_first, seq_len, batch_size), layout=layout)
103 pil_resized = fn.python_function(
104 ext, function=resize_PIL(channel_first, interp, w, h), batch_processing=False
105 )
106 if dtype is not None: # unfortunately, PIL can't quite handle that
107 pil_resized = fn.cast(pil_resized, dtype=dtype)
108 pil_resized = fn.reshape(pil_resized, layout=layout)
109 pipe.set_outputs(pil_resized)
110 return pipe
111
112
113def create_dali_pipe(channel_first, seq_len, interp, dtype, w, h, batch_size=2):

Callers 1

_test_resizeFunction · 0.85

Calls 6

set_outputsMethod · 0.95
GetSequencesFunction · 0.85
PipelineMethod · 0.80
resize_PILFunction · 0.70
castMethod · 0.45
reshapeMethod · 0.45

Tested by

no test coverage detected