@@ -51,7 +51,7 @@ def get_img_files(data_path, subdir="*", ext=None):
51
51
@pipeline_def
52
52
def decoder_pipe (data_path , device , use_fast_idct = False , jpeg_fancy_upsampling = False ):
53
53
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 (
55
55
inputs ,
56
56
device = device ,
57
57
output_type = types .RGB ,
@@ -102,11 +102,9 @@ def create_decoder_slice_pipeline(data_path, device):
102
102
103
103
anchor = fn .random .uniform (range = [0.05 , 0.15 ], shape = (2 ,))
104
104
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 )
108
106
109
- images = fn .experimental . decoders .image (jpegs , device = device )
107
+ images = fn .decoders .image (jpegs , device = device )
110
108
images_sliced_2 = fn .slice (images , anchor , shape , axes = (0 , 1 ))
111
109
112
110
return images_sliced_1 , images_sliced_2
@@ -121,11 +119,11 @@ def create_decoder_crop_pipeline(data_path, device):
121
119
w = 242
122
120
h = 230
123
121
124
- images_crop_1 = fn .experimental . decoders .image_crop (
122
+ images_crop_1 = fn .decoders .image_crop (
125
123
jpegs , crop = (w , h ), crop_pos_x = crop_pos_x , crop_pos_y = crop_pos_y , device = device
126
124
)
127
125
128
- images = fn .experimental . decoders .image (jpegs , device = device )
126
+ images = fn .decoders .image (jpegs , device = device )
129
127
130
128
images_crop_2 = fn .crop (images , crop = (w , h ), crop_pos_x = crop_pos_x , crop_pos_y = crop_pos_y )
131
129
@@ -139,12 +137,12 @@ def create_decoder_random_crop_pipeline(data_path, device):
139
137
140
138
w = 242
141
139
h = 230
142
- images_random_crop_1 = fn .experimental . decoders .image_random_crop (
140
+ images_random_crop_1 = fn .decoders .image_random_crop (
143
141
jpegs , device = device , output_type = types .RGB , seed = seed
144
142
)
145
143
images_random_crop_1 = fn .resize (images_random_crop_1 , size = (w , h ))
146
144
147
- images = fn .experimental . decoders .image (jpegs , device = device )
145
+ images = fn .decoders .image (jpegs , device = device )
148
146
images_random_crop_2 = fn .random_resized_crop (images , size = (w , h ), seed = seed )
149
147
150
148
return images_random_crop_1 , images_random_crop_2
@@ -299,7 +297,7 @@ def test_fancy_upsampling(batch_size):
299
297
@pipeline_def (batch_size = batch_size_test , device_id = 0 , num_threads = 4 )
300
298
def img_decoder_pipe (device , out_type , files ):
301
299
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 )
303
301
return decoded
304
302
305
303
@@ -338,8 +336,8 @@ def _testimpl_image_decoder_tiff_with_alpha_16bit(device, out_type, path, ext):
338
336
@pipeline_def (batch_size = 1 , device_id = 0 , num_threads = 1 )
339
337
def pipe (device , out_type , files ):
340
338
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 )
343
341
return decoded , peeked_shape
344
342
345
343
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):
367
365
@pipeline_def (batch_size = batch_size_test , device_id = 0 , num_threads = 4 )
368
366
def pipe (device ):
369
367
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 )
373
369
return decoded
374
370
375
371
p = pipe (device )
@@ -389,9 +385,7 @@ def _testimpl_image_decoder_slice_error_oob(device):
389
385
@pipeline_def (batch_size = batch_size_test , device_id = 0 , num_threads = 4 )
390
386
def pipe (device ):
391
387
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 ])
395
389
return decoded
396
390
397
391
p = pipe (device )
@@ -412,8 +406,8 @@ def test_tiff_palette():
412
406
@pipeline_def (batch_size = 2 , device_id = 0 , num_threads = 1 )
413
407
def pipe ():
414
408
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" )
417
411
return decoded , peeked_shapes
418
412
419
413
p = pipe ()
@@ -434,7 +428,7 @@ def _testimpl_image_decoder_peek_shape(
434
428
@pipeline_def (batch_size = 1 , device_id = 0 , num_threads = 1 )
435
429
def peek_shape_pipeline (file ):
436
430
encoded , _ = fn .readers .file (files = [file ])
437
- return fn .experimental . peek_image_shape (
431
+ return fn .peek_image_shape (
438
432
encoded , image_type = image_type , adjust_orientation = adjust_orientation
439
433
)
440
434
@@ -500,9 +494,7 @@ def test_image_decoder_lossless_jpeg(img_name, output_type, dtype, precision):
500
494
@pipeline_def (batch_size = 1 , device_id = device_id , num_threads = 1 )
501
495
def pipe (file ):
502
496
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 )
506
498
return decoded
507
499
508
500
p = pipe (data_dir + f"/{ img_name } .jpg" )
@@ -528,7 +520,7 @@ def test_image_decoder_lossless_jpeg_cpu_not_supported():
528
520
@pipeline_def (batch_size = 1 , device_id = 0 , num_threads = 1 )
529
521
def pipe (file ):
530
522
encoded , _ = fn .readers .file (files = [file ])
531
- decoded = fn .experimental . decoders .image (
523
+ decoded = fn .decoders .image (
532
524
encoded , device = "cpu" , dtype = types .UINT16 , output_type = types .ANY_DATA
533
525
)
534
526
return decoded
0 commit comments