# May DeepStarem load multiple primary-gie or use secondary-gie0 for origin source?

**URL:** <https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911>\
**Category:** DeepStream SDK\
**Created:** [June 24, 2019, 5:54am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911 "2019-06-24T05:54:16Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![tedchung](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tedchung](https://forums.developer.nvidia.com/u/tedchung)\
**Post date:** [June 24, 2019, 5:54am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/1 "2019-06-24T05:54:16Z")

</div>

I want to run two detector model for same frame (inception v2 + custom detection model),  
But primary-gie only load the last one model  
Example

```auto
{deepstream_app_config.txt}
[primary-gie]
enable=1
gpu-id=0
model-engine-file=inception ..

[primary-gie]
enable=1
gpu-id=0
model-engine-file=customs detection ..

```

this result only show custom model result

And I us secondary-gie0 to connect primary-gie  
{deepstream\_app\_config.txt}

```auto
[primary-gie]
enable=1
gpu-id=0
gie-unique-id=1
model-engine-file=inception ..

[secondary-gie0]
enable=1
gpu-id=0
operate-on-gie-id=1
gie-unique-id=2
model-engine-file=customs detection ..

```

It’s seem secondary-gie0 result is based on inception detection result

---

<div class="post-metadata">

**Author:** ![ChrisDing](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/chrisding/32/14043_2.png) [@ChrisDing](https://forums.developer.nvidia.com/u/ChrisDing)\
**Post date:** [July 1, 2019, 2:49am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/2 "2019-07-01T02:49:24Z")

</div>

Please wait deepstream 4.0 for your case. 4.0 will be released in the mid of this month.

---

<div class="post-metadata">

**Author:** ![sathiez](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sathiez](https://forums.developer.nvidia.com/u/sathiez)\
**Post date:** [August 9, 2019, 12:38pm UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/3 "2019-08-09T12:38:51Z")

</div>

Hi,  
Is there any sample in deepstream 4.0??? How can I achieve this?

---

<div class="post-metadata">

**Author:** ![ChrisDing](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/chrisding/32/14043_2.png) [@ChrisDing](https://forums.developer.nvidia.com/u/ChrisDing)\
**Post date:** [August 12, 2019, 3:57am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/4 "2019-08-12T03:57:13Z")

</div>

Hi  
You can get here: [https://developer.nvidia.com/deepstream-sdk](https://developer.nvidia.com/deepstream-sdk)  
Thhe sample is in the tar package.

---

<div class="post-metadata">

**Author:** ![sathiez](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sathiez](https://forums.developer.nvidia.com/u/sathiez)\
**Post date:** [August 12, 2019, 4:17am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/5 "2019-08-12T04:17:25Z")

</div>

Hi,  
I couldn’t find any sample with two priamry gie.

---

<div class="post-metadata">

**Author:** ![ChrisDing](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/chrisding/32/14043_2.png) [@ChrisDing](https://forums.developer.nvidia.com/u/ChrisDing)\
**Post date:** [August 13, 2019, 1:25am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/6 "2019-08-13T01:25:27Z")

</div>

in gstnvinfer.cpp

```auto
#define PROCESS_MODEL_FULL_FRAME 1
#define PROCESS_MODEL_OBJECTS 2

....

    case PROP_PROCESS_MODE:
    {
      guint val = g_value_get_enum (value);
      nvinfer->process_full_frame = (val == PROCESS_MODEL_FULL_FRAME);
    }

```

You can set your second gie config:

```auto
[property]
...
process-mode=1
...

```

---

<div class="post-metadata">

**Author:** ![Ravik](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Ravik](https://forums.developer.nvidia.com/u/Ravik)\
**Post date:** [September 10, 2019, 8:41pm UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/7 "2019-09-10T20:41:32Z")

</div>

```auto
[primary-gie]
process-mode=1
enable=1
#model-engine-file=../../models/Secondary_CarColor/resnet18.caffemodel_b16_int8.engine
labelfile-path=../../models/facenet-120/class_labels.txt
batch-size=8
gpu-id=0
bbox-border-color0=1;1;1;1
bbox-border-color1=1;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
gie-unique-id=6
operate-on-gie-id=1
operate-on-class-ids=0;
config-file=face.txt

```

like this ?

---

<div class="post-metadata">

**Author:** ![sathiez](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sathiez](https://forums.developer.nvidia.com/u/sathiez)\
**Post date:** [September 20, 2019, 5:05am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/8 "2019-09-20T05:05:43Z")

</div>

Hi Chris,

Do we need to set,

```auto
<b>[primary-gie]</b>
enable=1
gpu-id=0
#model-engine-file=model_b1_fp32.engine
labelfile-path=label.txt
batch-size=1
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
gie-unique-id=1
nvbuf-memory-type=0
config-file=config1.txt

<b>[secondary-gie0]</b>
enable=1
gpu-id=0
#model-engine-file=model_b1_fp32.engine
labelfile-path=label.txt
batch-size=1
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
gie-unique-id=2
operate-on-gie-id=1
nvbuf-memory-type=0
config-file=config2.txt

```

and in  
**config2.txt**

```auto
<b>[property]</b>
process-mode=1
.......

```

I tried this but it is not working as you said.

Can you give more clarity on this?

---

<div class="post-metadata">

**Author:** ![ChrisDing](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/chrisding/32/14043_2.png) [@ChrisDing](https://forums.developer.nvidia.com/u/ChrisDing)\
**Post date:** [September 26, 2019, 2:24am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/9 "2019-09-26T02:24:31Z")

</div>

Do you mean your 2 models “inception v2” and “custom detection” are independent and both inference in full frame ?

---

<div class="post-metadata">

**Author:** ![barzanhayati](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@barzanhayati](https://forums.developer.nvidia.com/u/barzanhayati)\
**Post date:** [October 23, 2019, 8:44am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/10 "2019-10-23T08:44:34Z")

</div>

> [@ChrisDing](#):
>
> Do you mean your 2 models “inception v2” and “custom detection” are independent and both inference in full frame ?

Dear chris

I am planning to detect cars and draw a bounding box around it via yolov3 tiny. then I will be detecting plates (and draw bounding boxes around them) inside the detected cars in the previous classifier. Ultimately I will be recognizing characters inside the detected plates. as you can imagine, I need an approach in which I will be cascading different Yolo samples, drawing bounding boxes (of plate location) inside othe bounding boxes (of car locations). is deepstream flexible enough to help me do that without having to modify the cp libraries, or I can do this only via changing the high level config.txt files?

---

<div class="post-metadata">

**Author:** ![ChrisDing](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/chrisding/32/14043_2.png) [@ChrisDing](https://forums.developer.nvidia.com/u/ChrisDing)\
**Post date:** [October 24, 2019, 5:02am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/11 "2019-10-24T05:02:38Z")

</div>

Do you mean your pipeline is like the below ? You have 3 models?  
“Recognize characters” model also can be deploied by tensorrt ?

src → decoder → streammux → car detection (Crop car) → License plate detection (crop LP)-\> recognize characters → …

---

<div class="post-metadata">

**Author:** ![gulmezh](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@gulmezh](https://forums.developer.nvidia.com/u/gulmezh)\
**Post date:** [November 9, 2019, 9:07pm UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/12 "2019-11-09T21:07:20Z")

</div>

Hi chris,

barzanhayati probably meant it. I have a similar problem. Is it possible to cascade two primary detector via nvtracker.

---

<div class="post-metadata">

**Author:** ![ChrisDing](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/chrisding/32/14043_2.png) [@ChrisDing](https://forums.developer.nvidia.com/u/ChrisDing)\
**Post date:** [November 21, 2019, 4:52am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/13 "2019-11-21T04:52:37Z")

</div>

Yes.  
You can refer to [deepstream\_reference\_apps/back-to-back-detectors at master · NVIDIA-AI-IOT/deepstream\_reference\_apps · GitHub](https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/tree/master/back-to-back-detectors) and add nvtracker after.

---

<div class="post-metadata">

**Author:** ![kn1ght](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kn1ght/32/29896_2.png) [@kn1ght](https://forums.developer.nvidia.com/u/kn1ght)\
**Post date:** [November 21, 2019, 10:23pm UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/14 "2019-11-21T22:23:39Z")

</div>

Hey Chris.  
So I am using two object detectors. The first detects people and the second detects faces.  
I set my pipeline like this: persondetector → facedetector → nvtracker.  
However, the tracker seems to override the Face Label to Person.

I need to Detect People and run a classifier on them. I also need to detect their faces and classify their age and gender. I have all the models ready but can’t seem to plug them properly due to the aforementioned issue.  
How do I go about this?

---

<div class="post-metadata">

**Author:** ![ChrisDing](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/chrisding/32/14043_2.png) [@ChrisDing](https://forums.developer.nvidia.com/u/ChrisDing)\
**Post date:** [December 5, 2019, 2:44am UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/15 "2019-12-05T02:44:50Z")

</div>

I think the pipeline is like this:

PersonDetector → classify person  
----------------\> face Detector →   
---------------------\> age classify  
---------------------\> gender classify

Can you add nvtracker after personDetector or do not use nvtracker. You can drop frames in deocder:  
[https://docs.nvidia.com/metropolis/deepstream/plugin-manual/index.html#page/DeepStream\_Plugin\_Manual%2Fdeepstream\_plugin\_details.02.12.html](https://docs.nvidia.com/metropolis/deepstream/plugin-manual/index.html#page/DeepStream_Plugin_Manual%2Fdeepstream_plugin_details.02.12.html) → drop-frame-interval

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:18pm UTC](https://forums.developer.nvidia.com/t/may-deepstarem-load-multiple-primary-gie-or-use-secondary-gie0-for-origin-source/76911/16 "2021-10-12T16:18:44Z")

</div>

Closed on October 12, 2021, 4:18pm UTC


