@@ -51,7 +51,7 @@ def get_img_files(data_path, subdir="*", ext=None):
5151@pipeline_def
5252def decoder_pipe (data_path , device , use_fast_idct = False , jpeg_fancy_upsampling = False ):
5353 inputs , labels = fn .readers .file (file_root = data_path , shard_id = 0 , num_shards = 1 , name = "Reader" )
54- decoded = fn .experimental . decoders .image (
54+ decoded = fn .decoders .image (
5555 inputs ,
5656 device = device ,
5757 output_type = types .RGB ,
@@ -102,11 +102,9 @@ def create_decoder_slice_pipeline(data_path, device):
102102
103103 anchor = fn .random .uniform (range = [0.05 , 0.15 ], shape = (2 ,))
104104 shape = fn .random .uniform (range = [0.5 , 0.7 ], shape = (2 ,))
105- images_sliced_1 = fn .experimental .decoders .image_slice (
106- jpegs , anchor , shape , axes = (0 , 1 ), device = device
107- )
105+ images_sliced_1 = fn .decoders .image_slice (jpegs , anchor , shape , axes = (0 , 1 ), device = device )
108106
109- images = fn .experimental . decoders .image (jpegs , device = device )
107+ images = fn .decoders .image (jpegs , device = device )
110108 images_sliced_2 = fn .slice (images , anchor , shape , axes = (0 , 1 ))
111109
112110 return images_sliced_1 , images_sliced_2
@@ -121,11 +119,11 @@ def create_decoder_crop_pipeline(data_path, device):
121119 w = 242
122120 h = 230
123121
124- images_crop_1 = fn .experimental . decoders .image_crop (
122+ images_crop_1 = fn .decoders .image_crop (
125123 jpegs , crop = (w , h ), crop_pos_x = crop_pos_x , crop_pos_y = crop_pos_y , device = device
126124 )
127125
128- images = fn .experimental . decoders .image (jpegs , device = device )
126+ images = fn .decoders .image (jpegs , device = device )
129127
130128 images_crop_2 = fn .crop (images , crop = (w , h ), crop_pos_x = crop_pos_x , crop_pos_y = crop_pos_y )
131129
@@ -139,12 +137,12 @@ def create_decoder_random_crop_pipeline(data_path, device):
139137
140138 w = 242
141139 h = 230
142- images_random_crop_1 = fn .experimental . decoders .image_random_crop (
140+ images_random_crop_1 = fn .decoders .image_random_crop (
143141 jpegs , device = device , output_type = types .RGB , seed = seed
144142 )
145143 images_random_crop_1 = fn .resize (images_random_crop_1 , size = (w , h ))
146144
147- images = fn .experimental . decoders .image (jpegs , device = device )
145+ images = fn .decoders .image (jpegs , device = device )
148146 images_random_crop_2 = fn .random_resized_crop (images , size = (w , h ), seed = seed )
149147
150148 return images_random_crop_1 , images_random_crop_2
@@ -299,7 +297,7 @@ def test_fancy_upsampling(batch_size):
299297@pipeline_def (batch_size = batch_size_test , device_id = 0 , num_threads = 4 )
300298def img_decoder_pipe (device , out_type , files ):
301299 encoded , _ = fn .readers .file (files = files )
302- decoded = fn .experimental . decoders .image (encoded , device = device , output_type = out_type )
300+ decoded = fn .decoders .image (encoded , device = device , output_type = out_type )
303301 return decoded
304302
305303
@@ -338,8 +336,8 @@ def _testimpl_image_decoder_tiff_with_alpha_16bit(device, out_type, path, ext):
338336 @pipeline_def (batch_size = 1 , device_id = 0 , num_threads = 1 )
339337 def pipe (device , out_type , files ):
340338 encoded , _ = fn .readers .file (files = files )
341- decoded = fn .experimental . decoders .image (encoded , device = device , output_type = out_type )
342- peeked_shape = fn .experimental . peek_image_shape (encoded )
339+ decoded = fn .decoders .image (encoded , device = device , output_type = out_type )
340+ peeked_shape = fn .peek_image_shape (encoded )
343341 return decoded , peeked_shape
344342
345343 files = get_img_files (os .path .join (test_data_root , path ), ext = ext , subdir = None )
@@ -367,9 +365,7 @@ def _testimpl_image_decoder_crop_error_oob(device):
367365 @pipeline_def (batch_size = batch_size_test , device_id = 0 , num_threads = 4 )
368366 def pipe (device ):
369367 encoded , _ = fn .readers .file (file_root = file_root )
370- decoded = fn .experimental .decoders .image_crop (
371- encoded , crop_w = 10000 , crop_h = 100 , device = device
372- )
368+ decoded = fn .decoders .image_crop (encoded , crop_w = 10000 , crop_h = 100 , device = device )
373369 return decoded
374370
375371 p = pipe (device )
@@ -389,9 +385,7 @@ def _testimpl_image_decoder_slice_error_oob(device):
389385 @pipeline_def (batch_size = batch_size_test , device_id = 0 , num_threads = 4 )
390386 def pipe (device ):
391387 encoded , _ = fn .readers .file (file_root = file_root )
392- decoded = fn .experimental .decoders .image_slice (
393- encoded , device = device , end = [10000 ], axes = [1 ]
394- )
388+ decoded = fn .decoders .image_slice (encoded , device = device , end = [10000 ], axes = [1 ])
395389 return decoded
396390
397391 p = pipe (device )
@@ -412,8 +406,8 @@ def test_tiff_palette():
412406 @pipeline_def (batch_size = 2 , device_id = 0 , num_threads = 1 )
413407 def pipe ():
414408 encoded , _ = fn .readers .file (files = [normal , palette ])
415- peeked_shapes = fn .experimental . peek_image_shape (encoded )
416- decoded = fn .experimental . decoders .image (encoded , device = "cpu" )
409+ peeked_shapes = fn .peek_image_shape (encoded )
410+ decoded = fn .decoders .image (encoded , device = "cpu" )
417411 return decoded , peeked_shapes
418412
419413 p = pipe ()
@@ -434,7 +428,7 @@ def _testimpl_image_decoder_peek_shape(
434428 @pipeline_def (batch_size = 1 , device_id = 0 , num_threads = 1 )
435429 def peek_shape_pipeline (file ):
436430 encoded , _ = fn .readers .file (files = [file ])
437- return fn .experimental . peek_image_shape (
431+ return fn .peek_image_shape (
438432 encoded , image_type = image_type , adjust_orientation = adjust_orientation
439433 )
440434
@@ -500,9 +494,7 @@ def test_image_decoder_lossless_jpeg(img_name, output_type, dtype, precision):
500494 @pipeline_def (batch_size = 1 , device_id = device_id , num_threads = 1 )
501495 def pipe (file ):
502496 encoded , _ = fn .readers .file (files = [file ])
503- decoded = fn .experimental .decoders .image (
504- encoded , device = "mixed" , dtype = dtype , output_type = output_type
505- )
497+ decoded = fn .decoders .image (encoded , device = "mixed" , dtype = dtype , output_type = output_type )
506498 return decoded
507499
508500 p = pipe (data_dir + f"/{ img_name } .jpg" )
@@ -528,7 +520,7 @@ def test_image_decoder_lossless_jpeg_cpu_not_supported():
528520 @pipeline_def (batch_size = 1 , device_id = 0 , num_threads = 1 )
529521 def pipe (file ):
530522 encoded , _ = fn .readers .file (files = [file ])
531- decoded = fn .experimental . decoders .image (
523+ decoded = fn .decoders .image (
532524 encoded , device = "cpu" , dtype = types .UINT16 , output_type = types .ANY_DATA
533525 )
534526 return decoded
0 commit comments