Skip to content

This is the steps I did to setup Detectron2 from FacebookResearch Repository to Windows 10 Machine

License

Notifications You must be signed in to change notification settings

aldyhelnawan/detectron2_windows_installation_guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

detectron2_windows_installation_guide

My method to install detectron2 for Windows 10 with Anaconda (April 9th 2022)

Here's the env file consist of 2 types of pytorch, the gpu (that CUDA enable), and the cpu only.

The first thing to do is to clone the detectron2 repository:

git clone https://github.com/facebookresearch/detectron2.git

And the requirements for Windows 10:

  1. Ninja for Windows (For reference see Ninja Build Website)
  2. Install MinGW 64-bit (CygWin is also ok)
  3. Install Visual Code Studio 2019
  4. Install Nvidia CUDA 11.0 (Or check the recommended version from the guide)

The requirements for your python environment using anaconda:

  1. Python 3.8

  2. Install pytorch for cuda >=11.0 (for reference see Pytorch Website). Example:

    conda install pytorch torchvision torchaudio cudatoolkit=11.0 -c pytorch
    
  3. Install Cython

    pip install cython
    

    or

    conda install -c anaconda cython
    
  4. Install OpenCV

    pip install opencv-python
    
  5. Install Pywin32

    pip install pywin32
    

    or

    conda install -c conda-forge pywin32
    
  6. Install pycocotools

    pip install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
    
  7. Install git (if git doesn't detected on your cmd)

    conda install -c anaconda git
    

For the steps, install these dependencies before install detectron2 to your python environment. For instaling detectron2 see here

Optional

Despite of manually install the anaconda environment for installing detectron2, here's the anaconda env (.yaml) file you can use. After import the venv, the next step you need to do is setup the detectron2:

  • Set the distutils

    SET DISTUTILS_USE_SDK=1
    
  • Call the vcvars64.bat file to your cmd window:

    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
    
  • Go to the detectron2 folder, and insert this command:

    python setup.py build develop
    
  • Then, you can check the installation by check pytorch and detectron2 (See the official guide here1 or here2 to confirm the installation).

Reference:

Detectron2

@misc{wu2019detectron2, author = {Yuxin Wu and Alexander Kirillov and Francisco Massa and Wan-Yen Lo and Ross Girshick}, title = {Detectron2}, howpublished = {\url{https://github.com/facebookresearch/detectron2}}, year = {2019} }

Pytorch

https://pytorch.org/

Pytorch Forum

Solution by RujunLong's comment

AugmentedStartups

Got some solution from this video by AugmentedStartups

Github Detectron2 Issue#9

You can see for other solutions here

About

This is the steps I did to setup Detectron2 from FacebookResearch Repository to Windows 10 Machine

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published