Jetson Inference
DNN Vision Library

Pose estimation DNN. More...

Classes

class  poseNet
 Pose estimation models with TensorRT support. More...
 

Macros

#define POSENET_DEFAULT_INPUT   "input"
 Name of default input blob for pose estimation ONNX model. More...
 
#define POSENET_DEFAULT_CMAP   "cmap"
 Name of default output blob of the confidence map for pose estimation ONNX model. More...
 
#define POSENET_DEFAULT_PAF   "paf"
 Name of default output blob of the Part Affinity Field (PAF) for pose estimation ONNX model. More...
 
#define POSENET_DEFAULT_THRESHOLD   0.15f
 Default value of the minimum confidence threshold. More...
 
#define POSENET_DEFAULT_KEYPOINT_SCALE   0.0052f
 Default scale used for drawing keypoint circles. More...
 
#define POSENET_DEFAULT_LINK_SCALE   0.0013f
 Default scale used for drawing link lines. More...
 
#define POSENET_MODEL_TYPE   "pose"
 The model type for poseNet in data/networks/models.json. More...
 

Detailed Description

Pose estimation DNN.


Class Documentation

◆ poseNet

class poseNet

Pose estimation models with TensorRT support.

Inheritance diagram for poseNet:
tensorNet

Public Types

enum  OverlayFlags {
  OVERLAY_NONE = 0, OVERLAY_BOX = (1 << 0), OVERLAY_LINKS = (1 << 1), OVERLAY_KEYPOINTS = (1 << 2),
  OVERLAY_DEFAULT = OVERLAY_LINKS|OVERLAY_KEYPOINTS
}
 Overlay flags (can be OR'd together). More...
 

Public Member Functions

virtual ~poseNet ()
 Destory. More...
 
template<typename T >
bool Process (T *image, uint32_t width, uint32_t height, std::vector< ObjectPose > &poses, uint32_t overlay=OVERLAY_DEFAULT)
 Perform pose estimation on the given image, returning object poses, and overlay the results. More...
 
bool Process (void *image, uint32_t width, uint32_t height, imageFormat format, std::vector< ObjectPose > &poses, uint32_t overlay=OVERLAY_DEFAULT)
 Perform pose estimation on the given image, and overlay the results. More...
 
template<typename T >
bool Process (T *image, uint32_t width, uint32_t height, uint32_t overlay=OVERLAY_DEFAULT)
 Perform pose estimation on the given image, and overlay the results. More...
 
bool Process (void *image, uint32_t width, uint32_t height, imageFormat format, uint32_t overlay=OVERLAY_DEFAULT)
 Perform pose estimation on the given image, and overlay the results. More...
 
template<typename T >
bool Overlay (T *input, T *output, uint32_t width, uint32_t height, const std::vector< ObjectPose > &poses, uint32_t overlay=OVERLAY_DEFAULT)
 Overlay the results on the image. More...
 
bool Overlay (void *input, void *output, uint32_t width, uint32_t height, imageFormat format, const std::vector< ObjectPose > &poses, uint32_t overlay=OVERLAY_DEFAULT)
 Overlay the results on the image. More...
 
float GetThreshold () const
 Retrieve the minimum confidence threshold. More...
 
void SetThreshold (float threshold)
 Set the minimum confidence threshold. More...
 
const char * GetCategory () const
 Get the category of objects that are detected (e.g. More...
 
uint32_t GetNumKeypoints () const
 Get the number of keypoints in the topology. More...
 
const char * GetKeypointName (uint32_t index) const
 Get the name of a keypoint in the topology by it's ID. More...
 
int FindKeypointID (const char *name) const
 Find the ID of a keypoint by name, or return -1 if not found. More...
 
float4 GetKeypointColor (uint32_t index) const
 Get the overlay color of a keypoint. More...
 
void SetKeypointColor (uint32_t index, const float4 &color)
 Set the overlay color for a keypoint. More...
 
void SetKeypointAlpha (uint32_t index, float alpha)
 Set the alpha channel for a keypoint color (between 0-255). More...
 
void SetKeypointAlpha (float alpha)
 Set the alpha channel for all keypoints colors used during overlay. More...
 
float GetKeypointScale () const
 Get the scale used to calculate the radius of keypoints relative to input image dimensions. More...
 
void SetKeypointScale (float scale)
 Set the scale used to calculate the radius of keypoint circles. More...
 
float GetLinkScale () const
 Get the scale used to calculate the width of link lines relative to input image dimensions. More...
 
void SetLinkScale (float scale)
 Set the scale used to calculate the width of link lines. More...
 
- Public Member Functions inherited from tensorNet
virtual ~tensorNet ()
 Destory. More...
 
bool LoadNetwork (const char *prototxt, const char *model, const char *mean=NULL, const char *input_blob="data", const char *output_blob="prob", uint32_t maxBatchSize=DEFAULT_MAX_BATCH_SIZE, precisionType precision=TYPE_FASTEST, deviceType device=DEVICE_GPU, bool allowGPUFallback=true, nvinfer1::IInt8Calibrator *calibrator=NULL, cudaStream_t stream=NULL)
 Load a new network instance. More...
 
bool LoadNetwork (const char *prototxt, const char *model, const char *mean, const char *input_blob, const std::vector< std::string > &output_blobs, uint32_t maxBatchSize=DEFAULT_MAX_BATCH_SIZE, precisionType precision=TYPE_FASTEST, deviceType device=DEVICE_GPU, bool allowGPUFallback=true, nvinfer1::IInt8Calibrator *calibrator=NULL, cudaStream_t stream=NULL)
 Load a new network instance with multiple output layers. More...
 
bool LoadNetwork (const char *prototxt, const char *model, const char *mean, const std::vector< std::string > &input_blobs, const std::vector< std::string > &output_blobs, uint32_t maxBatchSize=DEFAULT_MAX_BATCH_SIZE, precisionType precision=TYPE_FASTEST, deviceType device=DEVICE_GPU, bool allowGPUFallback=true, nvinfer1::IInt8Calibrator *calibrator=NULL, cudaStream_t stream=NULL)
 Load a new network instance with multiple input layers. More...
 
bool LoadNetwork (const char *prototxt, const char *model, const char *mean, const char *input_blob, const Dims3 &input_dims, const std::vector< std::string > &output_blobs, uint32_t maxBatchSize=DEFAULT_MAX_BATCH_SIZE, precisionType precision=TYPE_FASTEST, deviceType device=DEVICE_GPU, bool allowGPUFallback=true, nvinfer1::IInt8Calibrator *calibrator=NULL, cudaStream_t stream=NULL)
 Load a new network instance (this variant is used for UFF models) More...
 
bool LoadNetwork (const char *prototxt, const char *model, const char *mean, const std::vector< std::string > &input_blobs, const std::vector< Dims3 > &input_dims, const std::vector< std::string > &output_blobs, uint32_t maxBatchSize=DEFAULT_MAX_BATCH_SIZE, precisionType precision=TYPE_FASTEST, deviceType device=DEVICE_GPU, bool allowGPUFallback=true, nvinfer1::IInt8Calibrator *calibrator=NULL, cudaStream_t stream=NULL)
 Load a new network instance with multiple input layers (used for UFF models) More...
 
bool LoadEngine (const char *engine_filename, const std::vector< std::string > &input_blobs, const std::vector< std::string > &output_blobs, nvinfer1::IPluginFactory *pluginFactory=NULL, deviceType device=DEVICE_GPU, cudaStream_t stream=NULL)
 Load a network instance from a serialized engine plan file. More...
 
bool LoadEngine (char *engine_stream, size_t engine_size, const std::vector< std::string > &input_blobs, const std::vector< std::string > &output_blobs, nvinfer1::IPluginFactory *pluginFactory=NULL, deviceType device=DEVICE_GPU, cudaStream_t stream=NULL)
 Load a network instance from a serialized engine plan file. More...
 
bool LoadEngine (nvinfer1::ICudaEngine *engine, const std::vector< std::string > &input_blobs, const std::vector< std::string > &output_blobs, deviceType device=DEVICE_GPU, cudaStream_t stream=NULL)
 Load network resources from an existing TensorRT engine instance. More...
 
bool LoadEngine (const char *filename, char **stream, size_t *size)
 Load a serialized engine plan file into memory. More...
 
void EnableLayerProfiler ()
 Manually enable layer profiling times. More...
 
void EnableDebug ()
 Manually enable debug messages and synchronization. More...
 
bool AllowGPUFallback () const
 Return true if GPU fallback is enabled. More...
 
deviceType GetDevice () const
 Retrieve the device being used for execution. More...
 
precisionType GetPrecision () const
 Retrieve the type of precision being used. More...
 
bool IsPrecision (precisionType type) const
 Check if a particular precision is being used. More...
 
cudaStream_t GetStream () const
 Retrieve the stream that the device is operating on. More...
 
cudaStream_t CreateStream (bool nonBlocking=true)
 Create and use a new stream for execution. More...
 
void SetStream (cudaStream_t stream)
 Set the stream that the device is operating on. More...
 
const char * GetPrototxtPath () const
 Retrieve the path to the network prototxt file. More...
 
const char * GetModelPath () const
 Retrieve the full path to model file, including the filename. More...
 
const char * GetModelFilename () const
 Retrieve the filename of the file, excluding the directory. More...
 
modelType GetModelType () const
 Retrieve the format of the network model. More...
 
bool IsModelType (modelType type) const
 Return true if the model is of the specified format. More...
 
uint32_t GetInputLayers () const
 Retrieve the number of input layers to the network. More...
 
uint32_t GetOutputLayers () const
 Retrieve the number of output layers to the network. More...
 
Dims3 GetInputDims (uint32_t layer=0) const
 Retrieve the dimensions of network input layer. More...
 
uint32_t GetInputWidth (uint32_t layer=0) const
 Retrieve the width of network input layer. More...
 
uint32_t GetInputHeight (uint32_t layer=0) const
 Retrieve the height of network input layer. More...
 
uint32_t GetInputSize (uint32_t layer=0) const
 Retrieve the size (in bytes) of network input layer. More...
 
float * GetInputPtr (uint32_t layer=0) const
 Get the CUDA pointer to the input layer's memory. More...
 
Dims3 GetOutputDims (uint32_t layer=0) const
 Retrieve the dimensions of network output layer. More...
 
uint32_t GetOutputWidth (uint32_t layer=0) const
 Retrieve the width of network output layer. More...
 
uint32_t GetOutputHeight (uint32_t layer=0) const
 Retrieve the height of network output layer. More...
 
uint32_t GetOutputSize (uint32_t layer=0) const
 Retrieve the size (in bytes) of network output layer. More...
 
float * GetOutputPtr (uint32_t layer=0) const
 Get the CUDA pointer to the output memory. More...
 
float GetNetworkFPS ()
 Retrieve the network frames per second (FPS). More...
 
float GetNetworkTime ()
 Retrieve the network runtime (in milliseconds). More...
 
const char * GetNetworkName () const
 Retrieve the network name (it's filename). More...
 
float2 GetProfilerTime (profilerQuery query)
 Retrieve the profiler runtime (in milliseconds). More...
 
float GetProfilerTime (profilerQuery query, profilerDevice device)
 Retrieve the profiler runtime (in milliseconds). More...
 
void PrintProfilerTimes ()
 Print the profiler times (in millseconds). More...
 

Static Public Member Functions

static uint32_t OverlayFlagsFromStr (const char *flags)
 Parse a string sequence into OverlayFlags enum. More...
 
static poseNetCreate (const char *network="resnet18-body", float threshold=POSENET_DEFAULT_THRESHOLD, uint32_t maxBatchSize=DEFAULT_MAX_BATCH_SIZE, precisionType precision=TYPE_FASTEST, deviceType device=DEVICE_GPU, bool allowGPUFallback=true)
 Load a pre-trained model. More...
 
static poseNetCreate (const char *model_path, const char *topology, const char *colors, float threshold=POSENET_DEFAULT_THRESHOLD, const char *input=POSENET_DEFAULT_INPUT, const char *cmap=POSENET_DEFAULT_CMAP, const char *paf=POSENET_DEFAULT_PAF, uint32_t maxBatchSize=DEFAULT_MAX_BATCH_SIZE, precisionType precision=TYPE_FASTEST, deviceType device=DEVICE_GPU, bool allowGPUFallback=true)
 Load a custom network instance. More...
 
static poseNetCreate (int argc, char **argv)
 Load a new network instance by parsing the command line. More...
 
static poseNetCreate (const commandLine &cmdLine)
 Load a new network instance by parsing the command line. More...
 
static const char * Usage ()
 Usage string for command line arguments to Create() More...
 
- Static Public Member Functions inherited from tensorNet
static bool LoadClassLabels (const char *filename, std::vector< std::string > &descriptions, int expectedClasses=-1)
 Load class descriptions from a label file. More...
 
static bool LoadClassLabels (const char *filename, std::vector< std::string > &descriptions, std::vector< std::string > &synsets, int expectedClasses=-1)
 Load class descriptions and synset strings from a label file. More...
 
static bool LoadClassColors (const char *filename, float4 *colors, int expectedClasses, float defaultAlpha=255.0f)
 Load class colors from a text file. More...
 
static bool LoadClassColors (const char *filename, float4 **colors, int expectedClasses, float defaultAlpha=255.0f)
 Load class colors from a text file. More...
 
static float4 GenerateColor (uint32_t classID, float alpha=255.0f)
 Procedurally generate a color for a given class index with the specified alpha value. More...
 
static precisionType SelectPrecision (precisionType precision, deviceType device=DEVICE_GPU, bool allowInt8=true)
 Resolve a desired precision to a specific one that's available. More...
 
static precisionType FindFastestPrecision (deviceType device=DEVICE_GPU, bool allowInt8=true)
 Determine the fastest native precision on a device. More...
 
static std::vector< precisionTypeDetectNativePrecisions (deviceType device=DEVICE_GPU)
 Detect the precisions supported natively on a device. More...
 
static bool DetectNativePrecision (const std::vector< precisionType > &nativeTypes, precisionType type)
 Detect if a particular precision is supported natively. More...
 
static bool DetectNativePrecision (precisionType precision, deviceType device=DEVICE_GPU)
 Detect if a particular precision is supported natively. More...
 

Protected Member Functions

 poseNet ()
 
bool init (const char *model_path, const char *topology, const char *colors, float threshold, const char *input, const char *cmap, const char *paf, uint32_t maxBatchSize, precisionType precision, deviceType device, bool allowGPUFallback)
 
bool postProcess (std::vector< ObjectPose > &poses, uint32_t width, uint32_t height)
 
bool loadTopology (const char *json_path, Topology *topology)
 
bool loadKeypointColors (const char *filename)
 
- Protected Member Functions inherited from tensorNet
 tensorNet ()
 Constructor. More...
 
bool ProcessNetwork (bool sync=true)
 Execute processing of the network. More...
 
bool ProfileModel (const std::string &deployFile, const std::string &modelFile, const std::vector< std::string > &inputs, const std::vector< Dims3 > &inputDims, const std::vector< std::string > &outputs, uint32_t maxBatchSize, precisionType precision, deviceType device, bool allowGPUFallback, nvinfer1::IInt8Calibrator *calibrator, char **engineStream, size_t *engineSize)
 Create and output an optimized network model. More...
 
bool ConfigureBuilder (nvinfer1::IBuilder *builder, uint32_t maxBatchSize, uint32_t workspaceSize, precisionType precision, deviceType device, bool allowGPUFallback, nvinfer1::IInt8Calibrator *calibrator)
 Configure builder options. More...
 
bool ValidateEngine (const char *model_path, const char *cache_path, const char *checksum_path)
 Validate that the model already has a built TensorRT engine that exists and doesn't need updating. More...
 
void PROFILER_BEGIN (profilerQuery query)
 Begin a profiling query, before network is run. More...
 
void PROFILER_END (profilerQuery query)
 End a profiling query, after the network is run. More...
 
bool PROFILER_QUERY (profilerQuery query)
 Query the CUDA part of a profiler query. More...
 

Protected Attributes

Topology mTopology
 
float mThreshold
 
float mLinkScale
 
float mKeypointScale
 
float4 * mKeypointColors
 
int * mPeaks
 
int * mPeakCounts
 
int * mConnections
 
int * mObjects
 
int mNumObjects
 
float * mRefinedPeaks
 
float * mScoreGraph
 
void * mAssignmentWorkspace
 
void * mConnectionWorkspace
 
- Protected Attributes inherited from tensorNet
tensorNet::Logger gLogger
 
tensorNet::Profiler gProfiler
 
std::string mPrototxtPath
 
std::string mModelPath
 
std::string mModelFile
 
std::string mMeanPath
 
std::string mCacheEnginePath
 
std::string mCacheCalibrationPath
 
std::string mChecksumPath
 
deviceType mDevice
 
precisionType mPrecision
 
modelType mModelType
 
cudaStream_t mStream
 
cudaEvent_t mEventsGPU [PROFILER_TOTAL *2]
 
timespec mEventsCPU [PROFILER_TOTAL *2]
 
nvinfer1::IRuntime * mInfer
 
nvinfer1::ICudaEngine * mEngine
 
nvinfer1::IExecutionContext * mContext
 
float2 mProfilerTimes [PROFILER_TOTAL+1]
 
uint32_t mProfilerQueriesUsed
 
uint32_t mProfilerQueriesDone
 
uint32_t mWorkspaceSize
 
uint32_t mMaxBatchSize
 
bool mEnableProfiler
 
bool mEnableDebug
 
bool mAllowGPUFallback
 
void ** mBindings
 
std::vector< layerInfomInputs
 
std::vector< layerInfomOutputs
 

Static Protected Attributes

static const int CMAP_WINDOW_SIZE =5
 
static const int PAF_INTEGRAL_SAMPLES =7
 
static const int MAX_LINKS =100
 
static const int MAX_OBJECTS =100
 

Member Enumeration Documentation

◆ OverlayFlags

Overlay flags (can be OR'd together).

Enumerator
OVERLAY_NONE 

No overlay.

OVERLAY_BOX 

Overlay object bounding boxes.

OVERLAY_LINKS 

Overlay the skeleton links (bones) as lines

OVERLAY_KEYPOINTS 

Overlay the keypoints (joints) as circles.

OVERLAY_DEFAULT 

Constructor & Destructor Documentation

◆ ~poseNet()

virtual poseNet::~poseNet ( )
virtual

Destory.

◆ poseNet()

poseNet::poseNet ( )
protected

Member Function Documentation

◆ Create() [1/4]

static poseNet* poseNet::Create ( const char *  model_path,
const char *  topology,
const char *  colors,
float  threshold = POSENET_DEFAULT_THRESHOLD,
const char *  input = POSENET_DEFAULT_INPUT,
const char *  cmap = POSENET_DEFAULT_CMAP,
const char *  paf = POSENET_DEFAULT_PAF,
uint32_t  maxBatchSize = DEFAULT_MAX_BATCH_SIZE,
precisionType  precision = TYPE_FASTEST,
deviceType  device = DEVICE_GPU,
bool  allowGPUFallback = true 
)
static

Load a custom network instance.

Parameters
model_pathFile path to the ONNX model
topologyFile path to the topology JSON
colorsFile path to the keypoint colors text file
thresholddefault minimum confidence thrshold
inputName of the input layer blob.
cmapName of the output confidence map layer.
pafName of the output Part Affinity Field (PAF) layer.
maxBatchSizeThe maximum batch size that the network will support and be optimized for.

◆ Create() [2/4]

static poseNet* poseNet::Create ( const char *  network = "resnet18-body",
float  threshold = POSENET_DEFAULT_THRESHOLD,
uint32_t  maxBatchSize = DEFAULT_MAX_BATCH_SIZE,
precisionType  precision = TYPE_FASTEST,
deviceType  device = DEVICE_GPU,
bool  allowGPUFallback = true 
)
static

Load a pre-trained model.

Parameters
networktype of pre-supported network to load (
See also
POSENET_USAGE_STRING for models)
Parameters
thresholddefault minimum threshold for detection
maxBatchSizeThe maximum batch size that the network will support and be optimized for.

◆ Create() [3/4]

static poseNet* poseNet::Create ( const commandLine cmdLine)
static

Load a new network instance by parsing the command line.

◆ Create() [4/4]

static poseNet* poseNet::Create ( int  argc,
char **  argv 
)
static

Load a new network instance by parsing the command line.

◆ FindKeypointID()

int poseNet::FindKeypointID ( const char *  name) const
inline

Find the ID of a keypoint by name, or return -1 if not found.

◆ GetCategory()

const char* poseNet::GetCategory ( ) const
inline

Get the category of objects that are detected (e.g.

'person', 'hand')

◆ GetKeypointColor()

float4 poseNet::GetKeypointColor ( uint32_t  index) const
inline

Get the overlay color of a keypoint.

◆ GetKeypointName()

const char* poseNet::GetKeypointName ( uint32_t  index) const
inline

Get the name of a keypoint in the topology by it's ID.

◆ GetKeypointScale()

float poseNet::GetKeypointScale ( ) const
inline

Get the scale used to calculate the radius of keypoints relative to input image dimensions.

◆ GetLinkScale()

float poseNet::GetLinkScale ( ) const
inline

Get the scale used to calculate the width of link lines relative to input image dimensions.

◆ GetNumKeypoints()

uint32_t poseNet::GetNumKeypoints ( ) const
inline

Get the number of keypoints in the topology.

◆ GetThreshold()

float poseNet::GetThreshold ( ) const
inline

Retrieve the minimum confidence threshold.

◆ init()

bool poseNet::init ( const char *  model_path,
const char *  topology,
const char *  colors,
float  threshold,
const char *  input,
const char *  cmap,
const char *  paf,
uint32_t  maxBatchSize,
precisionType  precision,
deviceType  device,
bool  allowGPUFallback 
)
protected

◆ loadKeypointColors()

bool poseNet::loadKeypointColors ( const char *  filename)
protected

◆ loadTopology()

bool poseNet::loadTopology ( const char *  json_path,
Topology topology 
)
protected

◆ Overlay() [1/2]

template<typename T >
bool poseNet::Overlay ( T *  input,
T *  output,
uint32_t  width,
uint32_t  height,
const std::vector< ObjectPose > &  poses,
uint32_t  overlay = OVERLAY_DEFAULT 
)
inline

Overlay the results on the image.

◆ Overlay() [2/2]

bool poseNet::Overlay ( void *  input,
void *  output,
uint32_t  width,
uint32_t  height,
imageFormat  format,
const std::vector< ObjectPose > &  poses,
uint32_t  overlay = OVERLAY_DEFAULT 
)

Overlay the results on the image.

◆ OverlayFlagsFromStr()

static uint32_t poseNet::OverlayFlagsFromStr ( const char *  flags)
static

Parse a string sequence into OverlayFlags enum.

Valid flags are "none", "box", "label", and "conf" and it is possible to combine flags (bitwise OR) together with commas or pipe (|) symbol. For example, the string sequence "box,label,conf" would return the flags OVERLAY_BOX|OVERLAY_LABEL|OVERLAY_CONFIDENCE.

◆ postProcess()

bool poseNet::postProcess ( std::vector< ObjectPose > &  poses,
uint32_t  width,
uint32_t  height 
)
protected

◆ Process() [1/4]

template<typename T >
bool poseNet::Process ( T *  image,
uint32_t  width,
uint32_t  height,
std::vector< ObjectPose > &  poses,
uint32_t  overlay = OVERLAY_DEFAULT 
)
inline

Perform pose estimation on the given image, returning object poses, and overlay the results.

Parameters
[in]imageinput image in CUDA device memory (uchar3/uchar4/float3/float4)
[in]widthwidth of the input image in pixels.
[in]heightheight of the input image in pixels.
[out]posesarray of ObjectPose structs that will be filled for each detected object.
[in]overlaybitwise OR combination of overlay flags (
See also
OverlayFlags and
Overlay()), or OVERLAY_NONE.
Returns
True on success, or false if an error occurred.

◆ Process() [2/4]

template<typename T >
bool poseNet::Process ( T *  image,
uint32_t  width,
uint32_t  height,
uint32_t  overlay = OVERLAY_DEFAULT 
)
inline

Perform pose estimation on the given image, and overlay the results.

Parameters
[in]imageinput image in CUDA device memory (uchar3/uchar4/float3/float4)
[in]widthwidth of the input image in pixels.
[in]heightheight of the input image in pixels.
[in]overlaybitwise OR combination of overlay flags (
See also
OverlayFlags and
Overlay()), or OVERLAY_NONE.
Returns
True on success, or false if an error occurred.

◆ Process() [3/4]

bool poseNet::Process ( void *  image,
uint32_t  width,
uint32_t  height,
imageFormat  format,
std::vector< ObjectPose > &  poses,
uint32_t  overlay = OVERLAY_DEFAULT 
)

Perform pose estimation on the given image, and overlay the results.

Parameters
[in]imageinput image in CUDA device memory (uchar3/uchar4/float3/float4)
[in]widthwidth of the input image in pixels.
[in]heightheight of the input image in pixels.
[out]posesarray of ObjectPose structs that will be filled for each detected object.
[in]overlaybitwise OR combination of overlay flags (
See also
OverlayFlags and
Overlay()), or OVERLAY_NONE.
Returns
True on success, or false if an error occurred.

◆ Process() [4/4]

bool poseNet::Process ( void *  image,
uint32_t  width,
uint32_t  height,
imageFormat  format,
uint32_t  overlay = OVERLAY_DEFAULT 
)

Perform pose estimation on the given image, and overlay the results.

Parameters
[in]imageinput image in CUDA device memory (uchar3/uchar4/float3/float4)
[in]widthwidth of the input image in pixels.
[in]heightheight of the input image in pixels.
[in]overlaybitwise OR combination of overlay flags (
See also
OverlayFlags and
Overlay()), or OVERLAY_NONE.
Returns
True on success, or false if an error occurred.

◆ SetKeypointAlpha() [1/2]

void poseNet::SetKeypointAlpha ( float  alpha)
inline

Set the alpha channel for all keypoints colors used during overlay.

◆ SetKeypointAlpha() [2/2]

void poseNet::SetKeypointAlpha ( uint32_t  index,
float  alpha 
)
inline

Set the alpha channel for a keypoint color (between 0-255).

◆ SetKeypointColor()

void poseNet::SetKeypointColor ( uint32_t  index,
const float4 &  color 
)
inline

Set the overlay color for a keypoint.

◆ SetKeypointScale()

void poseNet::SetKeypointScale ( float  scale)
inline

Set the scale used to calculate the radius of keypoint circles.

This scale will be multiplied by the largest image dimension.

◆ SetLinkScale()

void poseNet::SetLinkScale ( float  scale)
inline

Set the scale used to calculate the width of link lines.

This scale will be multiplied by the largest image dimension.

◆ SetThreshold()

void poseNet::SetThreshold ( float  threshold)
inline

Set the minimum confidence threshold.

◆ Usage()

static const char* poseNet::Usage ( )
inlinestatic

Usage string for command line arguments to Create()

Member Data Documentation

◆ CMAP_WINDOW_SIZE

const int poseNet::CMAP_WINDOW_SIZE =5
staticprotected

◆ mAssignmentWorkspace

void* poseNet::mAssignmentWorkspace
protected

◆ MAX_LINKS

const int poseNet::MAX_LINKS =100
staticprotected

◆ MAX_OBJECTS

const int poseNet::MAX_OBJECTS =100
staticprotected

◆ mConnections

int* poseNet::mConnections
protected

◆ mConnectionWorkspace

void* poseNet::mConnectionWorkspace
protected

◆ mKeypointColors

float4* poseNet::mKeypointColors
protected

◆ mKeypointScale

float poseNet::mKeypointScale
protected

◆ mLinkScale

float poseNet::mLinkScale
protected

◆ mNumObjects

int poseNet::mNumObjects
protected

◆ mObjects

int* poseNet::mObjects
protected

◆ mPeakCounts

int* poseNet::mPeakCounts
protected

◆ mPeaks

int* poseNet::mPeaks
protected

◆ mRefinedPeaks

float* poseNet::mRefinedPeaks
protected

◆ mScoreGraph

float* poseNet::mScoreGraph
protected

◆ mThreshold

float poseNet::mThreshold
protected

◆ mTopology

Topology poseNet::mTopology
protected

◆ PAF_INTEGRAL_SAMPLES

const int poseNet::PAF_INTEGRAL_SAMPLES =7
staticprotected

Macro Definition Documentation

◆ POSENET_DEFAULT_CMAP

#define POSENET_DEFAULT_CMAP   "cmap"

Name of default output blob of the confidence map for pose estimation ONNX model.

◆ POSENET_DEFAULT_INPUT

#define POSENET_DEFAULT_INPUT   "input"

Name of default input blob for pose estimation ONNX model.

◆ POSENET_DEFAULT_KEYPOINT_SCALE

#define POSENET_DEFAULT_KEYPOINT_SCALE   0.0052f

Default scale used for drawing keypoint circles.

This scale is multiplied by the largest image dimension to arrive at the radius.

◆ POSENET_DEFAULT_LINK_SCALE

#define POSENET_DEFAULT_LINK_SCALE   0.0013f

Default scale used for drawing link lines.

This scale is multiplied by the largest image dimension to arrive at the line width.

◆ POSENET_DEFAULT_PAF

#define POSENET_DEFAULT_PAF   "paf"

Name of default output blob of the Part Affinity Field (PAF) for pose estimation ONNX model.

◆ POSENET_DEFAULT_THRESHOLD

#define POSENET_DEFAULT_THRESHOLD   0.15f

Default value of the minimum confidence threshold.

◆ POSENET_MODEL_TYPE

#define POSENET_MODEL_TYPE   "pose"

The model type for poseNet in data/networks/models.json.