- Install MSYS2 and edit the
%PATH%
environment variable.
If MSYS2 is installed toC:\msys64
, addC:\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中的pacman包管理工具安装你喜爱的Vim、Git、GCC等工具软件了。
- 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
- Install Python and allow the executable to edit the %PATH% environment variable.
- Install Visual C++ Build Tools 2019 and WinSDK
- 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. - 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
- 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啊,看看兼不兼容吧~
好吧不兼容 -。-
- 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!