|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
18 #ifndef __GSTNVINFERBASE_IMPL_H__
19 #define __GSTNVINFERBASE_IMPL_H__
28 #include <condition_variable>
33 #include "nvbufsurftransform.h"
34 #include "nvdsinfer_context.h"
35 #include "nvdsinfer_func_utils.h"
37 #include "nvds_audio_meta.h"
38 #include "nvtx3/nvToolsExt.h"
60 gdouble scale_ratio_x = 0;
64 gdouble scale_ratio_y = 0;
71 guint batch_index = 0;
79 gpointer converted_frame_ptr =
nullptr;
82 std::weak_ptr<GstNvInferObjectHistory> history;
94 std::vector<GstNvInferFrame> frames;
98 gulong inbuf_batch_num = 0;
103 gboolean push_buffer =
FALSE;
107 gboolean event_marker =
FALSE;
110 nvtxRangeId_t nvtx_complete_buf_range = 0;
114 std::vector <GstNvInferObjHistory_MetaPair> objs_pending_meta_attach;
132 GstMiniObject mini_object;
168 void wait (GCond &cond);
212 std::unique_ptr<std::tuple<NvDsInferContextPtr, NvDsInferContextInitParamsPtr, std::string>>;
238 class ModelLoadThread
241 using ModelItem = std::tuple<std::string, ModelLoadType> ;
245 void queueModel (
const std::string &modelPath,
ModelLoadType type) {
246 m_PendingModels.push (ModelItem(modelPath, type));
252 std::thread m_Thread;
256 bool initNewInferModelParams (
260 bool isNewContextValid (
262 bool triggerContextReplace (
264 const std::string &path);
265 void loadModel (
const std::string &path,
ModelLoadType loadType);
271 const std::string &path);
275 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.
NvDsInferStatus ensureReplaceNextContext()
replace context, action in submit_input_buffer
ModelLoadType
Enum for type of model update required.
guint unique_id
Unique ID of the element.
ModelStatus
ModelBin lifecycle (applies to EVERY ModelBin, any role).
NvDsInferStatus status
Status of the model update.
typedefG_BEGIN_DECLS struct _GstNvInferBase GstNvInferBase
GstNvInferBase element structure.
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.
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.
void gst_nvinfer_logger(NvDsInferContextHandle handle, unsigned int unique_id, NvDsInferLogLevel log_level, const char *log_message, void *user_ctx)
Holds the initialization parameters required for the NvDsInferContext interface.
@ MODEL_LOAD_FROM_CONFIG
Load a new model with other configuration changes.
bool isContextReady() const
Holds the output for all of the frames in a batch (an array of frame), and related buffer information...
std::shared_ptr< INvDsInferContext > NvDsInferContextPtr
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.