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

Function pipe

dali/test/python/operator_1/test_crop_mirror_normalize.py:874–893  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

872def check_cmn_per_sample_norm_args(cmn_fn, device, rand_mean, rand_stdev, scale, shift):
873 @pipeline_def(num_threads=3, device_id=0)
874 def pipe():
875 image_like = fn.random.uniform(device=device, range=(0, 255), shape=(80, 120, 3))
876 image_like = fn.reshape(image_like, layout="HWC")
877 mean = [0.485 * 255, 0.456 * 255, 0.406 * 255]
878 std = [0.229 * 255, 0.224 * 255, 0.225 * 255]
879 if rand_mean:
880 mean = fn.random.uniform(range=(100, 125), shape=(3,))
881 if rand_stdev:
882 std = fn.random.uniform(range=(55, 60), shape=(3,))
883 out = cmn_fn(
884 image_like,
885 dtype=types.FLOAT,
886 output_layout="HWC",
887 mean=mean,
888 std=std,
889 scale=scale,
890 shift=shift,
891 pad_output=False,
892 )
893 return out, image_like, mean, std
894
895 batch_size = 10
896 p = pipe(batch_size=batch_size)

Callers 2

Calls 2

reshapeMethod · 0.45
gpuMethod · 0.45

Tested by

no test coverage detected