Skip to content

Commit ad3bac1

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

File tree

9 files changed

+44
-147
lines changed

9 files changed

+44
-147
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

+5-15
Original file line numberDiff line numberDiff line change
@@ -973,27 +973,17 @@ def test_noise_shot(device):
973973
check_single_input_operator(fn.noise.shot, device, factor=100)
974974

975975

976-
@params("cpu", "mixed")
977-
@random_signed_off("image_decoder_random_crop", "decoders.image_random_crop")
978-
def test_image_random_crop(device):
979-
@pipeline_def
980-
def pipeline():
981-
data, _ = fn.readers.file(name="Reader", file_root=images_dir)
982-
image = fn.decoders.image_random_crop(data, device=device)
983-
return image
984-
985-
check_pipeline_checkpointing_native(pipeline)
986-
987-
988976
@params("cpu", "mixed")
989977
@random_signed_off(
990-
"experimental.image_decoder_random_crop", "experimental.decoders.image_random_crop"
978+
"image_decoder_random_crop",
979+
"decoders.image_random_crop",
980+
"experimental.decoders.image_random_crop",
991981
)
992-
def test_experimental_image_random_crop(device):
982+
def test_image_random_crop(device):
993983
@pipeline_def
994984
def pipeline():
995985
data, _ = fn.readers.file(name="Reader", file_root=images_dir)
996-
image = fn.experimental.decoders.image_random_crop(data, device=device)
986+
image = fn.decoders.image_random_crop(data, device=device)
997987
return image
998988

999989
check_pipeline_checkpointing_native(pipeline)

dali/test/python/checkpointing/test_dali_stateless_operators.py

+8-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,27 @@ 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(
839+
"decoders.image_crop", "image_decoder_crop", "experimental.decoders.image_crop"
840+
)
850841
def test_image_decoder_crop_stateless(device):
851842
check_single_encoded_jpeg_input(fn.decoders.image_crop, device, crop=(20, 50))
852843

853844

854845
@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")
846+
@stateless_signed_off(
847+
"decoders.image_slice", "image_decoder_slice", "experimental.decoders.image_slice"
848+
)
862849
def test_image_decoder_slice_stateless(device):
863850
check_single_encoded_jpeg_input(fn.decoders.image_slice, device, start=(5, 5), end=(45, 45))
864851

865852

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-
874853
@params("cpu", "gpu")
875854
@stateless_signed_off("coord_flip")
876855
def test_coord_flip_stateless(device):

dali/test/python/decoder/test_imgcodec.py

+17-25
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,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)
300298
def 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

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",

0 commit comments

Comments
 (0)