谷歌 MediaPipe 框架 环境配置,无法 fetch libyuv

Windows安装指南

  1. Install MSYS2 and edit the %PATH% environment variable.
    If MSYS2 is installed to C:\msys64, add C:\msys64\usr\bin to your %PATH% environment variable.

MSYS2 (Minimal SYStem 2)MSYS2 是MSYS的一个升级版,准确的说是集成了pacman和Mingw-w64的Cygwin升级版, 提供了bash shell等linux环境、版本控制软件(git/hg)和MinGW-w64 工具链。与MSYS最大的区别是移植了 Arch Linux的软件包管理系统 Pacman(其实是与Cygwin的区别)。

MSYS2 的窗口
可以使用MSYS2中的pacman包管理工具安装你喜爱的Vim、Git、GCC等工具软件了。

  1. Install necessary packages. 【先完整看完这一部分,再进行操作,避免踩坑】
    pacman -S git patch unzip
    如果在git bash中执行,需要cygwin1.dl: 需要在windows环境下运行linux命令,需要安装cygwin:阿里镜像稳~ http://mirrors.aliyun.com/cygwin/

Cygwin 是许多自由软件的集合,最初由 Cygnus Solutions 开发,用于各种版本的 Microsoft Windows 上,运行类 UNIX 系统。Cygwin 的主要目的是通过重新编译,将 POSIX 系统上的软件移植到 Windows 上。

安装好 cywin 之后,发现好庞大,查了一下“Cygwin、Msys、MinGW、Msys2的区别与联系”:Cygwin 最老了,又庞大不优雅;mingw是一套运行在win下的linux的工具链(开发环境);msys2是对cygwin的精简,最新最优雅了,还提供了pacman这个包管理工具!

区别(小结):Cygwin是模拟 POSIX 系统,源码移植 Linux 应用到 Windows 下;MinGW 是用于开发 Windows 应用的开发环境。
联系:均提供了部分 Linux 下的应用,多跑在 Windows 上;MinGW 作为 Cygwin 下的软件包,可以在 Cygwin 上运行。

如果在msys2的窗口中执行: pacman -S git patch unzip

下载大小:  16.86 MiB
全部安装大小:  95.55 MiB

:: 进行安装吗? [Y/n] n

到这里我人傻了!!! !!! !!! !!! !!! !!! !!! !!! !!!
git patch unzip 这些命令我都有啊?
结果发现,git bash 是基于MSYS2的,第一步第二步白装了?
在这里插入图片描述
区别在于:
在这里插入图片描述
MSYS2就是一个小linux 系统呀,etc,var,usr,这些都很全;pacman这个包管理工具在etc目录下
在这里插入图片描述
但是git bash就方便在 右键呼出gIt bash here
那就写个脚本实现 右键菜单栏呼出 MSYS 吧
msys_mingw.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\MSYS2 MinGW 64-bit Here]
@=""
"Extended"=""
"NoWorkingDirectory"=""
"Icon"="D:\\msys64\\mingw64.ico"

[HKEY_CLASSES_ROOT\Directory\Background\shell\MSYS2 MinGW 64-bit Here\command]
@="D:\\msys64\\msys2_shell.cmd -mingw64 -where %V"

msys.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\MSYS2 MinGW 64-bit Here]
@=""
"Extended"=""
"NoWorkingDirectory"=""
"Icon"="D:\\msys64\\msys2.ico"

[HKEY_CLASSES_ROOT\Directory\Background\shell\MSYS2 Here\command]
@="D:\\msys64\\msys2.exe"

Shift + 右键 呼出
在这里插入图片描述

然后又陷入了沉思。msys2中并没有git。没必要给电脑再安装一遍git啊;(逼死强迫症…
两套方案:(1)msys 与 git 官网安装的 git 共存,git bash 中无法配置的命令,再来使用msys
(2)官网安装的git删了算了,以后使用linux命令的时候,直接呼出msys,或者呼出msys mingw;
以后都在MSYS2中用pacman管理包,包括git,unzip啊之类的;看上去方案(2)更优雅一点

那么,何不使用 Windows 的 Linux 子系统呢?

最终!

方案(2)启动!Git 和 Cygwin都删了删了,只保留 msys2
uninstall_cygwin.bat

SET DIRECTORY_NAME="D:\cygwin64"
C:\windows\system32\TAKEOWN /f %DIRECTORY_NAME% /r /d y
C:\windows\system32\ICACLS %DIRECTORY_NAME% /grant administrators:F /t
PAUSE
  1. Install Python and allow the executable to edit the %PATH% environment variable.
  2. Install Visual C++ Build Tools 2019 and WinSDK
  3. Install Bazel and add the location of the Bazel executable to the %PATH% environment variable.
    Follow the official Bazel documentation to install Bazel 3.4 or higher.
  4. Set Bazel variables.
# Find the exact paths and version numbers from your local version.
C:\> set BAZEL_VS=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
C:\> set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC
C:\> set BAZEL_SH=D:\msys64\usr\bin、

配置bazel,建议不使用命令行,直接编辑系统环境变量
直接把“bazel.exe”丢进MSYS2的bin目录,省去添加bazel目录到PATH
在这里插入图片描述
7. Checkout MediaPipe repository.

git clone https://github.com/google/mediapipe.git
cd mediapipe
  1. Install OpenCV.

Download the Windows executable from https://opencv.org/releases/ and install. We currently use OpenCV 3.4.10. Remember to edit the WORKSPACE file if OpenCV is not installed at C:\opencv.

new_local_repository(
    name = "windows_opencv",
    build_file = "@//third_party:opencv_windows.BUILD",
    path = "D:\\AlexLibrary\\opencv\\build",
)

我电脑里装的是opencv42啊,看看兼不兼容吧~
好吧不兼容 -。-

  1. Run the Hello World desktop example.
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C://Users//Alex//anaconda3//python.exe" mediapipe/examples/desktop/hello_world
set GLOG_logtostderr=1
bazel-bin\mediapipe\examples\desktop\hello_world\hello_world.exe

挺成功
下面试一试build autoflip

conda create -n media python=3.6
conda activate media
pip install -r .\requirements.txt
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C://Users//Alex//anaconda3//envs//media//python.exe" mediapipe/examples/desktop/autoflip:run_autoflip

libyuv 总是fetch失败,官方建议全局代理试试,然并卵- -
在这里插入图片描述手动下载,放到红框路径下。然并卵,这是个临时路径,每次执行命令都不一样的- -
http.bzl的111行是个fetch的函数,然并卵

mediapipe/mediapipe/calculators/image/BUILD:389:11
在这里插入图片描述
libyuv全文件只出现了一次。。看来想改个下载路径也难啊。。

You may also need to append --host_jvm_args “-DsocksProxyHost= -DsocksProxyPort=” to the Bazel command. See this Issue for more details.

试试看,某v2 的host 和 端口是经过了隐藏么 -。- 🐕🐕🐕🐕🐕🐕

失败。放弃。

还是自己去实现auto flip 吧 orz。。。
他真的很酷,我想要一个能覆盖全身关节点的版本的,最好 9:16!
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值