-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
测试dll示例程序,可正常打开摄像头,总是返回Mediapipe_Hand_Tracking_Detect_Frame执行失败! #1
Comments
您好,请运行dll_use_example\Mediapipe_Hand_Tracking_Test\bin\Mediapipe_Hand_Tracking_Test\x64\Release下的Mediapipe_Hand_Tracking_Test.exe示例程序,并确保你的操作系统是Win10并正确安装了Win10SDK |
我配置好环境后,运行mediapipe官方的hand_tracking_cpu可以正常运行,可显示检测数据。然后我基于你的代码,在该环境下运行示例程序,总是卡在如下代码段: |
在程序运行时需要加载Mediapipe原仓库中的Tensowflow lite模型,所以需要将mediapipe\mediapipe\modules\hand_landmark下的模型放置在程序运行的同级目录下,并依然保持mediapipe\mediapipe\modules\hand_landmark目录层次,详情见Github项目。
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2021年8月17日(星期二) 下午4:53
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [HW140701/Google_Mediapipe_Hand_Tracking_dll] 测试dll示例程序,可正常打开摄像头,总是返回Mediapipe_Hand_Tracking_Detect_Frame执行失败! (#1)
您好,请运行dll_use_example\Mediapipe_Hand_Tracking_Test\bin\Mediapipe_Hand_Tracking_Test\x64\Release下的Mediapipe_Hand_Tracking_Test.exe示例程序,并确保你的操作系统是Win10并正确安装了Win10SDK
我配置好环境后,运行mediapipe官方的hand_tracking_cpu可以正常运行,可显示检测数据。然后我基于你的代码,在该环境下运行示例程序,总是卡在如下代码段:
MP_RETURN_IF_ERROR(m_Graph.AddPacketToInputStream(
m_kInputStream, mediapipe::Adopt(input_frame.release())
.At(mediapipe::Timestamp(frame_timestamp_us))));
跳不出来,不知道是哪个环节配置的有问题?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
您好,感谢您的回复,目前是在modules文件夹下还需要一个palm_detection文件夹,加上之后程序正常,多谢了! |
请问你跑的是预生成的debug下的exe吗?release下已经有这个文件夹呀 |
@HW140701 ,你好 |
请将Mediapipe仓库下所有的预训练模型下载下来,并参考官方demo的防止预训练模型的路径将预训练模型的文件夹放置到你自己的demo下,并确定官方的预训练模型能够被正确加载。 |
Hi, @HW140701 我从打印看是可正确加载读取文件的。 `
`
难道在so库内还调用了其他模型吗? |
检查下传进去的图片数据和图片数据宽高是不是有问题,我记得我当时宽高传反了,记得把mediapipe所有的预训练模型的那个文件夹都弄进去
发自我的iPhone
…------------------ 原始邮件 ------------------
发件人: erwangccc ***@***.***>
发送时间: 2021年12月23日 18:15
收件人: HW140701/Google_Mediapipe_Hand_Tracking_dll ***@***.***>
抄送: StubbornHuang ***@***.***>, Mention ***@***.***>
主题: 回复:[HW140701/Google_Mediapipe_Hand_Tracking_dll] 测试dll示例程序,可正常打开摄像头,总是返回Mediapipe_Hand_Tracking_Detect_Frame执行失败! (#1)
Hi, @HW140701
感谢回复!
我从打印看是可正确加载读取文件的。
`
dll存在 dll加载成功! Mediapipe_Hand_Tracking_Init获取成功 Mediapipe_Hand_Tracking_Reigeter_Landmarks_Callback获取成功 Mediapipe_Hand_Tracking_Register_Gesture_Result_Callback获取成功 Mediapipe_Hand_Tracking_Detect_Frame获取成功 Mediapipe_Hand_Tracking_Detect_Video获取成功 Mediapipe_Hand_Tracking_Release获取成功 初始化模型成功 注册坐标回调函数成功 注册手势识别结果回调函数成功 ===> Read frames 成功! Mediapipe_Hand_Tracking_Detect_Frame执行失败! ===> Read frames 成功!
`
但是Mediapipe_Hand_Tracking_Detect_Frame依然执行失败。
我加入了一些打印,但是好像没有走到这里。
`extern "C" int Mediapipe_Hand_Tracking_Detect_Frame(int image_index, int image_width, int image_height, void* image_data) { std::cout << "Mediapipe_Hand_Tracking_Detect_Frame start!" << std::endl; return m_HandTrackingDetect.DetectFrame(image_index, image_width, image_height, image_data); std::cout << "Mediapipe_Hand_Tracking_Detect_Frame end!" << std::endl; }`
难道在so库内还调用了其他模型吗?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@HW140701
应该也会执行,然后DetectFrame报错才对。代码因为要在ubantu跑,我修改过。但是大的逻辑没改动。 这个是没问题的吧? |
现在的问题是我没有在Ubuntu上对代码测试过。我给点排除问题的建议吧:
找一个官方的demo试一下看可不可以运行,当然不是helloworld那个
如果官方demo运行没问题,那就在那个函数中多打些log,逐步确定问题出在哪里
手机打的,没排版
发自我的iPhone
…------------------ 原始邮件 ------------------
发件人: erwangccc ***@***.***>
发送时间: 2021年12月23日 18:33
收件人: HW140701/Google_Mediapipe_Hand_Tracking_dll ***@***.***>
抄送: StubbornHuang ***@***.***>, Mention ***@***.***>
主题: 回复:[HW140701/Google_Mediapipe_Hand_Tracking_dll] 测试dll示例程序,可正常打开摄像头,总是返回Mediapipe_Hand_Tracking_Detect_Frame执行失败! (#1)
@HW140701
我感觉如果宽高反了,这句:
std::cout << "Mediapipe_Hand_Tracking_Detect_Frame start!" << std::endl;
应该也会执行,然后DetectFrame报错才对。代码因为要在ubantu跑,我修改过。但是大的逻辑没改动。
我的模型文件放置:
这个是没问题的吧?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@HW140701 |
OK
发自我的iPhone
…------------------ 原始邮件 ------------------
发件人: erwangccc ***@***.***>
发送时间: 2021年12月24日 19:43
收件人: HW140701/Google_Mediapipe_Hand_Tracking_dll ***@***.***>
抄送: StubbornHuang ***@***.***>, Mention ***@***.***>
主题: 回复:[HW140701/Google_Mediapipe_Hand_Tracking_dll] 测试dll示例程序,可正常打开摄像头,总是返回Mediapipe_Hand_Tracking_Detect_Frame执行失败! (#1)
@HW140701
跑通了。模型文件的层次要去掉一层mediapipe文件才行。
再有,ubantu上跑,只需要将dll/hand_tracking_test/的文件拿出来,需要做少量的代码里的环境配置删掉一些。然后cmake/g++编译即可。
Thanks!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@HW140701 同感谢您的分享。我遇到的问题是 Debug 模式下会遇到这个问题,Release下没有问题。 简单说就是 dll_path 只能设置为
而不能设置为
请教是什么原因呢? |
Debug和Release在VisualStudio用Ctrl+F5执行的项目路径是不一样的,执行Debug的是直接在vs下使用Ctrl+F5运行程序,这么基础的东西应该清楚啊 |
我说的不是这个问题。 我的意思是,
上面的代码必须改为
Debug 模式下才能执行成功。不知道为什么指定了完整的相对路径时会失败。 另外,两个模式都可以Ctrl+F5,执行的也是对应模式的exe。 |
啊?这个我是不知道是什么原因 |
@HW140701 好的。 |
我也遇到了在windows下 |
如果不是用的我仓库中指定的mediapipe的这个版本,需要自行使用Mediapipe的最新版本,并参考我目前这个项目设置和路径放置官方的模型文件,检查一下,一定是你自己的问题 |
您好,非常感谢您分享的的handtracking封装代码,我在做测试的时候总是返回执行失败,命令行提示的初始化等步骤都是成功的,最后显示出摄像头画面,但是一直执行失败,无法输出手部检测结果,请问是这种现象,可能是哪个地方出问题了?
The text was updated successfully, but these errors were encountered: