henry000 commited on
Commit
0ff0fd0
·
1 Parent(s): 648dce4

♻️ [Refactor] create_model function

Browse files
Files changed (1) hide show
  1. yolo/model/yolo.py +2 -1
yolo/model/yolo.py CHANGED
@@ -163,8 +163,9 @@ def create_model(model_cfg: ModelConfig, weight_path: Union[bool, Path] = True,
163
  if weight_path:
164
  if weight_path == True:
165
  weight_path = Path("weights") / f"{model_cfg.name}.pt"
166
- if isinstance(weight_path, str):
167
  weight_path = Path(weight_path)
 
168
  if not weight_path.exists():
169
  logger.info(f"🌐 Weight {weight_path} not found, try downloading")
170
  prepare_weight(weight_path=weight_path)
 
163
  if weight_path:
164
  if weight_path == True:
165
  weight_path = Path("weights") / f"{model_cfg.name}.pt"
166
+ elif isinstance(weight_path, str):
167
  weight_path = Path(weight_path)
168
+
169
  if not weight_path.exists():
170
  logger.info(f"🌐 Weight {weight_path} not found, try downloading")
171
  prepare_weight(weight_path=weight_path)