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.
6404 Discussions

Failure 'videoio/src/cap.cpp (265) open VIDEOIO(AVFOUNDATION): raised unknown C++ exception! when run 'face_recognition_demo.py'

Yang__Chunlin
Beginner
1,496 Views

Dear support,

I'm running face_recognition_demo.py, there are two png format face photo in my face_gallery folder.

 

Don't know why it throws an error saying can't open the video, there is no video here,

 

 [ERROR:0] global /localdisk/jenkins/workspace/OpenCV/OpenVINO/2020.2/build/osx/opencv/modules/videoio/src/cap.cpp (265) open VIDEOIO(AVFOUNDATION): raised unknown C++ exception!

 

Detailed log:

 

 python3 ./deployment_tools/open_model_zoo/demos/python_demos/face_recognition_demo/face_recognition_demo.py -m_fd ./my/download/directory/intel/face-detection-retail-0004/FP16/face-detection-retail-0004.xml -m_lm ./my/download/directory/intel/landmarks-regression-retail-0009/FP16/landmarks-regression-retail-0009.xml -m_reid ./my/download/directory/intel/face-reidentification-retail-0095/FP16/face-reidentification-retail-0095.xml --verbose -fg "$HOME/Downloads/face_gallery"
   [ DEBUG ] 2020-04-21 12:53:55,330 Namespace(allow_grow=False, cpu_lib='', crop_height=0, crop_width=0, d_fd='CPU', d_lm='CPU', d_reid='CPU', exp_r_fd=1.15, fd_input_height=0, fd_input_width=0, fg='/Users/chunlina/Downloads/face_gallery', gpu_lib='', input='0', m_fd='./my/download/directory/intel/face-detection-retail-0004/FP16/face-detection-retail-0004.xml', m_lm='./my/download/directory/intel/landmarks-regression-retail-0009/FP16/landmarks-regression-retail-0009.xml', m_reid='./my/download/directory/intel/face-reidentification-retail-0095/FP16/face-reidentification-retail-0095.xml', match_algo='HUNGARIAN', no_show=False, output='', perf_stats=False, run_detector=False, t_fd=0.6, t_id=0.3, timelapse=False, verbose=True)
   [ INFO ] 2020-04-21 12:53:55,331 Loading models
   [ INFO ] 2020-04-21 12:53:55,331 Loading the model from '/opt/intel/openvino_2020.2.117/my/download/directory/intel/face-detection-retail-0004/FP16/face-detection-retail-0004.xml'
   ./deployment_tools/open_model_zoo/demos/python_demos/face_recognition_demo/face_recognition_demo.py:177: DeprecationWarning: Reading network using constructor is deprecated. Please, use IECore.read_network() method instead
     model = IENetwork(model_description_path, model_weights_path)
   [ INFO ] 2020-04-21 12:53:55,348 Model is loaded
   [ INFO ] 2020-04-21 12:53:55,348 Loading the model from '/opt/intel/openvino_2020.2.117/my/download/directory/intel/landmarks-regression-retail-0009/FP16/landmarks-regression-retail-0009.xml'
   ./deployment_tools/open_model_zoo/demos/python_demos/face_recognition_demo/face_recognition_demo.py:177: DeprecationWarning: Reading network using constructor is deprecated. Please, use IECore.read_network() method instead
     model = IENetwork(model_description_path, model_weights_path)
   [ INFO ] 2020-04-21 12:53:55,358 Model is loaded
   [ INFO ] 2020-04-21 12:53:55,358 Loading the model from '/opt/intel/openvino_2020.2.117/my/download/directory/intel/face-reidentification-retail-0095/FP16/face-reidentification-retail-0095.xml'
   ./deployment_tools/open_model_zoo/demos/python_demos/face_recognition_demo/face_recognition_demo.py:177: DeprecationWarning: Reading network using constructor is deprecated. Please, use IECore.read_network() method instead
     model = IENetwork(model_description_path, model_weights_path)
   [ INFO ] 2020-04-21 12:53:55,418 Model is loaded
   [ INFO ] 2020-04-21 12:53:56,381 Models are loaded
   [ INFO ] 2020-04-21 12:53:56,381 Building faces database using images from '/Users/chunlina/Downloads/face_gallery'
   [ DEBUG ] 2020-04-21 12:53:56,421 Adding label person_2_name to the gallery.
   [ DEBUG ] 2020-04-21 12:53:56,422 Adding label person_2_name to the database
   [ DEBUG ] 2020-04-21 12:53:56,422 The database length is 1.
   [ DEBUG ] 2020-04-21 12:53:56,449 Adding label person_1_name to the gallery.
   [ DEBUG ] 2020-04-21 12:53:56,449 Adding label person_1_name to the database
   [ DEBUG ] 2020-04-21 12:53:56,449 The database length is 2.
   [ INFO ] 2020-04-21 12:53:56,449 Database is built, registered 2 identities
   [ INFO ] 2020-04-21 12:53:56,452 Reading input data from '0'
   2020-04-21 12:53:56.457 Python[7756:135897] +[AVCaptureDevice authorizationStatusForMediaType:]: unrecognized selector sent to class 0x7fff8806d6a0
   [ERROR:0] global /localdisk/jenkins/workspace/OpenCV/OpenVINO/2020.2/build/osx/opencv/modules/videoio/src/cap.cpp (265) open VIDEOIO(AVFOUNDATION): raised unknown C++ exception!


   [ ERROR ] 2020-04-21 12:53:56,458 Cannot open input stream: 0
   [ INFO ] 2020-04-21 12:53:56,458 Input stream info: 0 x 0 @ 0.00 FPS

 

BTW, I have converted the models to IR format, and also from above run log, models are successfully loaded, so issue seems not on the models.

One thing not understand is, after running the converter.py, it says '========= Skipping face-detection-retail-0004 (no conversions defined)', does it mean the model (*.xml is already in IR format?)

$ cd deployment_tools/open_model_zoo/tools/downloader/

$ ./converter.py --name=face-detection-retail-0004

========= Skipping face-detection-retail-0004 (no conversions defined)

 

$ ./converter.py --name=landmarks-regression-retail-0009

========= Skipping landmarks-regression-retail-0009 (no conversions defined)

 

Hi $ ./converter.py --name=face-reidentification-retail-0095

========= Skipping face-reidentification-retail-0095 (no conversions defined)

 

(venv-py377-421) chunlina-mac01:downloader chunlina$ 

 

Thanks a lot!

 

Br,

Andrew

0 Kudos
3 Replies
Maksim_S_Intel
Employee
1,496 Views

1. This application accepts input image/video via "-i" option, please run it with "--help" option for more details.

2. OpenCV VideoCapture does not support folder as an input, you should provide a filename.

0 Kudos
Chunlin_Y_Intel
Employee
1,496 Views

Thanks Maksim!

I did below command:

python3 ./deployment_tools/open_model_zoo/demos/python_demos/face_recognition_demo/face_recognition_demo.py -m_fd ./my/download/directory/intel/face-detection-retail-0004/FP16/face-detection-retail-0004.xml -m_lm ./my/download/directory/intel/landmarks-regression-retail-0009/FP16/landmarks-regression-retail-0009.xml -m_reid ./my/download/directory/intel/face-reidentification-retail-0095/FP16/face-reidentification-retail-0095.xml --verbose -i "/Users/chunlina/Downloads/face_gallery/person_1_name.png"

 

It fails, saying it needs -fg 

Then I used below command:

python3 ./deployment_tools/open_model_zoo/demos/python_demos/face_recognition_demo/face_recognition_demo.py -m_fd ./my/download/directory/intel/face-detection-retail-0004/FP16/face-detection-retail-0004.xml -m_lm ./my/download/directory/intel/landmarks-regression-retail-0009/FP16/landmarks-regression-retail-0009.xml -m_reid ./my/download/directory/intel/face-reidentification-retail-0095/FP16/face-reidentification-retail-0095.xml --verbose -fg /Users/chunlina/Downloads/face_gallery/person_1_name.png

it throws below error which is in bold

but my picture is in correct png format though.

[ INFO ] 2020-04-30 09:43:43,374 Model is loaded

[ INFO ] 2020-04-30 09:43:44,203 Models are loaded

[ INFO ] 2020-04-30 09:43:44,203 Building faces database using images from '/Users/chunlina/Downloads/face_gallery/person_1_name.png'

[ ERROR ] 2020-04-30 09:43:44,203 Wrong face images database path. Expected a path to the directory containing jpg or png files, but got '/Users/chunlina/Downloads/face_gallery/person_1_name.png'

[ ERROR ] 2020-04-30 09:43:44,203 The images database folder has no images.

[ INFO ] 2020-04-30 09:43:44,203 Database is built, registered 0 identities

[ INFO ] 2020-04-30 09:43:44,206 Reading input data from '0'

2020-04-30 09:43:44.209 Python[2181:31330] +[AVCaptureDevice authorizationStatusForMediaType:]: unrecognized selector sent to class 0x7fff9ccb76a0

[ERROR:0] global /localdisk/jenkins/workspace/OpenCV/OpenVINO/2020.2/build/osx/opencv/modules/videoio/src/cap.cpp (265) open VIDEOIO(AVFOUNDATION): raised unknown C++ exception!

 

 

[ ERROR ] 2020-04-30 09:43:44,209 Cannot open input stream: 0

[ INFO ] 2020-04-30 09:43:44,209 Input stream info: 0 x 0 @ 0.00 FPS

(venv-py377-421) cbmostel-mobl3:openvino chunlina$ 

Would you pls tell me 

0 Kudos
Yang__Chunlin
Beginner
1,496 Views

Issue solved, I give -i and specify a video file name, and it works. Thanks @ Maksim S. (Intel)

0 Kudos
Reply