Skip to content

Commit fa54c36

Browse files
committed
Make nvimagecodec decoder the default and move the old one to legacy module
Signed-off-by: Joaquin Anton Guirao <[email protected]>
1 parent ed083f6 commit fa54c36

14 files changed

+152
-83
lines changed

dali/operators/decoder/host/fused/host_decoder_crop.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ void HostDecoderCrop::RunImpl(Workspace &ws) {
3434
HostDecoder::RunImpl(ws);
3535
}
3636

37-
DALI_REGISTER_OPERATOR(decoders__ImageCrop, HostDecoderCrop, CPU);
38-
DALI_REGISTER_OPERATOR(ImageDecoderCrop, HostDecoderCrop, CPU);
37+
DALI_REGISTER_OPERATOR(legacy__decoders__ImageCrop, HostDecoderCrop, CPU);
3938

4039
} // namespace dali

dali/operators/decoder/host/fused/host_decoder_random_crop.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ HostDecoderRandomCrop::DeserializeCheckpoint(OpCheckpoint &cpt, const std::strin
4545
SnapshotSerializer().Deserialize<std::vector<std::mt19937>>(data);
4646
}
4747

48-
DALI_REGISTER_OPERATOR(decoders__ImageRandomCrop, HostDecoderRandomCrop, CPU);
49-
DALI_REGISTER_OPERATOR(ImageDecoderRandomCrop, HostDecoderRandomCrop, CPU);
48+
DALI_REGISTER_OPERATOR(legacy__decoders__ImageRandomCrop, HostDecoderRandomCrop, CPU);
5049

5150
} // namespace dali

dali/operators/decoder/host/fused/host_decoder_slice.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ HostDecoderSlice::HostDecoderSlice(const OpSpec &spec)
2828
, slice_attr_(spec) {
2929
}
3030

31-
DALI_REGISTER_OPERATOR(decoders__ImageSlice, HostDecoderSlice, CPU);
32-
DALI_REGISTER_OPERATOR(ImageDecoderSlice, HostDecoderSlice, CPU);
31+
DALI_REGISTER_OPERATOR(legacy__decoders__ImageSlice, HostDecoderSlice, CPU);
3332

3433
} // namespace dali

dali/operators/decoder/host/host_decoder.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ void HostDecoder::RunImpl(SampleWorkspace &ws) {
5050
std::memcpy(out_data, decoded.get(), volume(shape));
5151
}
5252

53-
DALI_REGISTER_OPERATOR(decoders__Image, HostDecoder, CPU);
54-
DALI_REGISTER_OPERATOR(ImageDecoder, HostDecoder, CPU);
53+
DALI_REGISTER_OPERATOR(legacy__decoders__Image, HostDecoder, CPU);
5554

5655
} // namespace dali

dali/operators/decoder/image_decoder.cc

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ allocation might be useful to determine suitable values for `device_memory_paddi
163163
)code",
164164
false);
165165

166-
DALI_SCHEMA(decoders__Image)
166+
DALI_SCHEMA(legacy__decoders__Image)
167167
.DocStr(R"code(Decodes images.
168168
169169
For jpeg images, depending on the backend selected ("mixed" and "cpu"), the implementation uses
@@ -195,7 +195,7 @@ Please note that GPU acceleration for JPEG 2000 decoding is only available for C
195195

196196
// Fused
197197

198-
DALI_SCHEMA(decoders__ImageCrop)
198+
DALI_SCHEMA(legacy__decoders__ImageCrop)
199199
.DocStr(R"code(Decodes images and extracts regions-of-interest (ROI) that are specified
200200
by fixed window dimensions and variable anchors.
201201
@@ -219,7 +219,7 @@ Supported formats: JPG, BMP, PNG, TIFF, PNM, PPM, PGM, PBM, JPEG 2000, WebP.
219219
.AddParent("ImageDecoderAttr")
220220
.AddParent("CropAttr");
221221

222-
DALI_SCHEMA(decoders__ImageRandomCrop)
222+
DALI_SCHEMA(legacy__decoders__ImageRandomCrop)
223223
.DocStr(R"code(Decodes images and randomly crops them.
224224
225225
The cropping window's area (relative to the entire image) and aspect ratio can be restricted to
@@ -246,7 +246,7 @@ Supported formats: JPG, BMP, PNG, TIFF, PNM, PPM, PGM, PBM, JPEG 2000, WebP.
246246
.AddParent("RandomCropAttr");
247247

248248

249-
DALI_SCHEMA(decoders__ImageSlice)
249+
DALI_SCHEMA(legacy__decoders__ImageSlice)
250250
.DocStr(R"code(Decodes images and extracts regions of interest.
251251
252252
The slice can be specified by proving the start and end coordinates, or start coordinates
@@ -311,58 +311,4 @@ Integer coordinates are interpreted as absolute coordinates, while float coordin
311311
interpreted as absolute or relative coordinates, depending on the value of
312312
`normalized_shape`.)code");
313313

314-
315-
// Deprecated aliases
316-
317-
DALI_SCHEMA(ImageDecoder)
318-
.DocStr("Legacy alias for :meth:`decoders.image`.")
319-
.NumInput(1)
320-
.NumOutput(1)
321-
.AddParent("decoders__Image")
322-
.MakeDocPartiallyHidden()
323-
.Deprecate(
324-
"decoders__Image",
325-
R"code(In DALI 1.0 all decoders were moved into a dedicated :mod:`~nvidia.dali.fn.decoders`
326-
submodule and renamed to follow a common pattern. This is a placeholder operator with identical
327-
functionality to allow for backward compatibility.)code"); // Deprecated in 1.0
328-
329-
// Fused
330-
331-
DALI_SCHEMA(ImageDecoderCrop)
332-
.DocStr("Legacy alias for :meth:`decoders.image_crop`.")
333-
.NumInput(1)
334-
.NumOutput(1)
335-
.AddParent("decoders__ImageCrop")
336-
.MakeDocPartiallyHidden()
337-
.Deprecate(
338-
"decoders__ImageCrop",
339-
R"code(In DALI 1.0 all decoders were moved into a dedicated :mod:`~nvidia.dali.fn.decoders`
340-
submodule and renamed to follow a common pattern. This is a placeholder operator with identical
341-
functionality to allow for backward compatibility.)code"); // Deprecated in 1.0
342-
343-
DALI_SCHEMA(ImageDecoderRandomCrop)
344-
.DocStr("Legacy alias for :meth:`decoders.image_random_crop`.")
345-
.NumInput(1)
346-
.NumOutput(1)
347-
.AddParent("decoders__ImageRandomCrop")
348-
.MakeDocPartiallyHidden()
349-
.Deprecate(
350-
"decoders__ImageRandomCrop",
351-
R"code(In DALI 1.0 all decoders were moved into a dedicated :mod:`~nvidia.dali.fn.decoders`
352-
submodule and renamed to follow a common pattern. This is a placeholder operator with identical
353-
functionality to allow for backward compatibility.)code"); // Deprecated in 1.0
354-
355-
356-
DALI_SCHEMA(ImageDecoderSlice)
357-
.DocStr("Legacy alias for :meth:`decoders.image_slice`.")
358-
.NumInput(1, 3)
359-
.NumOutput(1)
360-
.AddParent("decoders__ImageSlice")
361-
.MakeDocPartiallyHidden()
362-
.Deprecate(
363-
"decoders__ImageSlice",
364-
R"code(In DALI 1.0 all decoders were moved into a dedicated :mod:`~nvidia.dali.fn.decoders`
365-
submodule and renamed to follow a common pattern. This is a placeholder operator with identical
366-
functionality to allow for backward compatibility.)code"); // Deprecated in 1.0
367-
368314
} // namespace dali

dali/operators/decoder/nvjpeg/fused/nvjpeg_decoder_crop.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
namespace dali {
1919

20-
DALI_REGISTER_OPERATOR(decoders__ImageCrop, nvJPEGDecoderCrop, Mixed);
21-
DALI_REGISTER_OPERATOR(ImageDecoderCrop, nvJPEGDecoderCrop, Mixed);
20+
DALI_REGISTER_OPERATOR(legacy__decoders__ImageCrop, nvJPEGDecoderCrop, Mixed);
2221

2322
} // namespace dali

dali/operators/decoder/nvjpeg/fused/nvjpeg_decoder_random_crop.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ nvJPEGDecoderRandomCrop::DeserializeCheckpoint(OpCheckpoint &cpt, const std::str
4141
SnapshotSerializer().Deserialize<std::vector<std::mt19937>>(data);
4242
}
4343

44-
DALI_REGISTER_OPERATOR(decoders__ImageRandomCrop, nvJPEGDecoderRandomCrop, Mixed);
45-
DALI_REGISTER_OPERATOR(ImageDecoderRandomCrop, nvJPEGDecoderRandomCrop, Mixed);
44+
DALI_REGISTER_OPERATOR(legacy__decoders__ImageRandomCrop, nvJPEGDecoderRandomCrop, Mixed);
4645

4746
} // namespace dali

dali/operators/decoder/nvjpeg/fused/nvjpeg_decoder_slice.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
namespace dali {
1919

20-
DALI_REGISTER_OPERATOR(decoders__ImageSlice, nvJPEGDecoderSlice, Mixed);
21-
DALI_REGISTER_OPERATOR(ImageDecoderSlice, nvJPEGDecoderSlice, Mixed);
20+
DALI_REGISTER_OPERATOR(legacy__decoders__ImageSlice, nvJPEGDecoderSlice, Mixed);
2221

2322
} // namespace dali

dali/operators/decoder/nvjpeg/nvjpeg_decoder_decoupled_api.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ bool nvjpegIsSymbolAvailable(const char *name) {
2424

2525
namespace dali {
2626

27-
DALI_REGISTER_OPERATOR(decoders__Image, nvJPEGDecoder, Mixed);
28-
DALI_REGISTER_OPERATOR(ImageDecoder, nvJPEGDecoder, Mixed);
27+
DALI_REGISTER_OPERATOR(legacy__decoders__Image, nvJPEGDecoder, Mixed);
2928

3029
} // namespace dali

dali/operators/decoder/peek_shape/peek_image_shape.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
namespace dali {
1818

19-
DALI_SCHEMA(PeekImageShape)
19+
DALI_SCHEMA(legacy__PeekImageShape)
2020
.DocStr(R"(Obtains the shape of the encoded image.
2121
2222
This operator returns the shape that an image would have after decoding.
@@ -32,6 +32,6 @@ This operator returns the shape that an image would have after decoding.
3232
R"code(Data type, to which the sizes are converted.)code", DALI_INT64)
3333
.DeprecateArgInFavorOf("type", "dtype"); // deprecated since 1.16dev
3434

35-
DALI_REGISTER_OPERATOR(PeekImageShape, PeekImageShape, CPU);
35+
DALI_REGISTER_OPERATOR(legacy__PeekImageShape, PeekImageShape, CPU);
3636

3737
} // namespace dali

0 commit comments

Comments
 (0)