Spaces:
Runtime error
Runtime error
Update backend.py
Browse files- backend.py +2 -2
backend.py
CHANGED
@@ -83,11 +83,11 @@ def building_model(building_version_dropdown, building_pth_dropdown, building_th
|
|
83 |
return building_predictor
|
84 |
|
85 |
# Model for LCZs
|
86 |
-
def
|
87 |
lcz_cfg = get_cfg()
|
88 |
lcz_cfg.merge_from_file(get_version_cfg_yml("lcz_model_weights/lczs_cfg.yaml"))
|
89 |
lcz_cfg.MODEL.DEVICE=device
|
90 |
-
lcz_cfg.MODEL.WEIGHTS = f"tree_model_weights/{
|
91 |
lcz_cfg.MODEL.ROI_HEADS.NUM_CLASSES = 14 # TODO change this
|
92 |
lcz_cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = lcz_threshold
|
93 |
lcz_predictor = DefaultPredictor(lcz_cfg)
|
|
|
83 |
return building_predictor
|
84 |
|
85 |
# Model for LCZs
|
86 |
+
def lcz_model(lcz_version_dropdown, lcz_pth_dropdown, lcz_threshold, device="cpu"):
|
87 |
lcz_cfg = get_cfg()
|
88 |
lcz_cfg.merge_from_file(get_version_cfg_yml("lcz_model_weights/lczs_cfg.yaml"))
|
89 |
lcz_cfg.MODEL.DEVICE=device
|
90 |
+
lcz_cfg.MODEL.WEIGHTS = f"tree_model_weights/{lcz_pth_dropdown}"
|
91 |
lcz_cfg.MODEL.ROI_HEADS.NUM_CLASSES = 14 # TODO change this
|
92 |
lcz_cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = lcz_threshold
|
93 |
lcz_predictor = DefaultPredictor(lcz_cfg)
|