Liangyu commited on
Commit
ada7a74
β€’
1 Parent(s): 8c0e599

πŸ”– 0.2.0 init release on space

Browse files
Files changed (3) hide show
  1. app.py +0 -10
  2. style.css +2 -2
  3. utils.py +0 -4
app.py CHANGED
@@ -11,32 +11,22 @@ if os.getenv('SYSTEM') == 'spaces':
11
  mim.uninstall('mmcv-full', confirm_yes=True)
12
  mim.install('mmcv-full==1.4.3', is_yes=True)
13
 
14
- # subprocess.call('pip install --user --upgrade setuptools'.split())
15
  subprocess.call('pip uninstall -y opencv-python'.split())
16
  subprocess.call('pip uninstall -y opencv-python-headless'.split())
17
  subprocess.call('pip install opencv-python-headless==4.5.5.64'.split())
18
  subprocess.call('pip install pycocotools'.split())
19
  subprocess.call("pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.9/index.html".split())
20
- # subprocess.call("git clone https://github.com/c-liangyu/OpenPSG.git".split())
21
  subprocess.call("pip install git+https://github.com/c-liangyu/OpenPSG.git@dev_apis".split())
22
  subprocess.call("pip install git+https://github.com/cocodataset/panopticapi.git".split())
23
- # subprocess.call("git checkout dev_apis".split())
24
- # subprocess.call("pip install -v -e OpenPSG".split())
25
 
26
- # pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.9/index.html
27
- # detectron2==0.6 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html
28
  import cv2
29
  import gradio as gr
30
  import numpy as np
31
 
32
  from mmdet.apis import init_detector, inference_detector
33
- print('70\% \imported')
34
  from utils import show_result
35
- print('80\% \imported')
36
  from mmcv import Config
37
- print('90\% \imported')
38
  import openpsg
39
- print('100\% \imported')
40
 
41
 
42
  DESCRIPTION = '''# OpenPSG
 
11
  mim.uninstall('mmcv-full', confirm_yes=True)
12
  mim.install('mmcv-full==1.4.3', is_yes=True)
13
 
 
14
  subprocess.call('pip uninstall -y opencv-python'.split())
15
  subprocess.call('pip uninstall -y opencv-python-headless'.split())
16
  subprocess.call('pip install opencv-python-headless==4.5.5.64'.split())
17
  subprocess.call('pip install pycocotools'.split())
18
  subprocess.call("pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.9/index.html".split())
 
19
  subprocess.call("pip install git+https://github.com/c-liangyu/OpenPSG.git@dev_apis".split())
20
  subprocess.call("pip install git+https://github.com/cocodataset/panopticapi.git".split())
 
 
21
 
 
 
22
  import cv2
23
  import gradio as gr
24
  import numpy as np
25
 
26
  from mmdet.apis import init_detector, inference_detector
 
27
  from utils import show_result
 
28
  from mmcv import Config
 
29
  import openpsg
 
30
 
31
 
32
  DESCRIPTION = '''# OpenPSG
style.css CHANGED
@@ -12,13 +12,13 @@ h1 {
12
  clear: both;
13
  }
14
  #input-image {
15
- max-height: 800px;
16
  }
17
  #label-image {
18
  height: 300px;
19
  }
20
  #result-image {
21
- height: 800px;
22
  }
23
  img#visitor-badge {
24
  display: block;
 
12
  clear: both;
13
  }
14
  #input-image {
15
+ max-height: 300px;
16
  }
17
  #label-image {
18
  height: 300px;
19
  }
20
  #result-image {
21
+ height: 300px;
22
  }
23
  img#visitor-badge {
24
  display: block;
utils.py CHANGED
@@ -2,13 +2,9 @@ from typing import Tuple
2
  import PIL
3
  import mmcv
4
  import numpy as np
5
- print('50\% \imported utils')
6
  from detectron2.utils.colormap import colormap
7
- print('60\% \imported utils')
8
  from detectron2.utils.visualizer import VisImage, Visualizer
9
- print('80\% \imported utils')
10
  from mmdet.datasets.coco_panoptic import INSTANCE_OFFSET
11
- print('100\% \imported utils')
12
 
13
 
14
  CLASSES = [
 
2
  import PIL
3
  import mmcv
4
  import numpy as np
 
5
  from detectron2.utils.colormap import colormap
 
6
  from detectron2.utils.visualizer import VisImage, Visualizer
 
7
  from mmdet.datasets.coco_panoptic import INSTANCE_OFFSET
 
8
 
9
 
10
  CLASSES = [