Structure to define the input options for deep learning inference. More...
Types | |
| enum class | COLOR_FORMAT |
| Lists available color formats for the Tensor. More... | |
| enum class | LAYOUT |
| Lists available memory layouts for the Tensor. More... | |
| enum class | PIXEL_TYPE : int |
| Lists available pixel data types for the Tensor elements. More... | |
Functions | |
| size_t | getPixelSize () const |
| Returns the size in bytes of a single pixel element based on pixel_type. More... | |
| int | getRequestedChannels () const |
| Returns the number of channels associated with the color_format. More... | |
Attributes | |
| sl::Resolution | target_size = sl::Resolution(640, 640) |
| Target size for the input image (Width, Height). More... | |
| PIXEL_TYPE | pixel_type = PIXEL_TYPE::FLOAT |
| Pixel data type for the Tensor elements. More... | |
| sl::float3 | mean = {0.485f, 0.456f, 0.406f} |
| Normalization parameter: Mean. More... | |
| sl::float3 | std = {0.229f, 0.224f, 0.225f} |
| Normalization parameter: Standard Deviation. More... | |
| bool | stretch = false |
| If true, stretches the image to target_size. If false, keeps aspect ratio and applies letterboxing (padding). More... | |
| sl::float3 | scale = {1.f / 255.f, 1.f / 255.f, 1.f / 255.f} |
| Scale factor applied to the pixel values before normalization. More... | |
| COLOR_FORMAT | color_format = COLOR_FORMAT::BGR |
| Desired color format for the output Tensor. More... | |
| LAYOUT | layout = LAYOUT::NCHW |
| Desired memory layout for the output Tensor. More... | |
| size_t | batch_size = 1 |
| Number of images in the batch. More... | |
| MEM | memory_type = MEM::GPU |
| Where the Tensor should be stored (CPU or GPU). More... | |
Structure to define the input options for deep learning inference.
|
strong |
Lists available color formats for the Tensor.
| Enumerator | |
|---|---|
| GRAY | 1-channel Grayscale. |
| Y | 1-channel Y (Luminance) from YUV. |
| RGB | 3-channel RGB. |
| BGR | 3-channel BGR. |
| RGBA | 4-channel RGBA. |
| BGRA | 4-channel BGRA. |
|
strong |
Lists available memory layouts for the Tensor.
| Enumerator | |
|---|---|
| NCHW | Batch, Channels, Height, Width (Planar). Common for PyTorch models. |
| NHWC | Batch, Height, Width, Channels (Interleaved). Common for TensorFlow models. |
|
strong |
Lists available pixel data types for the Tensor elements.
| Enumerator | |
|---|---|
| FLOAT | 32-bit floating point. |
| HALF | 16-bit floating point (half precision). |
| UCHAR | Unsigned char (8-bit). |
|
inline |
Returns the size in bytes of a single pixel element based on pixel_type.
|
inline |
Returns the number of channels associated with the color_format.
| sl::Resolution target_size = sl::Resolution(640, 640) |
Target size for the input image (Width, Height).
| PIXEL_TYPE pixel_type = PIXEL_TYPE::FLOAT |
Pixel data type for the Tensor elements.
| sl::float3 mean = {0.485f, 0.456f, 0.406f} |
Normalization parameter: Mean.
| sl::float3 std = {0.229f, 0.224f, 0.225f} |
Normalization parameter: Standard Deviation.
| bool stretch = false |
If true, stretches the image to target_size. If false, keeps aspect ratio and applies letterboxing (padding).
| sl::float3 scale = {1.f / 255.f, 1.f / 255.f, 1.f / 255.f} |
Scale factor applied to the pixel values before normalization.
| COLOR_FORMAT color_format = COLOR_FORMAT::BGR |
Desired color format for the output Tensor.
| LAYOUT layout = LAYOUT::NCHW |
Desired memory layout for the output Tensor.
| size_t batch_size = 1 |
Number of images in the batch.