seifbenayed commited on
Commit
e2914ad
·
verified ·
1 Parent(s): 18a5afe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -1,5 +1,17 @@
1
  #!/usr/bin/env python3
 
 
 
 
 
 
 
 
 
 
 
2
  # -*- coding: utf-8 -*-
 
3
  import os
4
  import sys
5
  import time
 
1
  #!/usr/bin/env python3
2
+ import importlib.util
3
+ import os
4
+ import sys
5
+
6
+ # Check if detectron2 is installed
7
+ if importlib.util.find_spec("detectron2") is None:
8
+ print("Installing PyTorch and Detectron2...")
9
+ os.system("pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu")
10
+ os.system("pip install git+https://github.com/facebookresearch/detectron2.git")
11
+ print("Installation complete!")
12
+
13
  # -*- coding: utf-8 -*-
14
+
15
  import os
16
  import sys
17
  import time