()
| 872 | def 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) |
no test coverage detected