Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Issues with the Crossroad Camera Demo (multiple)

Szulc__Tomasz
Beginner
907 Views

Hello,

Did anyone encounter issues with the Crossroad Camera Demo under VisualStudio C++?

----------------
Issue #1 - Runtime error

I was playing with the Crossroad Camera Demo (openvino_2019.1.087) under VisualStudio 2017 and after having successfully compiled the sample I tried to run it.
Unfortunately I received the following runtime error :

[ INFO ] Start inference
[ INFO ] To close the application, press 'CTRL+C' or any key with focus on the output window
OpenCV(4.1.0-openvino) Error: Assertion failed (elemSize() == sizeof(_Tp)) in cv::Mat::at, file d:\program files (x86)\intelswtools\openvino\opencv\include\opencv2\core\mat.inl.hpp, line 1188
[ ERROR ] OpenCV(4.1.0-openvino) d:\program files (x86)\intelswtools\openvino\opencv\include\opencv2\core\mat.inl.hpp:1188: error: (-215:Assertion failed) elemSize() == sizeof(_Tp) in function 'cv::Mat::at'

The culprit was the line :

max_color[freq] = centers.at<cv::Vec3b>(i);

in the function static cv::Vec3b GetAvgColor(const cv::Mat& image)
and the difference between the "stride" (step) attribute of the cv::Mat object (centers)
and the "sizeof" cv::Vec3b

After changing it to :

max_color[freq] = cv::Vec3b(centers.at<UINT8>(3*i), centers.at<UINT8>(3*i+1), centers.at<UINT8>(3*i+2));

(Yes , I know, it could (and should) be optimized ;-) )

the sample executed correctly.

On the other hand, the original code (with max_color[freq] = centers.at<cv::Vec3b>(i);) executes properly
under Raspbian in RasberryPi (with the same version of openvino).

It's interesting if this can be achieved using the VS compiler options (keeping the source code unified)? Alignment issue?

------------------
Issue #2 - Proper execution of Person Attributes Inference (minor issue - just for completeness)

In main.cpp the x and y properties of top_color_p and bottom_color_p are computed originally (using typecasting) like this :

top_color_p.x = static_cast<int>(resPersAttrAndColor.top_color_point.x) * person.cols;
top_color_p.y = static_cast<int>(resPersAttrAndColor.top_color_point.y) * person.rows;
bottom_color_p.x = static_cast<int>(resPersAttrAndColor.bottom_color_point.x) * person.cols;
bottom_color_p.y = static_cast<int>(resPersAttrAndColor.bottom_color_point.y) * person.rows;

This results in computed values equal to 0 .

After changing the code the following way:

top_color_p.x = static_cast<int>(resPersAttrAndColor.top_color_point.x * person.cols);
top_color_p.y = static_cast<int>(resPersAttrAndColor.top_color_point.y * person.rows);
bottom_color_p.x = static_cast<int>(resPersAttrAndColor.bottom_color_point.x * person.cols);
bottom_color_p.y = static_cast<int>(resPersAttrAndColor.bottom_color_point.y * person.rows);

the colors are computed (correctly IMHO) and shown in the vertical strip next to the "detected" person in the output image.

------------------
Issue #3 - Different behavior of Person Attributes Inference in the IntelCPU and Movidius Compute Stick 1 vs Intel Neural Compute Stick 2

When running the Crossroad Camera Demo sample on 
(1) Intel CPU PC (-d_pa CPU option) or 
(2) Intel PC with Movidius Compute Stick 1 (-d_pa MYRIAD option) or
(3) RapberryPi (Arm71) with Movidius Compute Stick 1 (-d_pa MYRIAD option)

I am getting a different set of detected Person Attributes than in the case when I run the same demo sample (with the same input images) on

(4) Intel PC with Intel Neural Compute Stick 2 (-d_pa MYRIAD option) or
(5) RapberryPi (Arm71) with Intel Neural Compute Stick 2 (-d_pa MYRIAD option)

To be more precise : in the cases (4) and (5) the attribute "has longpants" fails to be detected ;-)
which is not the case in (1),(2) and (3).

I am curious if this isn't an issue with the Intel Neural Compute Stick 2 ?

Best Regards
Tomasz Szulc


 

0 Kudos
1 Solution
Kenneth_C_Intel
Employee
907 Views

Hi I feel like there are three different bugs.

1) Loading two plugins to myriad causes an error. 

2) The inconsistency between GPU and Myriad plugin 

3) The demo not working in debug 

View solution in original post

0 Kudos
7 Replies
Kenneth_C_Intel
Employee
907 Views

Thank you for bringing these things up. 
I have noticed that issue number one works fine under the release version without modification, can you check that on your side? 

Also could you post a frame (jpg) (non inferenced) to show issue number three. 

I think that will be the easiest way for me to get the issue addressed. And you are using the pretrained models on Model Zoo for testing ?

Regards,

Ken 

0 Kudos
Szulc__Tomasz
Beginner
907 Views

Hello,

Re. Issue #1

Yes, indeed. The Release version works fine. I forgot to mention that the issue #1 appeared when running the demo under VS with the Debug configuration.This is probably why the Release configuration under Raspbian works also fine, as I it has been run there with the Release configuration as well. It's interesting though which VS Debug option causes the runtime problem (as I am now suspecting).

Re. Issue # 3

I have attached the image I used to test the demo. (I'm not taking any responsibility for the content ;-) , just grabbed it from the net )

I used for testing the suggested, pretrained models from the OpenVINO site : 

person-vehicle-bike-detection-crossroad-0078.xml

person-attributes-recognition-crossroad-0230.xml

person-reidentification-retail-0079.xml

Best Regards

Tomasz Szulc

0 Kudos
Shubha_R_Intel
Employee
907 Views

Dearest Szulc, Tomasz,

I also noticed that you are using an old version of OpenVino  (openvino_2019.1.087) . Please upgrade to the latest 2019R1.1 . Issues and bugs are fixed all the time in newer releases.

Much thanks,

Shubha

 

0 Kudos
Kenneth_C_Intel
Employee
908 Views

Hi I feel like there are three different bugs.

1) Loading two plugins to myriad causes an error. 

2) The inconsistency between GPU and Myriad plugin 

3) The demo not working in debug 

0 Kudos
Szulc__Tomasz
Beginner
907 Views

Dear Shubha R.

Yes, I certainly will change to the newest OpenVINO, and VS2019, and fast.

Thank you for your advice

Tomasz Szulc

0 Kudos
Szulc__Tomasz
Beginner
907 Views

Hello, Kenneth Craft,

In relation to issue #2 (inconsistencies between plugins) , it looks to me ,like the myriad plugin for NCS2 is trying to do some addtional runtime model optimizations (speculation only) , but nevertheless it's a minor issue.

 

Best Regards

Tomasz Szulc

0 Kudos
Shubha_R_Intel
Employee
907 Views

Dear Szulc, Tomasz,

So after upgrading to OpenVino 2019R1.1 did most of the issues for the Crossroad Camera Demo get resolved ? If I'm understanding you correctly, the MYRIAD plugin loads though compared to GPU it loads slowly ? Can you kindly clarify ?

Thanks,

Shubha

 

0 Kudos
Reply