Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -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)
|
|
@@ -40,7 +40,7 @@ outputs = predictor(im)
|
|
| 40 |
|
| 41 |
print(outputs["instances"].pred_classes)
|
| 42 |
print(outputs["instances"].pred_boxes)
|
| 43 |
-
|
| 44 |
# -- load Mask R-CNN model for segmentation
|
| 45 |
DesignModernityModel = torch.load("DesignModernityModel.pt")
|
| 46 |
|
|
|
|
| 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)
|
|
|
|
| 40 |
|
| 41 |
print(outputs["instances"].pred_classes)
|
| 42 |
print(outputs["instances"].pred_boxes)
|
| 43 |
+
'''
|
| 44 |
# -- load Mask R-CNN model for segmentation
|
| 45 |
DesignModernityModel = torch.load("DesignModernityModel.pt")
|
| 46 |
|