How to get real processed output data from ds-example plugin based on DS4.0

Hi,

I want to save detected object data from ds-example plugin on DS4.0, but it’s fake value in function DsExampleProcess(). It’s OK for DS1.5.

DsExampleProcess (DsExampleCtx * ctx, unsigned char *data)
{
    DsExampleOutput *out =
        (DsExampleOutput*)calloc (1, sizeof (DsExampleOutput));

    if (data != NULL)
    {
        // Process your data here
    }
    // Fill output structure using processed output
    // Here, we fake some detected objects and labels
    if (ctx->initParams.fullFrame)
    {
        out->numObjects = 2;
        out->object[0] = (DsExampleObject)
        {
            ctx->initParams.processingWidth/8,
                ctx->initParams.processingHeight/8,
                ctx->initParams.processingWidth/8,
                ctx->initParams.processingHeight/8, "Obj0"
        };

        out->object[1] = (DsExampleObject)
        {
            ctx->initParams.processingWidth/2,
                ctx->initParams.processingHeight/2,
                ctx->initParams.processingWidth/8,
                ctx->initParams.processingHeight/8, "Obj1"
        };
    }
    else
    {
        out->numObjects = 1;
        out->object[0] = (DsExampleObject)
        {
            ctx->initParams.processingWidth/8,
                ctx->initParams.processingHeight/8,
                ctx->initParams.processingWidth/8,
                ctx->initParams.processingHeight/8, ""
        };
        // Set the object label
        snprintf (out->object[0].label, 64, "Obj_label");
    }

    return out;
}

What’s the differences for disable or enable dsexample->process_full_frame?

Hi,

full-frame=1 indicates that the plugin is applied to the full input image.
full-frame=0 means the plugin is applied to the down-scaled image which is described by processing-width and processing-height.

Please noticed that this option will go through the different implementation in the source code you shared.

if (ctx->initParams.fullFrame)
{
    // full-frame=1 
    ...
}
else
{
    // full-frame=0 
    ...
}

Thanks.

Thanks a lot ,
I want to save detected object data from ds-example plugin on DS4.0, but it’s fake value in function DsExampleProcess, do you know how to get the real data,such as object numbers and classes.

I’m using yolov3 for detecting(deepstream-app -c deepstream_app_config_yoloV3.txt).

Hi AastaLLL,
I want to save detected object data from ds-example plugin on DS4.0, but it’s fake value in function DsExampleProcess, do you know how to get the real data? such as object numbers and classes

DsExampleProcess (DsExampleCtx * ctx, unsigned char *data)

2.{

3.    DsExampleOutput *out =

4.        (DsExampleOutput*)calloc (1, sizeof (DsExampleOutput));

5.

6.    if (data != NULL)

7.    {

8.        // Process your data here

9.    }

10.    // Fill output structure using processed output

<u>11.    // Here, we fake some detected objects and labels</u><b></b>

12.    if (ctx->initParams.fullFrame)

13.    {

14.        out->numObjects = 2;

15.        out->object[0] = (DsExampleObject)

16.        {

17.            ctx->initParams.processingWidth/8,

18.                ctx->initParams.processingHeight/8,

19.                ctx->initParams.processingWidth/8,

20.                ctx->initParams.processingHeight/8, "Obj0"

21.        };

22.

23.        out->object[1] = (DsExampleObject)

24.        {

25.            ctx->initParams.processingWidth/2,

26.                ctx->initParams.processingHeight/2,

27.                ctx->initParams.processingWidth/8,

28.                ctx->initParams.processingHeight/8, "Obj1"

29.        };

30.    }

31.    else

32.    {

33.        out->numObjects = 1;

34.        out->object[0] = (DsExampleObject)

35.        {

36.            ctx->initParams.processingWidth/8,

37.                ctx->initParams.processingHeight/8,

38.                ctx->initParams.processingWidth/8,

39.                ctx->initParams.processingHeight/8, ""

40.        };

41.        // Set the object label

42.        snprintf (out->object[0].label, 64, "Obj_label");

43.    }

44.

45.    return out;

46.}

Hi,

The object data of your use case is parsed by the bounding box parser.
Due to different output format, the parser varies cross the different detector.

Have you updated the nvdsparsebbox for YOLO first?

Thanks.

Hello ,

Can you please guide me , what changes are needed to be done in nvdsparsebbox in order to get the object label in deepstream-app ?

Hi bhargav.ravat,

Please open a new forum issue and and we’ll pick it up there.