## Installation Our [Colab Notebook](https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5) has step-by-step instructions that install detectron2. The [Dockerfile](docker) also installs detectron2 with a few simple commands. ### Requirements - Linux or macOS with Python ≥ 3.6 - PyTorch ≥ 1.4 and [torchvision](https://github.com/pytorch/vision/) that matches the PyTorch installation. You can install them together at [pytorch.org](https://pytorch.org) to make sure of this - OpenCV is optional and needed by demo and visualization ### Build Detectron2 from Source gcc & g++ ≥ 5 are required. [ninja](https://ninja-build.org/) is recommended for faster build. After having them, run: ``` python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' # (add --user if you don't have permission) # Or, to install it from a local clone: git clone https://github.com/facebookresearch/detectron2.git python -m pip install -e detectron2 # Or if you are on macOS CC=clang CXX=clang++ python -m pip install ...... ``` To __rebuild__ detectron2 that's built from a local clone, use `rm -rf build/ **/*.so` to clean the old build first. You often need to rebuild detectron2 after reinstalling PyTorch. ### Install Pre-Built Detectron2 (Linux only) Choose from this table to install [v0.2.1 (Aug 2020)](https://github.com/facebookresearch/detectron2/releases):
CUDA | torch 1.6 | torch 1.5 | torch 1.4 |
---|---|---|---|
10.2 | install | install | |
10.1 | install | install | install |
10.0 | install | ||
9.2 | install | install | install |
cpu | install | install | install |