Spaces:
Runtime error
Runtime error
xichen98cn
commited on
Commit
•
8a8cb2c
1
Parent(s):
a520433
app.py
CHANGED
@@ -3,7 +3,10 @@ import sys
|
|
3 |
|
4 |
os.system("pip install imutils")
|
5 |
os.system("python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'")
|
6 |
-
os.system("python
|
|
|
|
|
|
|
7 |
import gradio as gr
|
8 |
from detectron2.utils.logger import setup_logger
|
9 |
from contextlib import ExitStack
|
|
|
3 |
|
4 |
os.system("pip install imutils")
|
5 |
os.system("python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'")
|
6 |
+
os.system("python frozenseg/modeling/pixel_decoder/ops/setup.py build install")
|
7 |
+
os.system("pip install gdown")
|
8 |
+
os.system("pip install gradio_client==0.2.7")
|
9 |
+
os.system("pip install git+https://github.com/cocodataset/panopticapi.git")
|
10 |
import gradio as gr
|
11 |
from detectron2.utils.logger import setup_logger
|
12 |
from contextlib import ExitStack
|
frozenseg/modeling/pixel_decoder/ops/functions/ms_deform_attn_func.py
CHANGED
@@ -23,12 +23,12 @@ try:
|
|
23 |
except ModuleNotFoundError as e:
|
24 |
info_string = (
|
25 |
"\n\nPlease compile MultiScaleDeformableAttention CUDA op with the following commands:\n"
|
26 |
-
"\t`cd
|
27 |
"\t`sh make.sh`\n"
|
28 |
)
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
class MSDeformAttnFunction(Function):
|
33 |
@staticmethod
|
34 |
def forward(ctx, value, value_spatial_shapes, value_level_start_index, sampling_locations, attention_weights, im2col_step):
|
|
|
23 |
except ModuleNotFoundError as e:
|
24 |
info_string = (
|
25 |
"\n\nPlease compile MultiScaleDeformableAttention CUDA op with the following commands:\n"
|
26 |
+
"\t`cd mask2former/modeling/pixel_decoder/ops`\n"
|
27 |
"\t`sh make.sh`\n"
|
28 |
)
|
29 |
+
print(info_string)
|
30 |
+
#raise ModuleNotFoundError(info_string)
|
31 |
+
|
32 |
class MSDeformAttnFunction(Function):
|
33 |
@staticmethod
|
34 |
def forward(ctx, value, value_spatial_shapes, value_level_start_index, sampling_locations, attention_weights, im2col_step):
|
frozenseg/modeling/pixel_decoder/ops/modules/ms_deform_attn.py
CHANGED
@@ -21,7 +21,10 @@ from torch import nn
|
|
21 |
import torch.nn.functional as F
|
22 |
from torch.nn.init import xavier_uniform_, constant_
|
23 |
|
24 |
-
|
|
|
|
|
|
|
25 |
from ..functions.ms_deform_attn_func import ms_deform_attn_core_pytorch
|
26 |
|
27 |
|
|
|
21 |
import torch.nn.functional as F
|
22 |
from torch.nn.init import xavier_uniform_, constant_
|
23 |
|
24 |
+
try:
|
25 |
+
from ..functions import MSDeformAttnFunction
|
26 |
+
except:
|
27 |
+
pass
|
28 |
from ..functions.ms_deform_attn_func import ms_deform_attn_core_pytorch
|
29 |
|
30 |
|