Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Sapiain__Roberto
Beginner
335 Views

Are there detailed instructions for building OpenCV 4.1.1-openvino?

Hi.

I'm stuck with something (FRCNN and RFCN; custom-RFCN based on 'RFCN ResNet 101 COCO', trained on tf-1.12.3, tfod-api 1.12), and seems like the only way for me, is do a slight modification in the opencv-4.1.1-openvino, build it, and test it.

model and code in tensorflow work just fine. Converted to DLDT-FP16 (successfully, also specified output size [1,600,1024,3]) I get this crash:

  File "detector_v0.1/ocv-fotodetector_r-fcn.py", line 61, in <module>
    cvOut = cvNet.forward()
cv2.error: OpenCV(4.1.1-openvino) /home/jenkins/workspace/OpenCV/OpenVINO/build/opencv/modules/dnn/src/dnn.cpp:2182: error: (-215:Assertion failed) inp.total() in function 'allocateLayers'

Or another program:

Traceback (most recent call last):
  File "/home/rsapiain/PycharmProjects/basics-smartcam/v0.1_etapas-sistema/predictor-imagen_PCB-drawCentroidDistances_verbose.py", line 531, in <module>
    detections_base = runInferenceOpenCVDNN(base_image, netModel)
  File "/home/rsapiain/PycharmProjects/basics-smartcam/v0.1_etapas-sistema/predictor-imagen_PCB-drawCentroidDistances_verbose.py", line 84, in runInferenceOpenCVDNN
    detections = neuralnet.forward()
cv2.error: OpenCV(4.1.1-openvino) /home/jenkins/workspace/OpenCV/OpenVINO/build/opencv/modules/dnn/src/dnn.cpp:2182: error: (-215:Assertion failed) inp.total() in function 'allocateLayers'

 

I found these: https://github.com/opencv/opencv/wiki/Intel's-Deep-Learning-Inference-Engine-backend

But i'd like to know if there are additional processes/considerations Intel uses (also, which gcc version: 5.x, 6x?  I'm using ubuntu 16.04)

 

The change I want to make is in the file: modules/dnn/src/layers/detection_output_layer.cpp

Line 932:  ieLayer.setConfidenceThreshold(_confidenceThreshold);

change to: ieLayer.setConfidenceThreshold(std::max(_confidenceThreshold, FLT_MIN))

 

 

According to the issue tracker (a response by dkurt), it may help me with the FRCNN and RFCN crashing.  https://github.com/opencv/opencv/issues/14839

 

Thank you in advance.

 

0 Kudos
3 Replies
Maksim_S_Intel
Employee
335 Views

Check output of cv::getBuildInformation() function, it contains information about compiler and 3rdparty libraries. You can run opencv_version application provided with OpenVINO toolkit with "--verbose" parameter to get same information.

Also, there should be build_params.txt file in the root of OpenCV directory of OpenVINO 2019R2. This file contains most of cmake options used to build OpenCV.

Sapiain__Roberto
Beginner
335 Views

Hi Maksim.

Thank you very much.

I'll check all of that and post my results with the modification in some days.

Basically what I need is to get an R-FCN to run on the ncs2, bu haven't had luck with that (it's slightly faster than the FRCNN, and more accurate than an inception-v2_SSD; and my use case requires accuracy).

Sapiain__Roberto
Beginner
335 Views

Hi.

Just as a heads-up.

It seems there is a fix in OpenCV for this issue (at least for Faster-RCNN, but since it crashed with the same error for both FRCNN and R-FCN, one can only hope).

Maybe in ocv-4.1.2 it will be included?

https://github.com/opencv/opencv/issues/14839#issuecomment-533801460

 

Best regards.