Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ from detectron2.utils.visualizer import Visualizer
|
|
22 |
from detectron2.data import MetadataCatalog
|
23 |
|
24 |
|
25 |
-
model_path = "https://huggingface.co/
|
26 |
|
27 |
cfg = get_cfg()
|
28 |
cfg.merge_from_file("./faster_rcnn_X_101_32x8d_FPN_3x.yaml")
|
@@ -30,8 +30,11 @@ cfg.MODEL.ROI_HEADS.NUM_CLASSES = 2
|
|
30 |
cfg.MODEL.WEIGHTS = model_path
|
31 |
|
32 |
my_metadata = MetadataCatalog.get("dbmdz_coco_all")
|
33 |
-
my_metadata.thing_classes = ["
|
34 |
-
|
|
|
|
|
|
|
35 |
if not torch.cuda.is_available():
|
36 |
cfg.MODEL.DEVICE = "cpu"
|
37 |
|
|
|
22 |
from detectron2.data import MetadataCatalog
|
23 |
|
24 |
|
25 |
+
model_path = "https://huggingface.co/asalhi85/Smartathon-Detectron2/resolve/9f4d573340b033e651d4937906f23850f9b6bc57/phase2_detectron_model.pth"
|
26 |
|
27 |
cfg = get_cfg()
|
28 |
cfg.merge_from_file("./faster_rcnn_X_101_32x8d_FPN_3x.yaml")
|
|
|
30 |
cfg.MODEL.WEIGHTS = model_path
|
31 |
|
32 |
my_metadata = MetadataCatalog.get("dbmdz_coco_all")
|
33 |
+
my_metadata.thing_classes = ["GRAFFITI", "FADED_SIGNAGE","POTHOLES","GARBAGE","CONSTRUCTION_ROAD","BROKEN_SIGNAGE","BAD_STREETLIGHT","BAD_BILLBOARD","SAND_ON_ROAD","CLUTTER_SIDEWALK","UNKEPT_FACADE"]
|
34 |
+
# #smart_dict={'GRAFFITI' : 0.0 , 'FADED_SIGNAGE': 1.0 , 'POTHOLES': 2.0,
|
35 |
+
# 'GARBAGE' : 3.0 , 'CONSTRUCTION_ROAD': 4.0 , 'BROKEN_SIGNAGE': 5.0,
|
36 |
+
# 'BAD_STREETLIGHT' : 6.0 , 'BAD_BILLBOARD': 7.0 , 'SAND_ON_ROAD':8.0,
|
37 |
+
# 'CLUTTER_SIDEWALK' : 9.0 , 'UNKEPT_FACADE': 10.0}
|
38 |
if not torch.cuda.is_available():
|
39 |
cfg.MODEL.DEVICE = "cpu"
|
40 |
|