Go to the source code of this file.
Functions | |
| 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 (like nvinfer SGIE does) More... | |
| 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. More... | |
| int | rgb_surface_to_tensor (NvBufSurface *rgb_surface, float *output_tensor, guint num_images, guint width, guint height, gboolean use_siglip_normalization) |
| 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). More... | |
| int | rgba_surface_to_tensor (NvBufSurface *rgba_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). More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| void | unmap_nvbufsurface (NvBufSurface *surf, unsigned int buf_idx) |
| Unmap NvBufSurface after use. More... | |
| 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.
| 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.
batch_ids[i] = frame batch_id for object i. output_for_gpu: if TRUE, call SyncForDevice (next step is GPU); if FALSE, SyncForCpu (avoids unnecessary D2H sync on device path).
| 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.
| nv12_surface | Device pointer to NV12 surface |
| surface_width | Width of the surface |
| surface_height | Height of the surface |
| surface_pitch | Pitch (stride) of the surface |
| crop_boxes | Host array of crop boxes [num_crops, 4] (left, top, width, height) |
| num_crops | Number of crops |
| output | Device pointer for output [num_crops, 3, target_h, target_w] |
| target_width | Target width for each crop |
| target_height | Target height for each crop |
| stream | CUDA stream |
| 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_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 (like nvinfer SGIE does)
| int rgb_surface_to_tensor | ( | NvBufSurface * | rgb_surface, |
| float * | output_tensor, | ||
| guint | num_images, | ||
| guint | width, | ||
| guint | height, | ||
| gboolean | use_siglip_normalization | ||
| ) |
| 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).
Use with nvds_triton_client_infer_device for FPS.
| int rgba_surface_to_tensor | ( | NvBufSurface * | rgba_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).
Use with nvds_triton_client_infer_device for FPS.
| void unmap_nvbufsurface | ( | NvBufSurface * | surf, |
| unsigned int | buf_idx | ||
| ) |
Unmap NvBufSurface after use.