|
|
NVIDIA DeepStream SDK API Reference
|
9.0 Release
|
Go to the documentation of this file.
13 #ifndef __PREPROCESS_H__
14 #define __PREPROCESS_H__
16 #include <cuda_runtime.h>
18 #include "nvbufsurface.h"
19 #include "nvbufsurftransform.h"
51 const guint *batch_ids,
62 gboolean output_for_gpu);
70 gboolean use_siglip_normalization);
75 float *d_output_tensor,
79 gboolean use_siglip_normalization);
87 gboolean use_siglip_normalization);
92 float *d_output_tensor,
96 gboolean use_siglip_normalization);
102 const void* rgba_surface,
106 const float* crop_boxes,
130 const void* nv12_surface,
134 const float* crop_boxes,
157 #endif // __PREPROCESS_H__
int preprocess_with_nvbufsurftransform(NvBufSurface *input_surface, guint batch_id, NvDsObjectMeta **obj_meta_array, guint num_objects, NvBufSurface *prealloc_output_surface, guint target_width, guint target_height, guint gpu_id, guint max_batch_size, NvBufSurfaceParams *prealloc_surf_list, NvBufSurfTransformRect *prealloc_src_rect, NvBufSurfTransformRect *prealloc_dst_rect)
NEW SGIE-style preprocessing using NvBufSurfTransform Uses pre-allocated buffers and output surface (...
void unmap_nvbufsurface(NvBufSurface *surf, unsigned int buf_idx)
Unmap NvBufSurface after use.
void * get_nvbufsurface_device_ptr(NvBufSurface *surf, unsigned int buf_idx)
Map and get device pointer from NvBufSurface Note: Caller must call unmap_nvbufsurface after use.
Holds information about batched buffers.
int rgb_surface_to_tensor_device(NvBufSurface *rgb_surface, float *d_output_tensor, guint num_images, guint width, guint height, gboolean use_siglip_normalization)
GPU path: write tensor on device (no D2H).
Hold the information of single buffer in the batch.
int preprocess_batch_with_nvbufsurftransform(NvBufSurface *input_surface, const guint *batch_ids, NvDsObjectMeta **obj_meta_array, guint num_objects, NvBufSurface *prealloc_output_surface, guint target_width, guint target_height, guint gpu_id, guint max_batch_size, NvBufSurfaceParams *prealloc_surf_list, NvBufSurfTransformRect *prealloc_src_rect, NvBufSurfTransformRect *prealloc_dst_rect, gboolean output_for_gpu)
Single-call batch preprocess (SGIE-style): all objects from all frames in one NvBufSurfTransform.
int rgb_surface_to_tensor(NvBufSurface *rgb_surface, float *output_tensor, guint num_images, guint width, guint height, gboolean use_siglip_normalization)
int rgba_surface_to_tensor_device(NvBufSurface *rgba_surface, float *d_output_tensor, guint num_images, guint width, guint height, gboolean use_siglip_normalization)
GPU path for RGBA: write tensor on device (no D2H).
int rgba_surface_to_tensor(NvBufSurface *rgba_surface, float *output_tensor, guint num_images, guint width, guint height, gboolean use_siglip_normalization)
int preprocess_crops_rgba(const void *rgba_surface, int surface_width, int surface_height, int surface_pitch, const float *crop_boxes, int num_crops, float *output, int target_width, int target_height, cudaStream_t stream)
LEGACY: Preprocess multiple crops from an RGBA surface.
int preprocess_crops_nv12(const void *nv12_surface, int surface_width, int surface_height, int surface_pitch, const float *crop_boxes, int num_crops, float *output, int target_width, int target_height, cudaStream_t stream)
Preprocess multiple crops from an NV12 surface.