Detectron2 Setup on Windows 10 and Linux
Jun 28, 2021
- Download and Install Anaconda
- Open Anaconda Prompt and create a new virtual environment by using the command:
conda create -n detectron_env python=3.8
- Activate the environment:
conda activate detectron_env
- Once done, install cython
pip install cython
- Install Pytorch and CUDA:
conda install pytorch torchvision torchaudio cudatoolkit=11.0 -c pytorch
- Clone Detectron2 repository:
git clone https://github.com/facebookresearch/detectron2.git
- Got to the downloaded repository folder:
cd detectron2
- Install dependencies:
pip install -e .
- Then install OpenCV
pip install opencv-python
That's it! Now you are ready to use detectron2 in your Python codes. If you are interested in learning how to use detectron2 for instance segmentation, object detection, or keypoints detection, refer to the following video: