Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
279 Views

OpenVINO - OpenCV back end API issue

Jump to solution

Hi,

Processor: Intel Core i5
OS: Windows
OpenVINO version: OpenVINO Toolkit 2021.1
Intel pre-trained model: face-detection-retail-0004.xml
input: video.264

I have tried running the object_detection_demo_ssd_async python sample in OpenVINO by giving backend API(CAP_INTEL_MFX) to VideoCapture for decoding the resulting file.
cap = cv2.VideoCapture(input_stream,cv2.CAP_INTEL_MFX)

I am able to view output but displaying the below line on terminal.
"MFX: getproperty() is not implemented"


Command used: python object_detection_demo_ssd_async.py -i=video.264 -m <path-to-model>\face-detection-retail-0004.xml

Please find the attached screenshots for your reference

Kindly let me know if you have any inputs.

TIA,
Lavanya

0 Kudos

Accepted Solutions
Highlighted
Employee
198 Views

The problem with CPP demo is the same as with Python one: VideoCapture with MediaSDK does not return frame dimensions via properties (get method). But CPP demo relies on these values  not only to draw graphs but also to draw detections.

See:

https://github.com/openvinotoolkit/open_model_zoo/blob/75ec8ad4b6c4fd7fb161ae9d2c3056281b2443de/demo...

https://github.com/openvinotoolkit/open_model_zoo/blob/75ec8ad4b6c4fd7fb161ae9d2c3056281b2443de/demo...

Try to add initialization of width and height variables after the first frame have been read (https://github.com/openvinotoolkit/open_model_zoo/blob/75ec8ad4b6c4fd7fb161ae9d2c3056281b2443de/demo...), e.g. "width = curr_frame.width(); height = curr_frame.height();"

View solution in original post

7 Replies
Highlighted
Employee
260 Views

MediaSDK backend in OpenCV does not implement getProperty method yet, so it does not return anything. As I can see the demo application uses frame width and height to create presenter and draw graphs: 

https://github.com/openvinotoolkit/open_model_zoo/blob/75ec8ad4b6c4fd7fb161ae9d2c3056281b2443de/demo...

https://github.com/openvinotoolkit/open_model_zoo/blob/75ec8ad4b6c4fd7fb161ae9d2c3056281b2443de/demo...

I think you can ignore this warning or hardcode sizes passed to presenter if you need graphs to show correctly.

0 Kudos
Highlighted
240 Views

Hi Maksim,

Thank you for the response.

OS: Windows

I have tried even running the object_detection_demo_ssd_async CPP demo with person-detection-retail-0013.xml and Input is video.264

Command: object_detection_demo_ssd_async.exe -i <path>\video.264 -m <path>\person_model\intel\person-detection-retail-0013\FP32\person-detection-retail-0013.xml 

 

Not able to view the detection results on output frame.

Please find the attached screenshot and let me know your inputs.

 

TIA,

Lavanya

0 Kudos
Highlighted
Moderator
222 Views

Hi Lavanya,

person-detection-retail-0013 model is a pedestrian detector for the retail scenario. 

I've just validated using people-detection video, available at https://github.com/intel-iot-devkit/sample-videos, and it works fine.


Regards,

Munesh


0 Kudos
Highlighted
215 Views

Hi Mukesh,

Thank you for the response.

My aim is to use backend API in conjunction of OpenVINO when using OpenCV videoCapture method for video.264.

                cap = new cv::VideoCapture(source, backendAPI); 

So, I ran the object_detection_ssd_async CPP demo with video.264 format input using the opencv back end API for Video capture. so modified the  below code accordingly.

cv::VideoCapture cap;
if (!((FLAGS_i == "cam") ? cap.open(0) : cap.open(FLAGS_i.c_str(),cv::CAP_INTEL_MFX))) {
throw std::logic_error("Cannot open input file or camera: " + FLAGS_i);
}

Converted the person-detection.mp4 to out_person_detection.264 using below command.

ffmpeg -i <path>\Downloads\people-detection.mp4 -an -vcodec libx264 -crf 23 out_people_detection.264

Command: object_detection_demo_ssd_async.exe -m <path_to_model>\intel\person-detection-retail-0013\FP32\person-detection-retail-0013.xml -i <path_to_video>\out_car-detection.h264

Sample is running but not able to view the detection results on output frame. Also getting below line in terminal.

"MFX: getproperty() is not implemented"

Please find the attached screenshots for your reference and let me know if you have any inputs.

 

TIA,

Lavanya.

 

 

 

0 Kudos
Highlighted
208 Views

Hi Munesh,

Ignore my previous reply.

Thank you for the response.

My aim is to use backend API in conjunction of OpenVINO when using OpenCV videoCapture method for video.264.

                cap = new cv::VideoCapture(source, backendAPI); 

So, I ran the object_detection_ssd_async CPP demo with video.264 format input using the opencv back end API for Video capture. so modified the  below code accordingly.

cv::VideoCapture cap;
if (!((FLAGS_i == "cam") ? cap.open(0) : cap.open(FLAGS_i.c_str(),cv::CAP_INTEL_MFX))) {
throw std::logic_error("Cannot open input file or camera: " + FLAGS_i);
}

Converted the person-detection.mp4 to out_person_detection.264 using below command.

ffmpeg -i <path>\Downloads\people-detection.mp4 -an -vcodec libx264 -crf 23 out_people_detection.264

Command: object_detection_demo_ssd_async.exe -m <path_to_model>\intel\person-detection-retail-0013\FP32\person-detection-retail-0013.xml -i <path_to_video>\out_people_detection.264

Sample is running but not able to view the detection results on output frame. Also getting below line in terminal.

"MFX: getproperty() is not implemented"

Please find the attached screenshots for your reference and let me know if you have any inputs.

 

TIA,

Lavanya.

 

0 Kudos
Highlighted
Employee
199 Views

The problem with CPP demo is the same as with Python one: VideoCapture with MediaSDK does not return frame dimensions via properties (get method). But CPP demo relies on these values  not only to draw graphs but also to draw detections.

See:

https://github.com/openvinotoolkit/open_model_zoo/blob/75ec8ad4b6c4fd7fb161ae9d2c3056281b2443de/demo...

https://github.com/openvinotoolkit/open_model_zoo/blob/75ec8ad4b6c4fd7fb161ae9d2c3056281b2443de/demo...

Try to add initialization of width and height variables after the first frame have been read (https://github.com/openvinotoolkit/open_model_zoo/blob/75ec8ad4b6c4fd7fb161ae9d2c3056281b2443de/demo...), e.g. "width = curr_frame.width(); height = curr_frame.height();"

View solution in original post

Highlighted
Moderator
73 Views

Hi Lavanya,


This thread will no longer be monitored since a solution has been provided. If you need any additional information from Intel, please submit a new question. 


Regards,

Munesh


0 Kudos