参考:
https://medium.com/@dgmaxime/how-to-easily-install-detectron2-on-windows-10-39186139101c
==1==
https://docs.conda.io/en/latest/miniconda.html
安装conda,设置镜像地址
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set global.trusted-host mirrors.aliyun.com
==2==
安装第三方模块
Install Cuda
Install Torch
pip install opencv-python
==3==
安装VS2019(VS2017)
==4==
https://github.com/DGMaxime/detectron2-windows.git
cd D:\apdata\test\detectron2-windows
“C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat”
set DISTUTILS_USE_SDK=1
python setup.py build develop
pip install -e .
==5==
https://pypi.org/project/pycocotools-windows/
pip install opencv-python
pip install numpy scipy pandas matplotlib scikit-learn
pip install cython
pip install pycocotools-windows
pip install Cython
pip install Pillow
pip install yacs
pip install termcolor
pip install cityscapesScripts
pip install tabulate
pip install tqdm
pip install lvis
pip install psutil
pip install fvcore
pip install pycocotools
caffe2 需要编译,
https://download.pytorch.org/whl/torch_stable.html
# CUDA 10.2
pip install torch==1.6.0 torchvision==0.7.0
# CUDA 10.1
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
# CUDA 9.2
pip install torch==1.6.0+cu92 torchvision==0.7.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html
# CPU only
pip install torch==1.6.0+cpu torchvision==0.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install torch==1.5.1+cu92 torchvision==0.6.1+cu92 -f https://download.pytorch.org/whl/torch_stable.html
pip install cv2 PIL pycocotools yacs termcolor cityscapesscripts tabulate tqdm scipy lvis psutil pkg_resources caffe2 onnx
“C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat”
python setup.py build develop
cd D:\apdata\test\detectron2-windows
set DISTUTILS_USE_SDK=1
python demo.py –config-file D:/apdata/test/detectron2-windows/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml –webcam –output outputs –opts MODEL.WEIGHTS ‘D:/apdata/test/detectron2-windows/demo/R-50.pkl’
python demo.py –config-file D:/apdata/test/detectron2-windows/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml –webcam –opts MODEL.WEIGHTS ‘D:/apdata/test/detectron2-windows/demo/R-50.pkl’
python C:/test/detectron2-windows/demo/demo.py –config-file C:/test/detectron2-windows/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml –webcam –opts MODEL.WEIGHTS ‘C:/test/detectron2-windows/demo/R-50.pkl’
https://pypi.org/project/pycocotools-windows/