Skip to content

Commit 32185c3

Browse files
committed
Remove manual installation of nvjpeg, nvjpeg2k and nvtiff
Signed-off-by: Joaquin Anton Guirao <[email protected]>
1 parent d9589ac commit 32185c3

File tree

9 files changed

+36
-139
lines changed

9 files changed

+36
-139
lines changed

dali/operators/imgcodec/peek_image_shape.cc

+8-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ DALI_SCHEMA(PeekImageShape)
2525
This operator returns the shape that an image would have after decoding.
2626
2727
.. note::
28-
This operator is not recommended for use with the dynamic executor (`exec_dynamic=True` in the
29-
pipeline constructor).
30-
Use :meth:`nvidia.dali.pipeline.DataNode.shape()` instead on the decoded images.
28+
This operator is specifically designed to peek at the shape of encoded images before decoding them.
29+
30+
For already decoded images, you could instead use either:
31+
32+
* The ``shape`` operator
33+
* The :meth:`nvidia.dali.pipeline.DataNode.shape()` method
34+
35+
When using the dynamic executor, the shape output will always be a CPU tensor, regardless of the input device location.
3136
)")
3237
.NumInput(1)
3338
.NumOutput(1)

dali/test/python/checkpointing/test_dali_checkpointing.py

+1-15
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ def test_noise_shot(device):
974974

975975

976976
@params("cpu", "mixed")
977-
@random_signed_off("image_decoder_random_crop", "decoders.image_random_crop")
977+
@random_signed_off("image_decoder_random_crop", "decoders.image_random_crop", "experimental.decoders.image_random_crop")
978978
def test_image_random_crop(device):
979979
@pipeline_def
980980
def pipeline():
@@ -985,20 +985,6 @@ def pipeline():
985985
check_pipeline_checkpointing_native(pipeline)
986986

987987

988-
@params("cpu", "mixed")
989-
@random_signed_off(
990-
"experimental.image_decoder_random_crop", "experimental.decoders.image_random_crop"
991-
)
992-
def test_experimental_image_random_crop(device):
993-
@pipeline_def
994-
def pipeline():
995-
data, _ = fn.readers.file(name="Reader", file_root=images_dir)
996-
image = fn.experimental.decoders.image_random_crop(data, device=device)
997-
return image
998-
999-
check_pipeline_checkpointing_native(pipeline)
1000-
1001-
1002988
# External source
1003989

1004990

dali/test/python/checkpointing/test_dali_stateless_operators.py

+4-29
Original file line numberDiff line numberDiff line change
@@ -815,16 +815,11 @@ def pipeline():
815815
check_is_pipeline_stateless(pipeline)
816816

817817

818-
@stateless_signed_off("peek_image_shape")
818+
@stateless_signed_off("peek_image_shape", "experimental.peek_image_shape")
819819
def test_peek_image_shape_stateless():
820820
check_single_encoded_jpeg_input(fn.peek_image_shape, "cpu")
821821

822822

823-
@stateless_signed_off("experimental.peek_image_shape")
824-
def test_imgcodec_peek_image_shape_stateless():
825-
check_single_encoded_jpeg_input(fn.experimental.peek_image_shape, "cpu")
826-
827-
828823
@stateless_signed_off("decoders.audio", "audio_decoder")
829824
def test_audio_decoder_stateless():
830825
def audio_decoder_wrapper(*args, **kwargs):
@@ -834,43 +829,23 @@ def audio_decoder_wrapper(*args, **kwargs):
834829

835830

836831
@params("cpu", "mixed")
837-
@stateless_signed_off("decoders.image", "image_decoder")
832+
@stateless_signed_off("decoders.image", "image_decoder", "experimental.decoders.image")
838833
def test_image_decoder_stateless(device):
839834
check_single_encoded_jpeg_input(fn.decoders.image, device)
840835

841836

842837
@params("cpu", "mixed")
843-
@stateless_signed_off("experimental.decoders.image")
844-
def test_experimental_image_decoder_stateless(device):
845-
check_single_encoded_jpeg_input(fn.experimental.decoders.image, device)
846-
847-
848-
@params("cpu", "mixed")
849-
@stateless_signed_off("decoders.image_crop", "image_decoder_crop")
838+
@stateless_signed_off("decoders.image_crop", "image_decoder_crop", "experimental.decoders.image_crop")
850839
def test_image_decoder_crop_stateless(device):
851840
check_single_encoded_jpeg_input(fn.decoders.image_crop, device, crop=(20, 50))
852841

853842

854843
@params("cpu", "mixed")
855-
@stateless_signed_off("experimental.decoders.image_crop")
856-
def test_experimental_image_decoder_crop_stateless(device):
857-
check_single_encoded_jpeg_input(fn.experimental.decoders.image_crop, device, crop=(20, 50))
858-
859-
860-
@params("cpu", "mixed")
861-
@stateless_signed_off("decoders.image_slice", "image_decoder_slice")
844+
@stateless_signed_off("decoders.image_slice", "image_decoder_slice", "experimental.decoders.image_slice")
862845
def test_image_decoder_slice_stateless(device):
863846
check_single_encoded_jpeg_input(fn.decoders.image_slice, device, start=(5, 5), end=(45, 45))
864847

865848

866-
@params("cpu", "mixed")
867-
@stateless_signed_off("experimental.decoders.image_slice")
868-
def test_experimental_image_decoder_slice_stateless(device):
869-
check_single_encoded_jpeg_input(
870-
fn.experimental.decoders.image_slice, device, start=(5, 5), end=(45, 45)
871-
)
872-
873-
874849
@params("cpu", "gpu")
875850
@stateless_signed_off("coord_flip")
876851
def test_coord_flip_stateless(device):

dali/test/python/decoder/test_imgcodec.py

+17-17
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def get_img_files(data_path, subdir="*", ext=None):
5151
@pipeline_def
5252
def 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,11 @@ 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(
105+
images_sliced_1 = fn.decoders.image_slice(
106106
jpegs, anchor, shape, axes=(0, 1), device=device
107107
)
108108

109-
images = fn.experimental.decoders.image(jpegs, device=device)
109+
images = fn.decoders.image(jpegs, device=device)
110110
images_sliced_2 = fn.slice(images, anchor, shape, axes=(0, 1))
111111

112112
return images_sliced_1, images_sliced_2
@@ -121,11 +121,11 @@ def create_decoder_crop_pipeline(data_path, device):
121121
w = 242
122122
h = 230
123123

124-
images_crop_1 = fn.experimental.decoders.image_crop(
124+
images_crop_1 = fn.decoders.image_crop(
125125
jpegs, crop=(w, h), crop_pos_x=crop_pos_x, crop_pos_y=crop_pos_y, device=device
126126
)
127127

128-
images = fn.experimental.decoders.image(jpegs, device=device)
128+
images = fn.decoders.image(jpegs, device=device)
129129

130130
images_crop_2 = fn.crop(images, crop=(w, h), crop_pos_x=crop_pos_x, crop_pos_y=crop_pos_y)
131131

@@ -139,12 +139,12 @@ def create_decoder_random_crop_pipeline(data_path, device):
139139

140140
w = 242
141141
h = 230
142-
images_random_crop_1 = fn.experimental.decoders.image_random_crop(
142+
images_random_crop_1 = fn.decoders.image_random_crop(
143143
jpegs, device=device, output_type=types.RGB, seed=seed
144144
)
145145
images_random_crop_1 = fn.resize(images_random_crop_1, size=(w, h))
146146

147-
images = fn.experimental.decoders.image(jpegs, device=device)
147+
images = fn.decoders.image(jpegs, device=device)
148148
images_random_crop_2 = fn.random_resized_crop(images, size=(w, h), seed=seed)
149149

150150
return images_random_crop_1, images_random_crop_2
@@ -299,7 +299,7 @@ def test_fancy_upsampling(batch_size):
299299
@pipeline_def(batch_size=batch_size_test, device_id=0, num_threads=4)
300300
def img_decoder_pipe(device, out_type, files):
301301
encoded, _ = fn.readers.file(files=files)
302-
decoded = fn.experimental.decoders.image(encoded, device=device, output_type=out_type)
302+
decoded = fn.decoders.image(encoded, device=device, output_type=out_type)
303303
return decoded
304304

305305

@@ -338,8 +338,8 @@ def _testimpl_image_decoder_tiff_with_alpha_16bit(device, out_type, path, ext):
338338
@pipeline_def(batch_size=1, device_id=0, num_threads=1)
339339
def pipe(device, out_type, files):
340340
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)
341+
decoded = fn.decoders.image(encoded, device=device, output_type=out_type)
342+
peeked_shape = fn.peek_image_shape(encoded)
343343
return decoded, peeked_shape
344344

345345
files = get_img_files(os.path.join(test_data_root, path), ext=ext, subdir=None)
@@ -367,7 +367,7 @@ def _testimpl_image_decoder_crop_error_oob(device):
367367
@pipeline_def(batch_size=batch_size_test, device_id=0, num_threads=4)
368368
def pipe(device):
369369
encoded, _ = fn.readers.file(file_root=file_root)
370-
decoded = fn.experimental.decoders.image_crop(
370+
decoded = fn.decoders.image_crop(
371371
encoded, crop_w=10000, crop_h=100, device=device
372372
)
373373
return decoded
@@ -389,7 +389,7 @@ def _testimpl_image_decoder_slice_error_oob(device):
389389
@pipeline_def(batch_size=batch_size_test, device_id=0, num_threads=4)
390390
def pipe(device):
391391
encoded, _ = fn.readers.file(file_root=file_root)
392-
decoded = fn.experimental.decoders.image_slice(
392+
decoded = fn.decoders.image_slice(
393393
encoded, device=device, end=[10000], axes=[1]
394394
)
395395
return decoded
@@ -412,8 +412,8 @@ def test_tiff_palette():
412412
@pipeline_def(batch_size=2, device_id=0, num_threads=1)
413413
def pipe():
414414
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")
415+
peeked_shapes = fn.peek_image_shape(encoded)
416+
decoded = fn.decoders.image(encoded, device="cpu")
417417
return decoded, peeked_shapes
418418

419419
p = pipe()
@@ -434,7 +434,7 @@ def _testimpl_image_decoder_peek_shape(
434434
@pipeline_def(batch_size=1, device_id=0, num_threads=1)
435435
def peek_shape_pipeline(file):
436436
encoded, _ = fn.readers.file(files=[file])
437-
return fn.experimental.peek_image_shape(
437+
return fn.peek_image_shape(
438438
encoded, image_type=image_type, adjust_orientation=adjust_orientation
439439
)
440440

@@ -500,7 +500,7 @@ def test_image_decoder_lossless_jpeg(img_name, output_type, dtype, precision):
500500
@pipeline_def(batch_size=1, device_id=device_id, num_threads=1)
501501
def pipe(file):
502502
encoded, _ = fn.readers.file(files=[file])
503-
decoded = fn.experimental.decoders.image(
503+
decoded = fn.decoders.image(
504504
encoded, device="mixed", dtype=dtype, output_type=output_type
505505
)
506506
return decoded
@@ -528,7 +528,7 @@ def test_image_decoder_lossless_jpeg_cpu_not_supported():
528528
@pipeline_def(batch_size=1, device_id=0, num_threads=1)
529529
def pipe(file):
530530
encoded, _ = fn.readers.file(files=[file])
531-
decoded = fn.experimental.decoders.image(
531+
decoded = fn.decoders.image(
532532
encoded, device="cpu", dtype=types.UINT16, output_type=types.ANY_DATA
533533
)
534534
return decoded

dali/test/python/operator_2/test_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def images_pipeline(dev, shapes, border, in_dtype, mode):
7070
images, _ = fn.readers.file(
7171
name="Reader", file_root=images_dir, prefetch_queue_depth=2, random_shuffle=True, seed=42
7272
)
73-
images = fn.experimental.decoders.image(
73+
images = fn.decoders.image(
7474
images, device="cpu", output_type=types.RGB, dtype=np_type_to_dali(in_dtype)
7575
)
7676
if dev == "gpu":

dali/test/python/test_dali_cpu_only.py

+5-25
Original file line numberDiff line numberDiff line change
@@ -323,26 +323,14 @@ def test_image_decoder_cpu():
323323
_test_image_decoder_args_cpu(fn.decoders.image)
324324

325325

326-
def test_experimental_image_decoder_cpu():
327-
_test_image_decoder_args_cpu(fn.experimental.decoders.image)
328-
329-
330326
def test_image_decoder_crop_cpu():
331327
_test_image_decoder_args_cpu(fn.decoders.image_crop, crop=(10, 10))
332328

333329

334-
def test_experimental_image_decoder_crop_cpu():
335-
_test_image_decoder_args_cpu(fn.experimental.decoders.image_crop, crop=(10, 10))
336-
337-
338330
def test_image_decoder_random_crop_cpu():
339331
_test_image_decoder_args_cpu(fn.decoders.image_random_crop)
340332

341333

342-
def test_experimental_image_decoder_random_crop_cpu():
343-
_test_image_decoder_args_cpu(fn.experimental.decoders.image_random_crop)
344-
345-
346334
def test_coin_flip_cpu():
347335
check_no_input(fn.random.coin_flip)
348336

@@ -723,10 +711,6 @@ def test_image_decoder_slice_cpu():
723711
_test_image_decoder_slice_cpu(fn.decoders.image_slice)
724712

725713

726-
def test_experimental_image_decoder_slice_cpu():
727-
_test_image_decoder_slice_cpu(fn.experimental.decoders.image_slice)
728-
729-
730714
def test_pad_cpu():
731715
pipe = Pipeline(batch_size=batch_size, num_threads=4, device_id=None)
732716
test_data_shape = [5, 4, 3]
@@ -1220,10 +1204,6 @@ def test_peek_image_shape_cpu():
12201204
_test_peek_image_shape_cpu(fn.peek_image_shape)
12211205

12221206

1223-
def test_experimental_peek_image_shape_cpu():
1224-
_test_peek_image_shape_cpu(fn.experimental.peek_image_shape)
1225-
1226-
12271207
def test_separated_exec_setup():
12281208
batch_size = 128
12291209
pipe = Pipeline(
@@ -1408,19 +1388,19 @@ def test_warp_perspective():
14081388
"_conditional.not_",
14091389
"_conditional.validate_logical",
14101390
"audio_decoder",
1411-
"image_decoder",
1412-
"image_decoder_slice",
1413-
"image_decoder_crop",
1414-
"image_decoder_random_crop",
14151391
"decoders.image",
14161392
"decoders.image_crop",
14171393
"decoders.image_slice",
14181394
"decoders.image_random_crop",
1419-
"experimental.debayer",
1395+
"image_decoder",
1396+
"image_decoder_slice",
1397+
"image_decoder_crop",
1398+
"image_decoder_random_crop",
14201399
"experimental.decoders.image",
14211400
"experimental.decoders.image_crop",
14221401
"experimental.decoders.image_slice",
14231402
"experimental.decoders.image_random_crop",
1403+
"experimental.debayer",
14241404
"experimental.inputs.video",
14251405
"decoders.audio",
14261406
"external_source",

dali/test/python/test_eager_coverage.py

-40
Original file line numberDiff line numberDiff line change
@@ -362,16 +362,6 @@ def test_decoders_image():
362362
)
363363

364364

365-
def test_experimental_decoders_image():
366-
check_single_input(
367-
"experimental.decoders.image",
368-
pipe_fun=reader_op_pipeline,
369-
fn_source=images_dir,
370-
eager_source=PipelineInput(file_reader_pipeline, file_root=images_dir),
371-
output_type=types.RGB,
372-
)
373-
374-
375365
def test_decoders_image_crop():
376366
check_single_input(
377367
"decoders.image_crop",
@@ -383,17 +373,6 @@ def test_decoders_image_crop():
383373
)
384374

385375

386-
def test_experimental_decoders_image_crop():
387-
check_single_input(
388-
"experimental.decoders.image_crop",
389-
pipe_fun=reader_op_pipeline,
390-
fn_source=images_dir,
391-
eager_source=PipelineInput(file_reader_pipeline, file_root=images_dir),
392-
output_type=types.RGB,
393-
crop=(10, 10),
394-
)
395-
396-
397376
def test_decoders_image_random_crop():
398377
check_single_input_stateful(
399378
"decoders.image_random_crop",
@@ -404,16 +383,6 @@ def test_decoders_image_random_crop():
404383
)
405384

406385

407-
def test_experimental_decoders_image_random_crop():
408-
check_single_input_stateful(
409-
"experimental.decoders.image_random_crop",
410-
pipe_fun=reader_op_pipeline,
411-
fn_source=images_dir,
412-
eager_source=PipelineInput(file_reader_pipeline, file_root=images_dir),
413-
output_type=types.RGB,
414-
)
415-
416-
417386
def test_rotate():
418387
check_single_input("rotate", angle=25)
419388

@@ -1225,15 +1194,6 @@ def test_peek_image_shape():
12251194
)
12261195

12271196

1228-
def test_experimental_peek_image_shape():
1229-
check_single_input(
1230-
"experimental.peek_image_shape",
1231-
pipe_fun=reader_op_pipeline,
1232-
fn_source=images_dir,
1233-
eager_source=PipelineInput(file_reader_pipeline, file_root=images_dir),
1234-
)
1235-
1236-
12371197
def test_subscript_dim_check():
12381198
check_single_input("subscript_dim_check", num_subscripts=3)
12391199

0 commit comments

Comments
 (0)