Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ os.system('pip install pyyaml==5.1')
|
|
| 16 |
import detectron2
|
| 17 |
|
| 18 |
from detectron2.utils.logger import setup_logger # ????
|
| 19 |
-
from google.colab.patches import cv2_imshow
|
| 20 |
|
| 21 |
from detectron2 import model_zoo
|
| 22 |
from detectron2.engine import DefaultPredictor
|
|
@@ -34,6 +34,7 @@ cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rc
|
|
| 34 |
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 # set threshold for this model
|
| 35 |
# Find a model from detectron2's model zoo. You can use the https://dl.fbaipublicfiles... url as well
|
| 36 |
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
|
|
|
|
| 37 |
predictor = DefaultPredictor(cfg)
|
| 38 |
'''
|
| 39 |
os.system(wget http://images.cocodataset.org/val2017/000000439715.jpg -q -O input.jpg)
|
|
|
|
| 16 |
import detectron2
|
| 17 |
|
| 18 |
from detectron2.utils.logger import setup_logger # ????
|
| 19 |
+
# from google.colab.patches import cv2_imshow
|
| 20 |
|
| 21 |
from detectron2 import model_zoo
|
| 22 |
from detectron2.engine import DefaultPredictor
|
|
|
|
| 34 |
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 # set threshold for this model
|
| 35 |
# Find a model from detectron2's model zoo. You can use the https://dl.fbaipublicfiles... url as well
|
| 36 |
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
|
| 37 |
+
cfg.MODEL.DEVICE= 'cpu'
|
| 38 |
predictor = DefaultPredictor(cfg)
|
| 39 |
'''
|
| 40 |
os.system(wget http://images.cocodataset.org/val2017/000000439715.jpg -q -O input.jpg)
|