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

Function test_image_decoder_fused

dali/test/python/decoder/test_image.py:183–218  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181
182
183def test_image_decoder_fused():
184 threads = 4
185 batch_size = 10
186 for test_fun in [
187 create_decoder_slice_pipeline,
188 create_decoder_crop_pipeline,
189 create_decoder_random_crop_pipeline,
190 ]:
191 # before CUDA 11.4 HW decoder API doesn't support ROI so we get slightly different results
192 # HW decoder + slice vs fused which in this case is executed by the hybrid backend
193 if test_fun == create_decoder_random_crop_pipeline or get_nvjpeg_ver() < (11, 4, 0):
194 # random_resized_crop can properly handle border as it has pixels that are cropped out,
195 # while plain resize following image_decoder_random_crop cannot do that
196 # and must duplicate the border pixels
197 def mean_close(x, y):
198 return np.mean(np.abs(x - y) < 0.5)
199
200 validation_fun = mean_close
201 else:
202
203 def mean_close(x, y):
204 return np.allclose(x, y)
205
206 validation_fun = mean_close
207 for device in ["cpu", "mixed"]:
208 for img_type in test_good_path:
209 yield (
210 run_decode_fused,
211 test_fun,
212 good_path,
213 img_type,
214 batch_size,
215 device,
216 threads,
217 validation_fun,
218 )
219
220
221def check_FastDCT_body(batch_size, img_type, device):

Callers

nothing calls this directly

Calls 1

get_nvjpeg_verFunction · 0.90

Tested by

no test coverage detected