Spaces:
Runtime error
Runtime error
replace demo
Browse files- app.py +8 -3
- demo/coco.jpg +0 -0
- demo/ctx.jpg +0 -0
- demo/voc.jpg +0 -0
app.py
CHANGED
@@ -23,6 +23,11 @@ from segmentation.evaluation import (GROUP_PALETTE, build_seg_demo_pipeline,
|
|
23 |
build_seg_inference)
|
24 |
from utils import get_config, load_checkpoint
|
25 |
|
|
|
|
|
|
|
|
|
|
|
26 |
os.chdir('GroupViT')
|
27 |
# checkpoint_url = 'https://github.com/xvjiarui/GroupViT-1/releases/download/v1.0.0/group_vit_gcc_yfcc_30e-74d335e6.pth'
|
28 |
checkpoint_url = 'https://github.com/xvjiarui/GroupViT/releases/download/v1.0.0/group_vit_gcc_yfcc_30e-879422e0.pth'
|
@@ -33,9 +38,9 @@ device = 'cpu'
|
|
33 |
vis_modes = ['input_pred_label', 'final_group']
|
34 |
output_labels = ['segmentation map', 'groups']
|
35 |
dataset_options = ['Pascal VOC', 'Pascal Context', 'COCO']
|
36 |
-
examples = [['Pascal VOC', '', '
|
37 |
-
['Pascal Context', '', '
|
38 |
-
['COCO', '', '
|
39 |
|
40 |
PSEUDO_ARGS = namedtuple('PSEUDO_ARGS',
|
41 |
['cfg', 'opts', 'resume', 'vis', 'local_rank'])
|
|
|
23 |
build_seg_inference)
|
24 |
from utils import get_config, load_checkpoint
|
25 |
|
26 |
+
import shutil
|
27 |
+
|
28 |
+
if not osp.exists('GroupViT/hg_demo'):
|
29 |
+
shutil.copytree('demo/', 'GroupViT/hg_demo/')
|
30 |
+
|
31 |
os.chdir('GroupViT')
|
32 |
# checkpoint_url = 'https://github.com/xvjiarui/GroupViT-1/releases/download/v1.0.0/group_vit_gcc_yfcc_30e-74d335e6.pth'
|
33 |
checkpoint_url = 'https://github.com/xvjiarui/GroupViT/releases/download/v1.0.0/group_vit_gcc_yfcc_30e-879422e0.pth'
|
|
|
38 |
vis_modes = ['input_pred_label', 'final_group']
|
39 |
output_labels = ['segmentation map', 'groups']
|
40 |
dataset_options = ['Pascal VOC', 'Pascal Context', 'COCO']
|
41 |
+
examples = [['Pascal VOC', '', 'hg_demo/voc.jpg'],
|
42 |
+
['Pascal Context', '', 'hg_demo/ctx.jpg'],
|
43 |
+
['COCO', '', 'hg_demo/coco.jpg']]
|
44 |
|
45 |
PSEUDO_ARGS = namedtuple('PSEUDO_ARGS',
|
46 |
['cfg', 'opts', 'resume', 'vis', 'local_rank'])
|
demo/coco.jpg
ADDED
demo/ctx.jpg
ADDED
demo/voc.jpg
ADDED