2 Star 0 Fork 1

Xuanyi.shenzhen / MediapipeHandTracking

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Mediapipe Hand Tracking

项目简介

将Google Mediapipe中的手部追踪与识别功能封装成动态链接库,通过调用该库可以在桌面应用程序中进行手势识别以及得到手部关节坐标点。

参考Mediapipe – 将Mediapipe handtracking封装成动态链接库dll/so,实现在桌面应用中嵌入手势识别功能的文档实现。

将hand_tracking封装成库的代码参见github

Windows下的编译请参考上面的文档,本文档仅介绍如何在MacOS下编译和运行hand tracking。

代码下载

  1. 下载mediapipe_hand_tracking源码
git clone https://gitee.com/xuanyishenzhen/mediapipe_hand_tracking.git

2.下载mediapipe源码

git clone https://github.com/google/mediapipe.git

编译方法:

一、编译动态库

  1. mediapipe_hand_tracking目录中的mediapipe_hand_tracking拷贝到mediapipe/mediapipe/example/desktop/目录中
cp -r mediapipe_hand_tracking/mediapipe_hand_tracking mediapipe/mediapipe/example/desktop/
  1. 编译
cd mediapipe
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/mediapipe_hand_tracking:MediapipeHandTracking --verbose_failures

注意:编译过程中如果报头文件找不到的错误,说明依赖有误,需要先查找相应头文件在哪个包中,然后编辑BUILD文件,在deps中增加相应的包即可。

二、编译测试程序

  1. 将生成的动态库libMediapipeHandTracking.so(在bazel-bin/mediapipe/examples/desktop/mediapipe_hand_tracking目录)复制到此项目的lib目录中
cp bazel-bin/mediapipe/examples/desktop/mediapipe_hand_tracking/libMediapipeHandTracking.so ../mediapipe_hand_tracking/lib
  1. 编译测试程序

    cd mediapipe_hand_tracking/build
    cmake ..
    make
  2. 创建动态库目录

    mkdir -p bazel-out/darwin-opt/bin/mediapipe/examples/desktop/mediapipe_hand_tracking
  3. 将动态库libMediapipeHandTracking.so复制到该目录

    cp ../lib/libMediapipeHandTracking.so bazel-out/darwin-opt/bin/mediapipe/examples/desktop/mediapipe_hand_tracking/

三、运行

  1. hand_tracking_desktop_live.pbtxt复制到可执行文件所在的目录(build)。

  2. 创建保存模型文件的目录

    mkdir -p mediapipe/modules
  3. 从mediapipe项目中将hand_landmarkpalm_detection两个目录复制到mediapipe/modules目录中

  4. 运行

    ./MediapipeHandTracking
MIT License Copyright (c) 2021 Xuanyi.shenzhen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

使用Mediapipe进行手势识别和手的3D坐标点捕获的测试代码。 代码参考https://github.com/HW140701/Google_Mediapipe_Hand_Tracking_dll实现。 此代码在MacOS上测试通过,其他平台可能略有不同,需要自行修改。 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/xuanyishenzhen/mediapipe_hand_tracking.git
git@gitee.com:xuanyishenzhen/mediapipe_hand_tracking.git
xuanyishenzhen
mediapipe_hand_tracking
MediapipeHandTracking
master

搜索帮助