1. Reading xxxx code is the best way to get the answer
2. The user of 4.0 needs C/C++ background
3. More resource:
https://docs.nvidia.com/metropolis/
nvinfer / nvpreprocess / streamMux / DeMux
-
Gst-Nvinfer source code diagram
-
Gst-Nvdspreprocess source code diagram
-
How to get original NV12 frame buffer
https://devtalk.nvidia.com/default/topic/1060956/deepstream-sdk/access-frame-pointer-in-deepstream-app/post/5375214/#5375214 -
How to get detection confidence
https://devtalk.nvidia.com/default/topic/1060849/deepstream-sdk/deepstream-v4-zero-confidence-problem/?offset=2#5372609
https://devtalk.nvidia.com/default/topic/1058661/deepstream-sdk/nvinfer-is-not-populating-confidence-field-in-nvdsobjectmeta-ds-4-0-/post/5373361/#5373361 -
nvinfer config “model-color-format” is defined in nvdsinfer_context.h and parsed in gstnvinfer_property_parser.cpp
nvinfer supports not only bgr/rgb, but also gray and other formats.
/**
* Enum for color formats.
*/
typedef enum
{
/** 24-bit interleaved R-G-B */
NvDsInferFormat_RGB,
/** 24-bit interleaved B-G-R */
NvDsInferFormat_BGR,
/** 8-bit Luma */
NvDsInferFormat_GRAY,
/** 32-bit interleaved R-G-B-A */
NvDsInferFormat_RGBA,
/** 32-bit interleaved B-G-R-x */
NvDsInferFormat_BGRx,
NvDsInferFormat_Unknown = 0xFFFFFFFF,
} NvDsInferFormat;
- How to support each stream to deploy different aglorithm
diff --git a/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp b/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp
old mode 100644
new mode 100755
index c6867c87..cc70840c
--- a/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp
+++ b/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp
@@ -601,8 +601,10 @@ gst_nvinfer_sink_event (GstBaseTransform * trans, GstEvent * event)
/* New source added in the pipeline. Create a source info instance for it. */
guint source_id;
gst_nvevent_parse_pad_added (event, &source_id);
- nvinfer->source_info->emplace (source_id, GstNvInferSourceInfo ());
- }
+ if (!nvinfer->process_full_frame && /* source_id is what your want for this SGIE */) {
+ nvinfer->source_info->emplace (source_id, GstNvInferSourceInfo ());
+ }
+ }
if ((GstNvEventType) GST_EVENT_TYPE (event) == GST_NVEVENT_PAD_DELETED) {
/* Source removed from the pipeline. Remove the related structure. */
@@ -1409,6 +1411,8 @@ gst_nvinfer_process_objects (GstNvInfer * nvinfer, GstBuffer * inbuf,
/* Find the source info instance. */
auto iter = nvinfer->source_info->find (frame_meta->pad_index);
+
+ /* If the source_id is not found, the object will be ignored */
if (iter == nvinfer->source_info->end ()) {
GST_WARNING_OBJECT
(nvinfer,
-
How to get/update source_id
https://devtalk.nvidia.com/default/topic/1062520/deepstream-sdk/getting-source-stream-id-from-nvosd-plugin/post/5380861/#5380861
How to set source_id in streammux? -
FP16 model issue
If the weights in the model is outside of fp16 range, there will be uff parser issue as the below print:
NvDsInferContext[UID 1]:initialize(): Trying to create engine from model files
ERROR nvinfer gstnvinfer.cpp:511:gst_nvinfer_logger: NvDsInferContext[UID 1]:log(): UffParser: Parser error: bn_conv1/moving_variance: Weight 110542.968750 at index 8 is outside of [-65504.000000, 65504.000000]. Please try running the parser in a higher precision mode and setting the builder to fp16 mode instead.
NvDsInferCudaEngineGetFromTltModel: Failed to parse UFF model
In order to fix this issue, we can apply this patch to the nvinfer source code and build a new libnvds_infer.so to replace
--- a/src/utils/nvdsinfer/nvdsinfer_context_impl.cpp
+++ b/src/utils/nvdsinfer/nvdsinfer_context_impl.cpp
@@ -1851,7 +1851,7 @@ NvDsInferContextImpl::generateTRTModel(
}
if (!uffParser->parse(initParams.uffFilePath,
- *network, modelDataType))
+ *network,DataType::kFLOAT))
9.Here’s a simple example CUDA kernel of cropping image: https://github.com/dusty-nv/jetson-video/blob/master/cuda/cudaCrop.cu
-
How to deploy mrcnn model (GitHub - matterport/Mask_RCNN: Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow) with resnet50 backbone and classNum change in h5 model ?
https://devtalk.nvidia.com/default/topic/1031938/deepstream-sdk/converting-mask-rcnn-to-tensor-rt/post/5416100/#5416100 -
How to disable object detecdtion for different sources?
https://devtalk.nvidia.com/default/topic/1068016/deepstream-sdk/can-deepstream-select-to-enable-or-disable-object-detection-for-different-sources/post/5410165/#5410165