google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.58k stars 5.16k forks source link

failed to run Face Mesh example as dbg mode #3752

Closed Fogrunner closed 2 years ago

Fogrunner commented 2 years ago

Please make sure that this is a bug and also refer to the troubleshooting, FAQ documentation before raising any issues.

System information (Please provide as much relevant information as possible)

Describe the current behavior:

When run the face mesh example code with a testing video file, the program is crashed.

I could see Debug Assertion Failed! Dialog.

The dialog said ..\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\xutility Line:1375

Expression : cannot seek array iterator after end

The FaceMesh example code works well with opt mode. But, when i build it as dbg like below. It is happened.

bazel build -c dbg --define MEDIAPIPE_DISABLE_GPU=1 //mediapipe/examples/desktop/face_mesh:face_mesh_cpu

The FaceMesh graphs might be needed 'face_detection_short_range.tflite' file. So, i built FaceDetection example first.

bazel build -c dbg --define MEDIAPIPE_DISABLE_GPU=1 //mediapipe/examples/desktop/face_detection:face_detection_cpu

The FaceDection example works wells as dbg mode . But, FaceMesh is not working. (used the same video file)

I traced the example code with VS CODE Debugger.

// Capture opencv camera or video frame.

> 88:   cv::Mat camera_frame_raw;
> 89:   capture >> camera_frame_raw; <<--- this line makes assertion!

If i remove 'face_detection_short_range.tflite' file from folder. The line will pass without any problem,

> 114: MP_RETURN_IF_ERROR(graph.AddPacketToInputStream( kInputStream, mediapipe::Adopt(input_frame.release())
>                           .At(mediapipe::Timestamp(frame_timestamp_us))));

But, above code line will break programe with 'Can not find : face_detection_short_range.tflite' message.

I am still confusing whether it is opencv related bug or mediapipe or bazel. Yes, also it could be i did something wrong by myself.

Please give me some piece of advices.

Describe the expected behavior:

The FaceMesh demo will run.

Standalone code to reproduce the issue: Provide a reproducible test case that is the bare minimum necessary to replicate the problem. If possible, please share a link to Colab/repo link /any notebook:

Other info / Complete Logs : Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached

... Loaded 'C:\Windows\System32\IME\IMEKR\imkrapi.dll'. Loaded 'C:\Windows\System32\policymanager.dll'. Loaded 'C:\Windows\System32\msvcp110_win.dll'. Loaded 'C:\Windows\System32\IME\SHARED\IMJKAPI.DLL'. 3 Exception thrown at 0x00007FFDC5634FD9 (KernelBase.dll) in face_mesh_cpu.exe: WinRT originate error - 0xC00D36B3 : '제공된 스트림 번호가 잘못되었습니다.'. Loaded 'C:\Windows\System32\avrt.dll'. 16 Exception thrown at 0x00007FFDC5634FD9 in face_mesh_cpu.exe: Microsoft C++ exception: _com_error at memory location 0x000000340DFFD4B0. Unloaded 'C:\Windows\System32\avrt.dll'. Unloaded 'C:\Windows\System32\winmm.dll'. Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_df0bee9f4cb9436e\nvwgf2umx.dll'. Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_df0bee9f4cb9436e\nvldumdx.dll'. ...

Fogrunner commented 2 years ago

After VS 2019 update. The problem is fixed. It seems to be working.

google-ml-butler[bot] commented 2 years ago

Are you satisfied with the resolution of your issue? Yes No