NVIDIA DeepStream SDK API Reference

6.4 Release
nvinferserver

Detailed Description

Copyright (c) 2020, NVIDIA CORPORATION.

All rights reserved.

NVIDIA Corporation and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related documentation without an express license agreement from NVIDIA Corporation is strictly prohibited.

nvinferserver APIs

Data Structures

struct  NvDsInferObject
 Holds the information about one detected object. More...
 
struct  NvDsInferDetectionOutput
 Holds the information on all objects detected by a detector network in one frame. More...
 
struct  NvDsInferSegmentationOutput
 Holds the information parsed from segmentation network output for one frame. More...
 
struct  TritonClassParams
 

Namespaces

 nvdsinferserver
 Copyright (c) 2021, NVIDIA CORPORATION.
 

Files

file  infer_icontext.h
 Inference context library interface header file.
 

Macros

#define INFER_SERVER_PRIVATE_BUF   "@@NvInferServer"
 
#define INFER_SERVER_DETECTION_BUF_NAME   INFER_SERVER_PRIVATE_BUF "Detections"
 
#define INFER_SERVER_CLASSIFICATION_BUF_NAME   INFER_SERVER_PRIVATE_BUF "Classfications"
 
#define INFER_SERVER_SEGMENTATION_BUF_NAME   INFER_SERVER_PRIVATE_BUF "Segmentations"
 
void dsInferLogPrint__ (NvDsInferLogLevel level, const char *fmt,...)
 Copyright (c) 2019-2021, NVIDIA CORPORATION. More...
 
#define DISABLE_CLASS_COPY(NoCopyClass)
 Copyright (c) 2020, NVIDIA CORPORATION. More...
 
#define SIMPLE_MOVE_COPY(Cls)
 
#define INFER_UNUSED(a)   (void)(a)
 
#define INFER_LOG_FORMAT_(fmt)   "%s:%d " fmt, __FILE__, __LINE__
 
#define INFER_EXPORT_API   __attribute__((__visibility__("default")))
 
#define InferError(fmt, ...)
 
#define InferWarning(fmt, ...)
 
#define InferInfo(fmt, ...)
 
#define InferDebug(fmt, ...)
 
#define RETURN_IF_FAILED(condition, ret, fmt, ...)
 
#define CHECK_NVINFER_ERROR_PRINT(err, action, logPrint, fmt, ...)
 
#define CHECK_NVINFER_ERROR(err, action, fmt, ...)   CHECK_NVINFER_ERROR_PRINT(err, action, InferError, fmt, ##__VA_ARGS__)
 
#define RETURN_NVINFER_ERROR(err, fmt, ...)   CHECK_NVINFER_ERROR(err, return ifStatus, fmt, ##__VA_ARGS__)
 
#define CONTINUE_NVINFER_ERROR(err, fmt, ...)   CHECK_NVINFER_ERROR(err, , fmt, ##__VA_ARGS__)
 
#define CHECK_CUDA_ERR_W_ACTION(err, action, logPrint, fmt, ...)
 
#define CHECK_CUDA_ERR_NO_ACTION(err, fmt, ...)   CHECK_CUDA_ERR_W_ACTION(err, , InferError, fmt, ##__VA_ARGS__)
 
#define RETURN_CUDA_ERR(err, fmt, ...)
 
#define CONTINUE_CUDA_ERR(err, fmt, ...)   CHECK_CUDA_ERR_NO_ACTION(err, fmt, ##__VA_ARGS__)
 
#define READ_SYMBOL(lib, func_name)   lib->symbol<decltype(&func_name)>(#func_name)
 
#define DIVIDE_AND_ROUND_UP(a, b)   ((a + b - 1) / b)
 
#define INFER_ROUND_UP(value, align)   (((value) + (align)-1) & (~((align)-1)))
 
#define INFER_ROUND_DOWN(value, align)   ((value) & (~((align)-1)))
 
#define INFER_WILDCARD_DIM_VALUE   -1
 
#define INFER_MEM_ALIGNMENT   1024
 

Macro Definition Documentation

◆ CHECK_CUDA_ERR_NO_ACTION

#define CHECK_CUDA_ERR_NO_ACTION (   err,
  fmt,
  ... 
)    CHECK_CUDA_ERR_W_ACTION(err, , InferError, fmt, ##__VA_ARGS__)

Definition at line 113 of file infer_defines.h.

◆ CHECK_CUDA_ERR_W_ACTION

#define CHECK_CUDA_ERR_W_ACTION (   err,
  action,
  logPrint,
  fmt,
  ... 
)
Value:
do { \
cudaError_t errnum = (err); \
if (errnum != cudaSuccess) { \
logPrint(fmt ", cuda err_no:%d, err_str:%s", ##__VA_ARGS__, \
(int)errnum, cudaGetErrorName(errnum)); \
action; \
} \
} while (0)

Definition at line 103 of file infer_defines.h.

◆ CHECK_NVINFER_ERROR

#define CHECK_NVINFER_ERROR (   err,
  action,
  fmt,
  ... 
)    CHECK_NVINFER_ERROR_PRINT(err, action, InferError, fmt, ##__VA_ARGS__)

Definition at line 93 of file infer_defines.h.

◆ CHECK_NVINFER_ERROR_PRINT

#define CHECK_NVINFER_ERROR_PRINT (   err,
  action,
  logPrint,
  fmt,
  ... 
)
Value:
do { \
NvDsInferStatus ifStatus = (err); \
if (ifStatus != NVDSINFER_SUCCESS) { \
auto errStr = NvDsInferStatus2Str(ifStatus); \
logPrint(fmt ", nvinfer error:%s", ##__VA_ARGS__, errStr); \
action; \
} \
} while (0)

Definition at line 83 of file infer_defines.h.

◆ CONTINUE_CUDA_ERR

#define CONTINUE_CUDA_ERR (   err,
  fmt,
  ... 
)    CHECK_CUDA_ERR_NO_ACTION(err, fmt, ##__VA_ARGS__)

Definition at line 120 of file infer_defines.h.

◆ CONTINUE_NVINFER_ERROR

#define CONTINUE_NVINFER_ERROR (   err,
  fmt,
  ... 
)    CHECK_NVINFER_ERROR(err, , fmt, ##__VA_ARGS__)

Definition at line 99 of file infer_defines.h.

◆ DISABLE_CLASS_COPY

#define DISABLE_CLASS_COPY (   NoCopyClass)
Value:
NoCopyClass(const NoCopyClass&) = delete; \
void operator=(const NoCopyClass&) = delete

Copyright (c) 2020, NVIDIA CORPORATION.

All rights reserved.

NVIDIA Corporation and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related documentation without an express license agreement from NVIDIA Corporation is strictly prohibited.

Definition at line 30 of file infer_defines.h.

◆ DIVIDE_AND_ROUND_UP

#define DIVIDE_AND_ROUND_UP (   a,
 
)    ((a + b - 1) / b)

Definition at line 126 of file infer_defines.h.

◆ INFER_EXPORT_API

#define INFER_EXPORT_API   __attribute__((__visibility__("default")))

Definition at line 49 of file infer_defines.h.

◆ INFER_LOG_FORMAT_

#define INFER_LOG_FORMAT_ (   fmt)    "%s:%d " fmt, __FILE__, __LINE__

Definition at line 46 of file infer_defines.h.

◆ INFER_MEM_ALIGNMENT

#define INFER_MEM_ALIGNMENT   1024

Definition at line 130 of file infer_defines.h.

◆ INFER_ROUND_DOWN

#define INFER_ROUND_DOWN (   value,
  align 
)    ((value) & (~((align)-1)))

Definition at line 128 of file infer_defines.h.

◆ INFER_ROUND_UP

#define INFER_ROUND_UP (   value,
  align 
)    (((value) + (align)-1) & (~((align)-1)))

Definition at line 127 of file infer_defines.h.

◆ INFER_SERVER_CLASSIFICATION_BUF_NAME

#define INFER_SERVER_CLASSIFICATION_BUF_NAME   INFER_SERVER_PRIVATE_BUF "Classfications"

Definition at line 105 of file infer_post_datatypes.h.

◆ INFER_SERVER_DETECTION_BUF_NAME

#define INFER_SERVER_DETECTION_BUF_NAME   INFER_SERVER_PRIVATE_BUF "Detections"

Definition at line 104 of file infer_post_datatypes.h.

◆ INFER_SERVER_PRIVATE_BUF

#define INFER_SERVER_PRIVATE_BUF   "@@NvInferServer"

Definition at line 102 of file infer_post_datatypes.h.

◆ INFER_SERVER_SEGMENTATION_BUF_NAME

#define INFER_SERVER_SEGMENTATION_BUF_NAME   INFER_SERVER_PRIVATE_BUF "Segmentations"

Definition at line 107 of file infer_post_datatypes.h.

◆ INFER_UNUSED

#define INFER_UNUSED (   a)    (void)(a)

Definition at line 41 of file infer_defines.h.

◆ INFER_WILDCARD_DIM_VALUE

#define INFER_WILDCARD_DIM_VALUE   -1

Definition at line 129 of file infer_defines.h.

◆ InferDebug

#define InferDebug (   fmt,
  ... 
)
Value:
do { \
dsInferLogPrint__( \
NVDSINFER_LOG_DEBUG, INFER_LOG_FORMAT_(fmt), ##__VA_ARGS__); \
} while (0)

Definition at line 69 of file infer_defines.h.

◆ InferError

#define InferError (   fmt,
  ... 
)
Value:
do { \
dsInferLogPrint__( \
NVDSINFER_LOG_ERROR, INFER_LOG_FORMAT_(fmt), ##__VA_ARGS__); \
} while (0)

Definition at line 51 of file infer_defines.h.

◆ InferInfo

#define InferInfo (   fmt,
  ... 
)
Value:
do { \
dsInferLogPrint__( \
NVDSINFER_LOG_INFO, INFER_LOG_FORMAT_(fmt), ##__VA_ARGS__); \
} while (0)

Definition at line 63 of file infer_defines.h.

◆ InferWarning

#define InferWarning (   fmt,
  ... 
)
Value:
do { \
dsInferLogPrint__( \
NVDSINFER_LOG_WARNING, INFER_LOG_FORMAT_(fmt), ##__VA_ARGS__); \
} while (0)

Definition at line 57 of file infer_defines.h.

◆ READ_SYMBOL

#define READ_SYMBOL (   lib,
  func_name 
)    lib->symbol<decltype(&func_name)>(#func_name)

Definition at line 123 of file infer_defines.h.

◆ RETURN_CUDA_ERR

#define RETURN_CUDA_ERR (   err,
  fmt,
  ... 
)
Value:
err, return NVDSINFER_CUDA_ERROR, InferError, fmt, ##__VA_ARGS__)

Definition at line 116 of file infer_defines.h.

◆ RETURN_IF_FAILED

#define RETURN_IF_FAILED (   condition,
  ret,
  fmt,
  ... 
)
Value:
do { \
if (!(condition)) { \
InferError(fmt, ##__VA_ARGS__); \
return ret; \
} \
} while (0)

Definition at line 75 of file infer_defines.h.

◆ RETURN_NVINFER_ERROR

#define RETURN_NVINFER_ERROR (   err,
  fmt,
  ... 
)    CHECK_NVINFER_ERROR(err, return ifStatus, fmt, ##__VA_ARGS__)

Definition at line 96 of file infer_defines.h.

◆ SIMPLE_MOVE_COPY

#define SIMPLE_MOVE_COPY (   Cls)
Value:
Cls& operator=(Cls&& o) { \
move_copy(std::move(o)); \
return *this; \
} \
Cls(Cls&& o) { move_copy(std::move(o)); }

Definition at line 34 of file infer_defines.h.

Function Documentation

◆ dsInferLogPrint__()

void dsInferLogPrint__ ( NvDsInferLogLevel  level,
const char *  fmt,
  ... 
)
inline

Copyright (c) 2019-2021, NVIDIA CORPORATION.

Print the nvinferserver log messages as per the configured log level.

All rights reserved.

NVIDIA Corporation and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related documentation without an express license agreement from NVIDIA Corporation is strictly prohibited.

Definition at line 31 of file infer_options.h.

INFER_LOG_FORMAT_
#define INFER_LOG_FORMAT_(fmt)
Definition: infer_defines.h:46
NVDSINFER_LOG_ERROR
@ NVDSINFER_LOG_ERROR
Definition: nvdsinfer.h:250
NVDSINFER_SUCCESS
@ NVDSINFER_SUCCESS
NvDsInferContext operation succeeded.
Definition: nvdsinfer.h:220
NVDSINFER_LOG_INFO
@ NVDSINFER_LOG_INFO
Definition: nvdsinfer.h:252
NVDSINFER_LOG_WARNING
@ NVDSINFER_LOG_WARNING
Definition: nvdsinfer.h:251
NVDSINFER_CUDA_ERROR
@ NVDSINFER_CUDA_ERROR
CUDA error was encountered.
Definition: nvdsinfer.h:231
NVDSINFER_LOG_DEBUG
@ NVDSINFER_LOG_DEBUG
Definition: nvdsinfer.h:253
NvDsInferStatus2Str
const INFER_EXPORT_API char * NvDsInferStatus2Str(NvDsInferStatus status)
Returns the NvDsInferStatus enum name as a string.
CHECK_CUDA_ERR_W_ACTION
#define CHECK_CUDA_ERR_W_ACTION(err, action, logPrint, fmt,...)
Definition: infer_defines.h:103
InferError
#define InferError(fmt,...)
Definition: infer_defines.h:51