Spaces:
Build error
Build error
Satyajithchary
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,42 @@ import cv2
|
|
3 |
import numpy as np
|
4 |
from PIL import Image
|
5 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
from detectron2.engine import DefaultPredictor
|
7 |
from detectron2.config import get_cfg
|
8 |
from detectron2.projects.deeplab import add_deeplab_config
|
|
|
3 |
import numpy as np
|
4 |
from PIL import Image
|
5 |
import torch
|
6 |
+
|
7 |
+
|
8 |
+
!git clone --recursive https://github.com/frank-xwang/UnSAM.git
|
9 |
+
!python -m pip install 'git+https://github.com/MaureenZOU/detectron2-xyz.git'
|
10 |
+
%cd UnSAM
|
11 |
+
!python -m pip install -r requirements.txt
|
12 |
+
|
13 |
+
# uncomment the following lines if you want to run with GPU
|
14 |
+
%cd whole_image_segmentation/mask2former/modeling/pixel_decoder/ops
|
15 |
+
!sh make.sh
|
16 |
+
# clone and install Mask2Former
|
17 |
+
!git clone https://github.com/facebookresearch/Mask2Former.git
|
18 |
+
%cd Mask2Former
|
19 |
+
!pip install -U opencv-python
|
20 |
+
!pip install git+https://github.com/cocodataset/panopticapi.git
|
21 |
+
!pip install -r requirements.txt
|
22 |
+
%cd mask2former/modeling/pixel_decoder/ops
|
23 |
+
!python setup.py build install
|
24 |
+
%cd ../../../../
|
25 |
+
%cd /kaggle/working/Mask2Former
|
26 |
+
#%cd /kaggle/working/UnSAM/whole_image_segmentation/mask2former/modeling/pixel_decoder/ops/Mask2Former
|
27 |
+
|
28 |
+
#%cd /kaggle/working/UnSAM/whole_image_segmentation/mask2former
|
29 |
+
import detectron2
|
30 |
+
from detectron2.utils.logger import setup_logger
|
31 |
+
setup_logger()
|
32 |
+
setup_logger(name="mask2former")
|
33 |
+
|
34 |
+
# import some common libraries
|
35 |
+
import numpy as np
|
36 |
+
import cv2
|
37 |
+
import torch
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
from detectron2.engine import DefaultPredictor
|
43 |
from detectron2.config import get_cfg
|
44 |
from detectron2.projects.deeplab import add_deeplab_config
|