These installation instructions have been slightly adapted from the original Mask2Former instructions.
- Linux or macOS with Python ≥ 3.6
- PyTorch ≥ 1.9 and torchvision that matches the PyTorch installation. Install them together at pytorch.org to make sure of this. Note, please check PyTorch version matches that is required by Detectron2.
- Detectron2: follow Detectron2 installation instructions.
- OpenCV is optional but needed by demo and visualization
pip install -r requirements.txt
After preparing the required environment, run the following command to compile CUDA kernel for MSDeformAttn:
CUDA_HOME
must be defined and points to the directory of the installed CUDA toolkit.
cd tapps/modeling/pixel_decoder/ops
sh make.sh
To build on a system that does not have a GPU device but provide the drivers:
TORCH_CUDA_ARCH_LIST='8.0' FORCE_CUDA=1 python setup.py build install
conda create --name tapps python=3.9 -y
conda activate tapps
conda install pytorch==1.13.1 torchvision==0.14.1 pytorch-cuda=11.7 -c pytorch -c nvidia
conda install ruamel.yaml pandas scipy shapely h5py
pip install -U opencv-python
# under your working directory
git clone [email protected]:facebookresearch/detectron2.git
cd detectron2
python -m pip install -e .
pip install git+https://github.com/cocodataset/panopticapi.git
pip install git+https://github.com/mcordts/cityscapesScripts.git
cd ..
git clone https://github.com/tue-mps/tapps.git
cd TAPPS
pip install timm submitit cython scikit-image psutil scikit-learn
cd tapps/modeling/pixel_decoder/ops
sh make.sh