cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
shantaramjagtap1994@
Contributor
Contributor
610 Views
Registered: ‎10-31-2018

Rectangular box is not coming while running face detection application.

Hello Folks,

I am testing dpu face detection application using z7020.

Board : zynq 7020
DNNDK ver : 3.1
Dpu version: 3.0

DPU Driver version is 3.0.0
[DPU Core Configuration List]
DPU Core :#0
DPU Enabled :Yes
DPU Arch :B800
DPU Target Version :v1.4.0
DPU Frequency :100MHz
Ram Usage :Low
DepthwiseConv :Disabled
DepthwiseConv+Relu6 :Disabled
Conv+Leakyrelu :Disabled
Conv+Relu6 :Enabled
Channel Augmentation :Enabled
Average Pool :Enabled

I am downloaded cf_densebox_wider_360_640_1.11G_1.1 model from https://github.com/Xilinx/AI-Model-Zoo#model-download
and compile using DNNDK v3.1 and generated dpu_densebox.elf file.

i am using MIPI Pcam 5c camera as an input and hdmi display as an output.

seated mipi camera resolution as 320x240@10 and pixel format is YUYV.

when i am running face_detection application. i am able to see camera output on hdmi display but faces are not detected(green rectangular boxes is not coming).

Please help.

Thanks in advance.

0 Kudos
8 Replies
jasonwu
Moderator
Moderator
543 Views
Registered: ‎03-27-2013

Hi shantaramjagtap1994@ ,

 

Have you tried to run the test on a released image(ZCU102/ZCU104)? And check the input format?

The preprocess may still be important for the application.

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------
0 Kudos
shantaramjagtap1994@
Contributor
Contributor
525 Views
Registered: ‎10-31-2018

Thanks for reply @jasonwu 

ZCU102/104 board currently not available for me, so i can't test on it. And i want to run example on z7020 board.

when i started debug, program is not entering in following loop. that's why i saw output without boxes.

// Discard overlapping boxes using NMS

vector<vector<float>> res = NMS(boxes, 0.35);

// Draw detected face boxes to image
for (size_t i = 0; i < res.size(); ++i) {
float xmin = std::max(res[i][0] * scale_w, 0.0f);
float ymin = std::max(res[i][1] * scale_h, 0.0f);
float xmax = std::min(res[i][2] * scale_w, (float)img.cols);
float ymax = std::min(res[i][3] * scale_h, (float)img.rows);

rectangle(img, Point(xmin, ymin), Point(xmax, ymax), Scalar(0, 255, 0), 1, 1, 0);
}

what is reason? please help.

0 Kudos
jasonwu
Moderator
Moderator
501 Views
Registered: ‎03-27-2013

Hi shantaramjagtap1994@ ,

 

From the code https://github.com/Xilinx/Vitis-AI/blob/master/mpsoc/vitis_ai_dnndk_samples/face_detection/src/main.cc

we can see that:

    // get original face boxes 
    vector<vector<float>> boxes; 
    for (int i = 0; i < outHeight; i++) {
        for (int j = 0; j < outWidth; j++) {
            int position = i * outWidth + j;
            vector<float> box;
            if (softmax[position * 2 + 1] > 0.55) {
                box.push_back(bb[position * 4 + 0] + j * 4);
                box.push_back(bb[position * 4 + 1] + i * 4);
                box.push_back(bb[position * 4 + 2] + j * 4);
                box.push_back(bb[position * 4 + 3] + i * 4);
                box.push_back(softmax[position * 2 + 1]);
                boxes.push_back(box);
            }
        }
    }

I doubt if you can pass the "softmax[position * 2 + 1] > 0.55" condition

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------
0 Kudos
jasonwu
Moderator
Moderator
493 Views
Registered: ‎03-27-2013

Hi shantaramjagtap1994@ ,

 

I did some quick test on my side. And using the model_zoo model cf_densebox_wider_320_320_0.49G_1.2 to generate the ELF and replace the ELF in MPSoC facedetect example and it works fine for me.

 

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------
0 Kudos
shantaramjagtap1994@
Contributor
Contributor
480 Views
Registered: ‎10-31-2018

Hi @jasonwu 

Thanks for reply.

I also did same test using model_zoo model cf_densebox_wider_320_320_0.49G_1.1. i got this model on https://github.com/Xilinx/AI-Model-Zoo#model-download. i am used quantized deploy.caffemodel and deploy.prototxt files to generate dpu_densebox.elf. But i am getting same output.

what could be other reasons, please help.

0 Kudos
shantaramjagtap1994@
Contributor
Contributor
474 Views
Registered: ‎10-31-2018

Hi @jasonwu 

 

Yes, you are right. program is not passing "softmax[position * 2 + 1] > 0.55" condition.

0 Kudos
shantaramjagtap1994@
Contributor
Contributor
429 Views
Registered: ‎10-31-2018

Hi @jasonwu 

i didn't get my solution. when i changed condition i am getting green dots everywhere on screen.

please help.

0 Kudos
jasonwu
Moderator
Moderator
386 Views
Registered: ‎03-27-2013

Hi shantaramjagtap1994@ ,

 

I am using Vitis AI 1.2 and can't reproduce this issue.

But since you are using Zynq-7000 for now you can only use DNNDK 3.1.

I am not sure what the issue you meet.

But if I am trying to debug the issue out. I would get one frame out. Store as image file and try to debug the followed steps just with this image as input.

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------
0 Kudos