|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
18 #ifndef __GSTNVINFER_IMPL_H__
19 #define __GSTNVINFER_IMPL_H__
28 #include <condition_variable>
33 #include "nvbufsurftransform.h"
34 #include "nvdsinfer_context.h"
35 #include "nvdsinfer_func_utils.h"
37 #include "nvdspreprocess_meta.h"
38 #include "nvtx3/nvToolsExt.h"
60 gdouble scale_ratio_x = 0;
64 gdouble scale_ratio_y = 0;
67 guint offset_left = 0;
78 guint batch_index = 0;
86 gpointer converted_frame_ptr =
nullptr;
89 std::weak_ptr<GstNvInferObjectHistory> history;
101 std::vector<GstNvInferFrame> frames;
105 gulong inbuf_batch_num = 0;
110 gboolean push_buffer =
FALSE;
114 gboolean event_marker =
FALSE;
117 nvtxRangeId_t nvtx_complete_buf_range = 0;
125 std::vector <GstNvInferObjHistory_MetaPair> objs_pending_meta_attach;
143 GstMiniObject mini_object;
179 void wait (GCond &cond);
223 std::unique_ptr<std::tuple<NvDsInferContextPtr, NvDsInferContextInitParamsPtr, std::string>>;
249 class ModelLoadThread
252 using ModelItem = std::tuple<std::string, ModelLoadType> ;
256 void queueModel (
const std::string &modelPath,
ModelLoadType type) {
257 m_PendingModels.push (ModelItem(modelPath, type));
263 std::thread m_Thread;
267 bool initNewInferModelParams (
271 bool isNewContextValid (
273 bool triggerContextReplace (
275 const std::string &path);
276 void loadModel (
const std::string &path,
ModelLoadType loadType);
282 const std::string &path);
286 std::unique_ptr<ModelLoadThread> m_ModelLoadThread;
NvDsInferContextInitParamsPtr m_InitParams
NvDsInferContext initialization params.
LockGMutex(GMutex &mutex)
Holds the inference information/history for one object based on it's tracking id.
struct NvBufSurfTransformSyncObj * NvBufSurfTransformSyncObj_t
Holds the information about synchronization objects for asynchronous transform/composite APIs.
NvDsInferStatus ensureReplaceNextContext()
replace context, action in submit_input_buffer
ModelLoadType
Enum for type of model update required.
ModelStatus
ModelBin lifecycle (applies to EVERY ModelBin, any role).
NvDsInferStatus status
Status of the model update.
NvDsInferLogLevel
Enum for the log levels of NvDsInferContext.
NvDsInferContextPtr m_InferCtx
NvDsInferContext to be used for inferencing.
struct _GstBuffer GstBuffer
void notifyLoadModelStatus(const ModelStatus &res)
Hold the information of single buffer in the batch.
DsNvInferImpl(GstNvInfer *infer)
bool triggerNewModel(const std::string &modelPath, ModelLoadType loadType)
Load new model in separate thread.
struct INvDsInferContext * NvDsInferContextHandle
An opaque pointer type to be used as a handle for a context instance.
Holds information about the batch of frames to be inferred.
@ MODEL_LOAD_FROM_ENGINE
Load a new model by just replacing the model engine assuming no network architecture changes.
guint unique_id
Unique ID of the element.
Data type used for the refcounting and managing the usage of NvDsInferContext's batch output and the ...
std::string cfg_file
Config file used for model update.
Holds the initialization parameters required for the NvDsInferContext interface.
@ MODEL_LOAD_FROM_CONFIG
Load a new model with other configuration changes.
bool isContextReady() const
typedefG_BEGIN_DECLS struct _GstNvInfer GstNvInfer
void gst_nvinfer_logger(NvDsInferContextHandle handle, unsigned int unique_id, NvDsInferLogLevel log_level, const char *log_message, void *user_ctx)
Holds the output for all of the frames in a batch (an array of frame), and related buffer information...
std::shared_ptr< INvDsInferContext > NvDsInferContextPtr
GstNvInfer element structure.
Holds info about one frame in a batch for inferencing.
std::pair< std::weak_ptr< GstNvInferObjectHistory >, NvDsObjectMeta * > GstNvInferObjHistory_MetaPair
@ MODEL_LOAD_STOP
Request the model load thread to stop.
std::unique_ptr< NvDsInferContextInitParams > NvDsInferContextInitParamsPtr
Holds runtime model update status along with the error message if any.
std::unique_ptr< std::tuple< NvDsInferContextPtr, NvDsInferContextInitParamsPtr, std::string > > ContextReplacementPtr
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.