|
NVIDIA DeepStream SDK API Reference
|
7.0 Release
|
Go to the documentation of this file.
13 #ifndef __GSTNVINFER_IMPL_H__
14 #define __GSTNVINFER_IMPL_H__
23 #include <condition_variable>
32 #include "nvdspreprocess_meta.h"
33 #include "nvtx3/nvToolsExt.h"
55 gdouble scale_ratio_x = 0;
59 gdouble scale_ratio_y = 0;
62 guint offset_left = 0;
73 guint batch_index = 0;
81 gpointer converted_frame_ptr =
nullptr;
84 std::weak_ptr<GstNvInferObjectHistory>
history;
100 gulong inbuf_batch_num = 0;
105 gboolean push_buffer = FALSE;
109 gboolean event_marker = FALSE;
112 nvtxRangeId_t nvtx_complete_buf_range = 0;
174 void wait (GCond &cond);
218 std::unique_ptr<std::tuple<NvDsInferContextPtr, NvDsInferContextInitParamsPtr, std::string>>;
244 class ModelLoadThread
247 using ModelItem = std::tuple<std::string, ModelLoadType> ;
251 void queueModel (
const std::string &modelPath,
ModelLoadType type) {
252 m_PendingModels.push (ModelItem(modelPath, type));
258 std::thread m_Thread;
262 bool initNewInferModelParams (
266 bool isNewContextValid (
268 bool triggerContextReplace (
270 const std::string &path);
271 void loadModel (
const std::string &path,
ModelLoadType loadType);
277 const std::string &path);
281 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.
std::weak_ptr< GstNvInferObjectHistory > history
Pointer to the structure holding inference history for the object.
void gst_nvinfer_logger(NvDsInferContextHandle handle, unsigned int unique_id, NvDsInferLogLevel log_level, const char *log_message, void *user_ctx)
NvDsInferStatus ensureReplaceNextContext()
replace context, action in submit_input_buffer
typedefG_BEGIN_DECLS struct _GstNvInfer GstNvInfer
ModelLoadType
Enum for type of model update required.
std::pair< std::weak_ptr< GstNvInferObjectHistory >, NvDsObjectMeta * > GstNvInferObjHistory_MetaPair
std::shared_ptr< INvDsInferContext > NvDsInferContextPtr
std::unique_ptr< NvDsInferContextInitParams > NvDsInferContextInitParamsPtr
NvDsInferStatus status
Status of the model update.
NvDsInferLogLevel
Enum for the log levels of NvDsInferContext.
NvDsInferContextPtr m_InferCtx
NvDsInferContext to be used for inferencing.
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.
GstMiniObject mini_object
Parent type.
std::vector< GstNvInferObjHistory_MetaPair > objs_pending_meta_attach
List of objects not inferred on in the current batch but pending attachment of lastest available clas...
struct INvDsInferContext * NvDsInferContextHandle
An opaque pointer type to be used as a handle for a context instance.
NvDsInferContextPtr infer_context
NvDsInferContext pointer which hold the resource.
Holds information about the batch of frames to be inferred.
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.
struct _GstBuffer GstBuffer
bool isContextReady() const
NvDsInferContextBatchOutput batch_output
NvDsInferContextBatchOutput instance whose output tensor buffers are being sent as meta data.
std::vector< GstNvInferFrame > frames
Vector of frames in the batch.
@ MODEL_LOAD_STOP
Request the model load thread to stop.
Holds the output for all of the frames in a batch (an array of frame), and related buffer information...
GstNvInfer element structure.
Holds info about one frame in a batch for inferencing.
@ MODEL_LOAD_FROM_ENGINE
Load a new model by just replacing the model engine assuming no network architecture changes.
Holds runtime model update status along with the error message if any.
C++ helper class written on top of GMutex/GCond.
std::unique_ptr< std::tuple< NvDsInferContextPtr, NvDsInferContextInitParamsPtr, std::string > > ContextReplacementPtr
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
@ MODEL_LOAD_FROM_CONFIG
Load a new model with other configuration changes.