|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
18 #ifndef POSEESTIMATORLIB_POSEINFERENCE_HPP_
19 #define POSEESTIMATORLIB_POSEINFERENCE_HPP_
25 #include <opencv2/core.hpp>
26 #include <opencv2/imgcodecs.hpp>
27 #include <opencv2/imgproc.hpp>
31 #include <NvOnnxParser.h>
32 #include "modules/PoseEstimator/IPoseEstimator.hpp"
33 #include "modules/FrameTransform/trtModule.hpp"
34 #include "modules/ReID/ReIDFrameTransformTexture.hpp"
35 #include "modules/ReID/ReIDCropScaler.hpp"
61 void read(
const YAML::Node &fn)
override;
100 PoseInference(
const std::string &configFilePath,
const std::string &modelName);
113 const std::shared_ptr<NvTrackedObjectManager> &targetManager
132 const std::map<NvMOTStreamId, NvMOTFrame *>& inputMeta,
133 std::map<
NvMOTStreamId, std::deque<DetectedObjInfo>> &detectedObjects,
const bool isForReAssoc
175 std::map<NvMOTStreamId, std::vector<std::pair<uint, NvMotDataTypes::Rect2f>>>
m_inputRoisInBatch;
190 #endif // POSEESTIMATORLIB_POSEINFERENCE_HPP_
bool m_isRuntimeInit
Reid status if runtime variables initialized.
std::vector< std::tuple< uint, NvMOTStreamId, NvMotDataTypes::Rect2f > > m_targetStreamIdList
Target index, stream ID, and crop ROI for each box.
cudaStream_t m_cuStream
Cuda stream to run all GPU tasks.
float * m_inputMaskLabel_d
Mask label, currently unused and set as 0.
std::vector< int > m_operateOnClassIds
Class IDs selected for pose estimation.
void doInference(const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta, std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &detectedObjects, const bool isForReAssoc) override
Run pose inference on cropped targets from the input frames.
void initializeModel() override
Create TensorRT inference engine; if engine does not exist, serialize from model file.
float * m_pose2d_org_img_d
std::string m_vizDir
Dir to save visualization dumps.
bool m_saveFrameViz
Save overlay masks for each target in each frame.
void update() override
Update the pose estimator after data association.
const POSEESTIMATOR_TYPES getPoseEstimatorType() override
Get the configured pose-estimator type.
void setValues4PoseGeometryInput()
Upload fixed geometry tensors used by pose inference.
float * m_pose3d_h
Host 2.5D and 3D poses.
void initializeRuntime(const SourceFrameInfo &frameInfo, const uint maxTargetsPerStream, const std::shared_ptr< NvTrackedObjectManager > &targetManager) override
Initialize variables and allocate memories.
Runs pose inference for tracked target regions.
std::shared_ptr< ReIDFrameTransformTexture > m_subImageCropper2
Image cropper, may share with visual tracker in the future.
int m_width
Input image patch width.
bool m_useVPICropScaler
Use VPI crop scaler instead of in built crop scaler.
void read(const YAML::Node &fn) override
Load configuration values from a YAML node.
float * m_outputIou_d
Device output IoU.
PoseInferenceConfigParams m_params
Config params for reid module.
POSEESTIMATOR_TYPES
Enumerate the supported pose-estimator implementation types.
int m_poseInferenceInterval
Pose inference interval.
int m_channel
Input image patch channel.
float * m_pointLabels_d
Input a list of point types (single point, bounding box corners) to decoder.
int m_numBboxes
Number of detected boxes in the current batch tracker recieved.
std::shared_ptr< ReIDCropScaler > m_subImageCropScaler
Image crop scaler.
std::shared_ptr< NvTrackedObjectManager > m_targetManager
Target manager providing target status to update feature gallery.
std::vector< float > m_offsets
List of mean values of color components to be subtracted from input.
TRT module to perform various deep learning inference.
NvMotDataTypes::Size m_srcImageSize
Size of the source image.
int m_maxTargetsToTrack
Max number of targets to keep for all streams.
float m_netScaleFactor
Input normalization factor.
std::vector< void * > m_bindings
Pointers to TensorRT tensors.
int m_debugVerboseLevel
Debug message verbose mode level.
Provides common loading helpers for tracker configuration parameters.
int m_inputOrder
Input dimension order: 0: NCHW, 1: NHWC.
float * m_inputBuf_h
Input patches to encoder.
float * m_inputMask_d
Mask prompt, currently unused and set as 0.
float * m_targetMaskDecSize_h
Mask output for each target.
void queryParams(NvMOTQuery ¶msQuery)
Populate the capabilities reported to the tracker.
float * m_points_d
Input a list of points (prompt) to decoder.
int m_encoderFeatureDim
Size of each encoder feature.
Holds the capabilities and requirements reported by the tracker library.
float * m_featuresEncoder_d
Encoder output features.
std::map< NvMOTStreamId, std::vector< std::pair< uint, NvMotDataTypes::Rect2f > > > m_inputRoisInBatch
Reid input rois to crop.
float * m_batchMaskDecSize_d
Mask output in a batch.
PoseInferenceConfigParams()
Construct a PoseInferenceConfigParams instance.
void removeStream(const NvMOTStreamId videoStreamId) override
Remove a stream from the pose estimator.
float * m_targetMaskOriginalSrcSize_d
Mask for each target resized to original streammux size.
NvBufSurfaceColorFormat m_colorFormat
Color format of input to reid network.
int m_maxBatchSize
Maximum batch size for reid network.
float * m_pose3d_d
Device 2D, original-image 2D, 2.5D, and 3D poses.
TrtModule m_inference
Inference module.
int m_height
Input image patch height.
int m_hiddenDim
Size of each reid feature.
int m_maxPointNum
Max number of points.
float * m_scaleNormalizedMeanLimbLengths_d
Represents a two-dimensional integer size.
Information about the input source frames for the input frame batch.
POSEESTIMATOR_TYPES m_poseEstimatorType
Type of pose estimator.
Stores configuration for pose inference.
virtual ~PoseInference()
Release resources owned by the PoseInference instance.
Defines the interface for per-target pose estimation.
PoseInference(const std::string &configFilePath)
Construct a PoseInference instance from configuration.
float * m_meanLimbLengths_d
Device inverse intrinsics, inverse transforms, and limb-length priors.
NvMotDataTypes::Size m_originalSrcImageSize
Size of the original source image.
float * m_targetMaskDecSize_d
void extractImagePatchesBatch(const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta)
Rescale all tracker frames into encoder input.
std::vector< int > m_inferDims
Reid input dimension.
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.