Skip to content

Commit

Permalink
Merge 7d3107f into 71d74de
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Louis authored Mar 25, 2023
2 parents 71d74de + 7d3107f commit 5e9796d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mmpose/apis/inferencers/pose2d_inferencer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os
import warnings
from typing import Dict, List, Optional, Sequence, Tuple, Union

Expand Down Expand Up @@ -91,17 +92,21 @@ def __init__(self,

# initialize detector for top-down models
if self.cfg.data_mode == 'topdown':
det_scope = 'mmdet'
if det_model is None:
det_model = DATASETS.get(
self.cfg.dataset_type).__module__.split(
'datasets.')[-1].split('.')[0].lower()
det_info = default_det_models[det_model]
det_model, det_weights, det_cat_ids = det_info[
'model'], det_info['weights'], det_info['cat_ids']
elif os.path.exists(det_model):
det_cfg = Config.fromfile(det_model)
det_scope = det_cfg.default_scope

if has_mmdet:
self.detector = DetInferencer(
det_model, det_weights, device=device)
det_model, det_weights, device=device, scope=det_scope)
else:
raise RuntimeError(
'MMDetection (v3.0.0rc6 or above) is required to '
Expand Down

0 comments on commit 5e9796d

Please sign in to comment.