其他分享
首页 > 其他分享> > mediapipe win11环境安装配置,以及编译

mediapipe win11环境安装配置,以及编译

作者:互联网

参考:Installation - mediapipe (google.github.io)

1、MSYS2 安装

  安装到 C:\msys64, 添加环境变量 C:\msys64\usr\bin 到 PATH

  打开mysys,执行

pacman -Syu
pacman -Su

 pacman -S git patch unzip

 

2、Bazel 下载安装

Tags · bazelbuild/bazel (github.com),5.2.0

 

3、下载mediapipe

Tags · google/mediapipe (github.com),0.8.10

 

4、vs2017编译最新版的mediapipe失败,出现很多link2005错误,重定义问题,vs2019可以解决这个问题

Downloads - Visual Studio Subscriptions Portal,2019社区版下载;

安装选择桌面开发的那一套组件就可以;

环境变量,系统变量添加:

BAZEL_VS=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC
BAZEL_VC_FULL_VERSION=14.29.30133
BAZEL_WINSDK_FULL_VERSION=10.0.19041.0

 

 

 

 

 

 

5、编译命令

bazel build -c opt --action_env PYTHON_BIN_PATH="D://code//codePy//MODNet-master//venv//Scripts//python.exe" --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/selfie_segmentation:selfie_segmentation_cpu

 

6、运行命令

摄像头

bazel-bin\mediapipe\examples\desktop\selfie_segmentation\selfie_segmentation_cpu --calculator_graph_config_file=mediapipe\graphs\selfie_segmentation\selfie_segmentation_cpu.pbtxt

或者输入视频

bazel-bin\mediapipe\examples\desktop\selfie_segmentation\selfie_segmentation_cpu --calculator_graph_config_file=mediapipe\graphs\selfie_segmentation\selfie_segmentation_cpu.pbtxt --input_video_path=D:\dataW\testImg\video\testWen02.mp4 --output_video_path=bazel-bin\mediapipe\examples\desktop\selfie_segmentation\testWen02_out.mp4

 

标签:mediapipe,segmentation,bazel,--,selfie,编译,win11,cpu
来源: https://www.cnblogs.com/WenJXUST/p/16337724.html