nvidia.dali.fn ~~~~~~~~~~~~~~ The following table lists all operations available in ``nvidia.dali.fn`` module: .. currentmodule:: nvidia.dali.fn ======================================================================================================== ================================================ ====================================================================================================================================================== Function Device support Short description ======================================================================================================== ================================================ ====================================================================================================================================================== :meth:`audio_decoder ` CPU Legacy alias for :meth:`decoders.audio`. :meth:`audio_resample ` CPU, GPU Resamples an audio signal. :meth:`batch_permutation ` CPU Produces a batch of random integers which can be used as indices for indexing samples in the batch. :meth:`bb_flip ` CPU, GPU Flips bounding boxes horizontally or vertically (mirror). :meth:`bbox_paste ` CPU Transforms bounding boxes so that the boxes remain in the same place in the image after the image is pasted on a larger canvas. :meth:`bbox_rotate ` CPU Transforms bounding boxes so that the boxes remain in the same place in the image after the image is rotated. Boxes that land outside the image with ``keep_size=True`` will be removed from the output if the fraction of the remaining box after cropping is less than ``remove_threshold``. If ``labels`` are passed as a second argument, they will also be removed synchronously. :meth:`box_encoder ` CPU, GPU Encodes the input bounding boxes and labels using a set of default boxes (anchors) passed as an argument. :meth:`brightness ` CPU, GPU Adjusts the brightness of the images. :meth:`brightness_contrast ` CPU, GPU Adjusts the brightness and contrast of the images. :meth:`caffe2_reader ` CPU Legacy alias for :meth:`readers.caffe2`. :meth:`caffe_reader ` CPU Legacy alias for :meth:`readers.caffe`. :meth:`cast ` CPU, GPU Cast a tensor to a different type. :meth:`cast_like ` CPU, GPU Cast the first tensor to the type of the second tensor. :meth:`cat ` CPU, GPU Joins the input tensors along an existing axis. :meth:`clahe ` CPU, GPU Contrast Limited Adaptive Histogram Equalization (CLAHE) operator. Performs local histogram equalization with clipping and bilinear blending of lookup tables (LUTs) between neighboring tiles. This technique enhances local contrast while preventing over-amplification of noise. Attempts to use same algorithm as OpenCV (https://docs.opencv.org/4.x/d5/daf/tutorial_py_histogram_equalization.html). The input image is divided into rectangular tiles, and histogram equalization is applied to each tile independently. To avoid artifacts at tile boundaries, the lookup tables are bilinearly interpolated between neighboring tiles. Supports both grayscale (1-channel) and RGB (3-channel) uint8 images in HWC layout. :meth:`coco_reader ` CPU Legacy alias for :meth:`readers.coco`. :meth:`coin_flip ` CPU, GPU Generates random boolean values following a bernoulli distribution. :meth:`color_space_conversion ` CPU, GPU Converts between various image color models. :meth:`color_twist ` CPU, GPU Adjusts hue, saturation, brightness and contrast of the image. :meth:`contrast ` CPU, GPU Adjusts the contrast of the images. :meth:`coord_flip ` CPU, GPU Transforms vectors or points by flipping (reflecting) their coordinates with respect to a given center. :meth:`coord_transform ` CPU, GPU Applies a linear transformation to points or vectors. :meth:`copy ` CPU, GPU Creates a copy of the input tensor. :meth:`crop ` CPU, GPU Crops the images with the specified window dimensions and window position (upper left corner). :meth:`crop_mirror_normalize ` CPU, GPU Performs fused cropping, normalization, format conversion (NHWC to NCHW) if desired, and type casting. :meth:`dl_tensor_python_function ` CPU, GPU Executes a Python function that operates on DLPack tensors. :meth:`dump_image ` CPU, GPU Save images in batch to disk in PPM format. :meth:`element_extract ` CPU, GPU Extracts one or more elements from input sequence. :meth:`erase ` CPU, GPU Erases one or more regions from the input tensors. :meth:`expand_dims ` CPU, GPU Insert new dimension(s) with extent 1 to the data shape. :meth:`external_source ` CPU, GPU Allows externally provided data to be passed as an input to the pipeline. :meth:`fast_resize_crop_mirror ` CPU, GPU Legacy alias for ResizedCropMirror, with antialiasing disabled by default. :meth:`file_reader ` CPU Legacy alias for :meth:`readers.file`. :meth:`flip ` CPU, GPU Flips the images in selected dimensions (horizontal, vertical, and depthwise). :meth:`full ` CPU Returns new data of given shape and type, filled with a fill value. :meth:`full_like ` CPU Returns new data with the same shape and type as the input data, filled with a `fill_value`. :meth:`gaussian_blur ` CPU, GPU Applies a Gaussian Blur to the input. :meth:`get_property ` CPU, GPU Returns a property of the tensor passed as an input. :meth:`grid_mask ` CPU, GPU Performs the gridmask augmentation (https://arxiv.org/abs/2001.04086). :meth:`hsv ` CPU, GPU Adjusts hue, saturation and value (brightness) of the images. :meth:`hue ` CPU, GPU Changes the hue level of the image. :meth:`image_decoder ` CPU, Mixed Legacy alias for :meth:`decoders.image`. :meth:`image_decoder_crop ` CPU, Mixed Legacy alias for :meth:`decoders.image_crop`. :meth:`image_decoder_random_crop ` CPU, Mixed Legacy alias for :meth:`decoders.image_random_crop`. :meth:`image_decoder_slice ` CPU, Mixed Legacy alias for :meth:`decoders.image_slice`. :meth:`jitter ` GPU Performs a random Jitter augmentation. :meth:`jpeg_compression_distortion ` CPU, GPU Introduces JPEG compression artifacts to RGB images. :meth:`laplacian ` CPU, GPU Computes the Laplacian of an input. :meth:`lookup_table ` CPU, GPU Maps the input to output by using a lookup table that is specified by `keys` and `values`, and a `default_value` for unspecified keys. :meth:`mel_filter_bank ` CPU, GPU Converts a spectrogram to a mel spectrogram by applying a bank of triangular filters. :meth:`mfcc ` CPU, GPU Computes Mel Frequency Cepstral Coefficients (MFCC) from a mel spectrogram. :meth:`multi_paste ` CPU, GPU Performs multiple pastes from image batch to each of the outputs. :meth:`mxnet_reader ` CPU Legacy alias for :meth:`readers.mxnet`. :meth:`nemo_asr_reader ` CPU Legacy alias for :meth:`readers.nemo_asr`. :meth:`nonsilent_region ` CPU, GPU Performs leading and trailing silence detection in an audio buffer. :meth:`normal_distribution ` CPU, GPU Generates random numbers following a normal distribution. :meth:`normalize ` CPU, GPU Normalizes the input by removing the mean and dividing by the standard deviation. :meth:`numba_function ` CPU, GPU Invokes a njit compiled Numba function. :meth:`numpy_reader ` CPU, GPU Legacy alias for :meth:`readers.numpy`. :meth:`one_hot ` CPU, GPU Produces a one-hot encoding of the input. :meth:`ones ` CPU Returns new data of given shape and type, filled with ones. :meth:`ones_like ` CPU Returns new data with the same shape and type as the input array, filled with ones. :meth:`optical_flow ` GPU Calculates the optical flow between images in the input. :meth:`pad ` CPU, GPU Pads all samples with the `fill_value` in the specified axes to match the biggest extent in the batch for those axes or to match the minimum shape specified. :meth:`paste ` CPU, GPU Pastes the input images on a larger canvas, where the canvas size is equal to ``input size * ratio``. Only uint8 images of up to 1024 channels are supported. :meth:`peek_image_shape ` CPU Obtains the shape of the encoded image. :meth:`per_frame ` CPU, GPU Marks the input tensor as a sequence. :meth:`permute_batch ` CPU, GPU Returns a batch of tensors constructed by selecting tensors from the input based on indices given in `indices` argument. :meth:`power_spectrum ` CPU Calculates power spectrum of the signal. :meth:`preemphasis_filter ` CPU, GPU Applies preemphasis filter to the input data. :meth:`python_function ` CPU, GPU Executes a Python function. :meth:`random_bbox_crop ` CPU Applies a prospective random crop to an image coordinate space while keeping the bounding boxes, and optionally labels, consistent. :meth:`random_crop_generator ` CPU Produces a cropping window with a randomly selected area and aspect ratio. :meth:`random_resized_crop ` CPU, GPU Performs a crop with a randomly selected area and aspect ratio and resizes it to the specified size. :meth:`reinterpret ` CPU, GPU Treats content of the input as if it had a different type, shape, and/or layout. :meth:`reshape ` CPU, GPU Treats content of the input as if it had a different shape and/or layout. :meth:`resize ` CPU, GPU Resize images. :meth:`resize_crop_mirror ` CPU, GPU Performs a fused resize, crop, mirror operation. :meth:`roi_random_crop ` CPU Produces a fixed shape cropping window, randomly placed so that as much of the provided region of interest (ROI) is contained in it. :meth:`rotate ` CPU, GPU Rotates the images by the specified angle. :meth:`saturation ` CPU, GPU Changes the saturation level of the image. :meth:`sequence_reader ` CPU Legacy alias for :meth:`readers.sequence`. :meth:`sequence_rearrange ` CPU, GPU Rearranges frames in a sequence. :meth:`shapes ` CPU, GPU Returns the shapes of tensors in the input batch. :meth:`slice ` CPU, GPU Extracts a subtensor, or slice. :meth:`spectrogram ` CPU, GPU Produces a spectrogram from a 1D signal (for example, audio). :meth:`sphere ` CPU, GPU Performs a sphere augmentation. :meth:`squeeze ` CPU, GPU Removes the dimensions given as `axes` or `axis_names`. :meth:`ssd_random_crop ` CPU Performs a random crop with bounding boxes where Intersection Over Union (IoU) meets a randomly selected threshold between 0-1. :meth:`stack ` CPU, GPU Joins the input tensors along a new axis. :meth:`tfrecord_reader ` CPU Legacy alias for :meth:`readers.tfrecord`. :meth:`to_decibels ` CPU, GPU Converts a magnitude (real, positive) to the decibel scale. :meth:`torch_python_function ` CPU, GPU Executes a function that is operating on Torch tensors. :meth:`transpose ` CPU, GPU Transposes the tensors by reordering the dimensions based on the `perm` parameter. :meth:`uniform ` CPU, GPU Generates random numbers following a uniform distribution. :meth:`video_reader ` GPU Legacy alias for :meth:`readers.video`. :meth:`video_reader_resize ` GPU Legacy alias for :meth:`readers.video_resize`. :meth:`warp_affine ` CPU, GPU Applies an affine transformation to the images. :meth:`water ` CPU, GPU Performs a water augmentation, which makes the image appear to be underwater. :meth:`zeros ` CPU Returns new data of given shape and type, filled with zeros. :meth:`zeros_like ` CPU Returns new data with the same shape and type as the input array, filled with zeros. ======================================================================================================== ================================================ ====================================================================================================================================================== .. toctree:: :hidden: nvidia.dali.fn.audio_decoder nvidia.dali.fn.audio_resample nvidia.dali.fn.batch_permutation nvidia.dali.fn.bb_flip nvidia.dali.fn.bbox_paste nvidia.dali.fn.bbox_rotate nvidia.dali.fn.box_encoder nvidia.dali.fn.brightness nvidia.dali.fn.brightness_contrast nvidia.dali.fn.caffe2_reader nvidia.dali.fn.caffe_reader nvidia.dali.fn.cast nvidia.dali.fn.cast_like nvidia.dali.fn.cat nvidia.dali.fn.clahe nvidia.dali.fn.coco_reader nvidia.dali.fn.coin_flip nvidia.dali.fn.color_space_conversion nvidia.dali.fn.color_twist nvidia.dali.fn.contrast nvidia.dali.fn.coord_flip nvidia.dali.fn.coord_transform nvidia.dali.fn.copy nvidia.dali.fn.crop nvidia.dali.fn.crop_mirror_normalize nvidia.dali.fn.dl_tensor_python_function nvidia.dali.fn.dump_image nvidia.dali.fn.element_extract nvidia.dali.fn.erase nvidia.dali.fn.expand_dims nvidia.dali.fn.external_source nvidia.dali.fn.fast_resize_crop_mirror nvidia.dali.fn.file_reader nvidia.dali.fn.flip nvidia.dali.fn.full nvidia.dali.fn.full_like nvidia.dali.fn.gaussian_blur nvidia.dali.fn.get_property nvidia.dali.fn.grid_mask nvidia.dali.fn.hsv nvidia.dali.fn.hue nvidia.dali.fn.image_decoder nvidia.dali.fn.image_decoder_crop nvidia.dali.fn.image_decoder_random_crop nvidia.dali.fn.image_decoder_slice nvidia.dali.fn.jitter nvidia.dali.fn.jpeg_compression_distortion nvidia.dali.fn.laplacian nvidia.dali.fn.lookup_table nvidia.dali.fn.mel_filter_bank nvidia.dali.fn.mfcc nvidia.dali.fn.multi_paste nvidia.dali.fn.mxnet_reader nvidia.dali.fn.nemo_asr_reader nvidia.dali.fn.nonsilent_region nvidia.dali.fn.normal_distribution nvidia.dali.fn.normalize nvidia.dali.fn.numba_function nvidia.dali.fn.numpy_reader nvidia.dali.fn.one_hot nvidia.dali.fn.ones nvidia.dali.fn.ones_like nvidia.dali.fn.optical_flow nvidia.dali.fn.pad nvidia.dali.fn.paste nvidia.dali.fn.peek_image_shape nvidia.dali.fn.per_frame nvidia.dali.fn.permute_batch nvidia.dali.fn.power_spectrum nvidia.dali.fn.preemphasis_filter nvidia.dali.fn.python_function nvidia.dali.fn.random_bbox_crop nvidia.dali.fn.random_crop_generator nvidia.dali.fn.random_resized_crop nvidia.dali.fn.reinterpret nvidia.dali.fn.reshape nvidia.dali.fn.resize nvidia.dali.fn.resize_crop_mirror nvidia.dali.fn.roi_random_crop nvidia.dali.fn.rotate nvidia.dali.fn.saturation nvidia.dali.fn.sequence_reader nvidia.dali.fn.sequence_rearrange nvidia.dali.fn.shapes nvidia.dali.fn.slice nvidia.dali.fn.spectrogram nvidia.dali.fn.sphere nvidia.dali.fn.squeeze nvidia.dali.fn.ssd_random_crop nvidia.dali.fn.stack nvidia.dali.fn.tfrecord_reader nvidia.dali.fn.to_decibels nvidia.dali.fn.torch_python_function nvidia.dali.fn.transpose nvidia.dali.fn.uniform nvidia.dali.fn.video_reader nvidia.dali.fn.video_reader_resize nvidia.dali.fn.warp_affine nvidia.dali.fn.water nvidia.dali.fn.zeros nvidia.dali.fn.zeros_like