Skip to content

Commit

Permalink
add unittest for regression model inference
Browse files Browse the repository at this point in the history
  • Loading branch information
ly015 committed May 25, 2022
1 parent addcd09 commit 25e1ff0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_apis/test_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,29 @@ def test_top_down_demo():
vis_pose_result(
pose_model, image_name, pose_results, dataset_info=dataset_info)

# MPII demo
# build the pose model from a config file and a checkpoint file
pose_model = init_pose_model(
'configs/body/2d_kpt_sview_rgb_img/deeppose/'
'mpii/res50_mpii_256x256.py',
None,
device='cpu')
image_name = 'tests/data/mpii/004645041.jpg'
dataset_info = DatasetInfo(pose_model.cfg.data['test'].get(
'dataset_info', None))
person_result = []
person_result.append({'bbox': [50, 50, 50, 100]})
# test a single image, with a list of bboxes.
pose_results, _ = inference_top_down_pose_model(
pose_model,
image_name,
person_result,
format='xywh',
dataset_info=dataset_info)
# show the results
vis_pose_result(
pose_model, image_name, pose_results, dataset_info=dataset_info)

# AIC demo
pose_model = init_pose_model(
'configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/'
Expand Down

0 comments on commit 25e1ff0

Please sign in to comment.