Skip to content

Commit

Permalink
🔨 Fix Detectron2 installation
Browse files Browse the repository at this point in the history
  • Loading branch information
praeclarumjj3 committed Jun 8, 2023
1 parent 7145cda commit 56799ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 1 addition & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ We use an evironment with the following specifications, packages and dependencie
pip3 install -U opencv-python

# Install detectron2
python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html
python tools/setup_detectron2.py

# Install other dependencies
pip3 install git+https://github.com/cocodataset/panopticapi.git
Expand Down
11 changes: 11 additions & 0 deletions tools/setup_detectron2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sys, os, distutils.core, subprocess

if not os.path.exists('./detectron2'):
subprocess.run(['git', 'clone', 'https://github.com/facebookresearch/detectron2'])

dist = distutils.core.run_setup("./detectron2/setup.py")

for x in dist.install_requires:
subprocess.run(['python', '-m', 'pip', 'install', x])

sys.path.insert(0, os.path.abspath('./detectron2'))

0 comments on commit 56799ef

Please sign in to comment.