prathmeshrmadhu commited on
Commit
3737d3c
·
1 Parent(s): 41f275b

hardcoding paths in the yaml file

Browse files
Files changed (2) hide show
  1. model.py +7 -5
  2. 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: https://github.com/open-mmlab/mmdetection/tree/master/configs/faster_rcnn/faster_rcnn_r50_fpn_2x_coco.py
3
- model: https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_2x_coco/faster_rcnn_r50_fpn_2x_coco_bbox_mAP-0.384_20200504_210434-a5d8aa15.pth
 
1
  Faster R-CNN (R-50-FPN):
2
+ config: "./mmdet_configs/odor-fasterrcnn.py"
3
+ model: "./pretrained_models/fasterrcnn-odor-ep100.pth"