pierreguillou commited on
Commit
429935b
1 Parent(s): e39bab0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -1,8 +1,9 @@
1
- try:
2
- import detectron2
3
- except:
4
- import os
5
- os.system('pip install git+https://github.com/facebookresearch/detectron2.git')
 
6
 
7
  import os
8
  import gradio as gr
 
1
+ # workaround: install old version of pytorch since detectron2 hasn't released packages for pytorch 1.9 (issue: https://github.com/facebookresearch/detectron2/issues/3158)
2
+ os.system('pip install torch==1.8.0+cu101 torchvision==0.9.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html')
3
+
4
+ # install detectron2 that matches pytorch 1.8
5
+ # See https://detectron2.readthedocs.io/tutorials/install.html for instructions
6
+ os.system('pip install -q detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html')
7
 
8
  import os
9
  import gradio as gr