Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ from detectron2.utils.logger import setup_logger # ????
|
|
| 19 |
from detectron2 import model_zoo
|
| 20 |
from detectron2.engine import DefaultPredictor
|
| 21 |
from detectron2.config import get_cfg
|
| 22 |
-
|
| 23 |
# ????
|
| 24 |
setup_logger()
|
| 25 |
|
|
@@ -31,7 +31,7 @@ cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 # set threshold for this model
|
|
| 31 |
# Find a model from detectron2's model zoo. You can use the https://dl.fbaipublicfiles... url as well
|
| 32 |
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
|
| 33 |
predictor = DefaultPredictor(cfg)
|
| 34 |
-
|
| 35 |
os.system(wget http://images.cocodataset.org/val2017/000000439715.jpg -q -O input.jpg)
|
| 36 |
im = cv2.imread("./input.jpg")
|
| 37 |
cv2_imshow(im)
|
|
|
|
| 19 |
from detectron2 import model_zoo
|
| 20 |
from detectron2.engine import DefaultPredictor
|
| 21 |
from detectron2.config import get_cfg
|
| 22 |
+
'''
|
| 23 |
# ????
|
| 24 |
setup_logger()
|
| 25 |
|
|
|
|
| 31 |
# Find a model from detectron2's model zoo. You can use the https://dl.fbaipublicfiles... url as well
|
| 32 |
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
|
| 33 |
predictor = DefaultPredictor(cfg)
|
| 34 |
+
|
| 35 |
os.system(wget http://images.cocodataset.org/val2017/000000439715.jpg -q -O input.jpg)
|
| 36 |
im = cv2.imread("./input.jpg")
|
| 37 |
cv2_imshow(im)
|