Spaces:
Runtime error
Runtime error
prathmeshrmadhu
commited on
Commit
·
3737d3c
1
Parent(s):
41f275b
hardcoding paths in the yaml file
Browse files- model.py +7 -5
- model_dict/detection.yaml +2 -2
model.py
CHANGED
@@ -23,7 +23,8 @@ def _update_config_path(model_dict: dict[str, dict[str, str]]) -> None:
|
|
23 |
# dic['config'] = dic['config'].replace(
|
24 |
# 'https://github.com/open-mmlab/mmdetection/tree/master',
|
25 |
# 'mmdet_configs')
|
26 |
-
dic['config'] = "mmdet_configs/odor-fasterrcnn.py"
|
|
|
27 |
|
28 |
|
29 |
def _update_model_dict_if_hf_token_is_given(
|
@@ -33,13 +34,14 @@ def _update_model_dict_if_hf_token_is_given(
|
|
33 |
return
|
34 |
|
35 |
for dic in model_dict.values():
|
36 |
-
ckpt_path = dic['model']
|
37 |
-
name = ckpt_path.split('/')[-1]
|
38 |
# ckpt_path = huggingface_hub.hf_hub_download('hysts/mmdetection',
|
39 |
# f'models/{name}',
|
40 |
# # use_auth_token=token)
|
41 |
-
ckpt_path = "pretrained_models/fasterrcnn-odor-ep100.pth"
|
42 |
-
dic['model'] = ckpt_path
|
|
|
43 |
|
44 |
|
45 |
class Model:
|
|
|
23 |
# dic['config'] = dic['config'].replace(
|
24 |
# 'https://github.com/open-mmlab/mmdetection/tree/master',
|
25 |
# 'mmdet_configs')
|
26 |
+
# dic['config'] = "mmdet_configs/odor-fasterrcnn.py"
|
27 |
+
return dic['config']
|
28 |
|
29 |
|
30 |
def _update_model_dict_if_hf_token_is_given(
|
|
|
34 |
return
|
35 |
|
36 |
for dic in model_dict.values():
|
37 |
+
# ckpt_path = dic['model']
|
38 |
+
# name = ckpt_path.split('/')[-1]
|
39 |
# ckpt_path = huggingface_hub.hf_hub_download('hysts/mmdetection',
|
40 |
# f'models/{name}',
|
41 |
# # use_auth_token=token)
|
42 |
+
# ckpt_path = "pretrained_models/fasterrcnn-odor-ep100.pth"
|
43 |
+
# dic['model'] = ckpt_path
|
44 |
+
return dic['model']
|
45 |
|
46 |
|
47 |
class Model:
|
model_dict/detection.yaml
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
Faster R-CNN (R-50-FPN):
|
2 |
-
config:
|
3 |
-
model:
|
|
|
1 |
Faster R-CNN (R-50-FPN):
|
2 |
+
config: "./mmdet_configs/odor-fasterrcnn.py"
|
3 |
+
model: "./pretrained_models/fasterrcnn-odor-ep100.pth"
|