Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhance] Move bbox conversion (xywh2cs) from datasets to pipeline #1311

Merged
merged 28 commits into from
May 2, 2022

Conversation

ly015
Copy link
Member

@ly015 ly015 commented Apr 12, 2022

Motivation

Currently, the bbox conversion is done in datasets, which may have the following drawbacks:

  • Random bbox shift is applied only once during annotation loading, instead of every time one sample is prepared.
  • Data sample contains both bbox and center+scale, which may be confusing.

Modification

  • Remove xywh2cs operation from top-down datasets. Data samples obtained from the dataset no longer have center and scale fields, but only bbox
  • Add data transform TopDownGetBboxCenterScale to convert bbox to center and scale. Optionally, apply padding and random shift to the bbox (Same function as original xywh2cs).
  • Remove TopDownRandomTranslation data transform which has redundant functions and is rarely used.
  • Update configs
  • Add `.dev_scripts/develop/create_ceph_configs.py' to convert configs with ceph runtime settings.

BC-breaking (Optional)

Use cases (Optional)

Usage of TopDownGetBboxCenterScale:

pipeline = [
    dict(type='LoadImageFromFile'),
    dict(
        type='TopDownGetBboxCenterScale',
        padding=1.25,  # The bbox scale will be expanded to 1.25 times
        shift_prob=0.3,  # Probability of applying a random shift is 0.3
        shift_factor=0.2,  # The shift range is ±0.2*[w, h] in x-axis and y-axis.
]

Usage of create_ceph_config.py

Run the following command to create a copy of configs at configs_ceph with the ceph data backend properly set.

# python .dev_scripts/develop/create_ceph_configs.py <USER_BUCKET> [--work-dir-prefix <WORK_DIR_PREFIX>]
python .dev_scripts/develop/create_ceph_configs.py liyining --work-dir-prefix work_dirs

Model Verification

Criterions

  • Testing verification: All metrics align with the model zoo report
  • Training verification: Relative difference <0.2%

Progress

Dataset Model Page Models to Verify Testing Verified Training Verified Notes
Top-down COCO hrnet_coco
hrnet_dark_coco
hrnet_udp_coco
All models in model pages done done Update hrnet_w32_coco_256x192 and hrnet_w32_coco_384x288 checkpoints
Top-down MPII hrnet_mpii
hrnet_dark_mpii
hrnet_udp_mpii deeppose_resnet_mpii
1. All models in model pages
2. new configs: *_bboxshift.py in configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/mpii
New configs only need training verification
Face WLFW deeppose_resnet_wlfw
hrnetv2_wflw
hrnetv2_dark_wflw
hrnetv2_awing_wflw
1. All models in model pages
2. new configs: *_bboxshift.py in configs/face/2d_kpt_sview_rgb_img/deeppose/wflw
3. new configs: *_bboxshift.py in configs/face/2d_kpt_sview_rgb_img/topdown_heatmap/wflw
New configs only need training verification
Hand Interhand3D interhand3d All models in model pages Only check results on test set (the first row in the table in the model page)
Topdown AIC hrnet_aic The first model in the model page - Only verify testing
Topdown COCO-Wholebody hrnet_coco_wholebody The first model in the model page - Only verify testing
Topdown CrowdPose hrnet_crowdpose The first model in the model page - Only verify testing
Topdown Halpe hrnet_halpe The first model in the model page - Only verify testing
Topdown JHMDB resnet_jhmdb The first model in the model page - Only verify testing
Topdown PoseTrack posewarper_hrnet_posetrack18 Stage-2 model - Only verify testing accuracy with ground-truth bounding boxes (1st table)
Hand Freihand resnet_freihand The first model in the model page - Only verify testing
Hand Onehand10k mobilenetv2_onehand10k The first model in the model page - Only verify testing
Animal Animalpose hrnet_animalpose The first model in the model page - Only verify testing
Animal AP10k hrnet_ap10k The first model in the model page - Only verify testing

All Related Datasets

Type Dataset Update config Verify testing Verify training
Top-down coco
Top-down aic
Top-down coco_wholebody
Top-down crowdpose
Top-down h36m
Top-down halpe
Top-down jhmdb
Top-down mpii ⭕
Top-down mpii_trb
Top-down ochuman
Top-down posetrack18
Top-down posetrack18_video
Face 300w
Face aflw
Face face_coco_wholebody
Face cofw
Face wlfw ⭕
Hand freihand
Hand hand_coco_wholebody
Hand interhand2d
Hand interhand3d ⭕
Hand onehand10k
Hand panoptic_hand2d
Hand rhd2d
Animal ap10k
Animal atrw
Animal fly
Animal horse10
Animal locust
Animal macaque
Animal animal_pose
Animal zebra
Fashion deepfashion

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit tests to ensure correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • CLA has been signed and all committers have signed the CLA in this PR.

@ly015 ly015 changed the base branch from master to dev-0.26 April 12, 2022 21:33
@codecov
Copy link

codecov bot commented Apr 24, 2022

Codecov Report

Merging #1311 (a902edf) into dev-0.26 (52fd3f3) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##           dev-0.26    #1311      +/-   ##
============================================
- Coverage     84.10%   84.09%   -0.01%     
============================================
  Files           215      217       +2     
  Lines         17674    17701      +27     
  Branches       3139     3145       +6     
============================================
+ Hits          14865    14886      +21     
- Misses         2018     2021       +3     
- Partials        791      794       +3     
Flag Coverage Δ
unittests 84.09% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmpose/utils/setup_env.py 72.72% <0.00%> (-27.28%) ⬇️
mmpose/datasets/builder.py 69.73% <0.00%> (-9.22%) ⬇️
...sets/base/kpt_2d_sview_rgb_vid_top_down_dataset.py 89.88% <0.00%> (-4.68%) ⬇️
mmpose/datasets/pipelines/shared_transform.py 77.19% <0.00%> (-4.39%) ⬇️
...sets/base/kpt_2d_sview_rgb_img_top_down_dataset.py 92.14% <0.00%> (-3.51%) ⬇️
...sets/base/kpt_3d_sview_rgb_img_top_down_dataset.py 82.88% <0.00%> (-3.36%) ⬇️
...datasets/datasets/top_down/topdown_mpii_dataset.py 39.66% <0.00%> (-0.50%) ⬇️
...sets/top_down/topdown_posetrack18_video_dataset.py 85.55% <0.00%> (-0.47%) ⬇️
...asets/datasets/hand/hand_coco_wholebody_dataset.py 88.40% <0.00%> (-0.17%) ⬇️
...e/datasets/datasets/fashion/deepfashion_dataset.py 87.17% <0.00%> (-0.17%) ⬇️
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52fd3f3...a902edf. Read the comment docs.

@ly015 ly015 requested a review from jin-s13 April 28, 2022 16:42
@ly015 ly015 merged commit ef35a39 into open-mmlab:dev-0.26 May 2, 2022
ly015 added a commit that referenced this pull request May 5, 2022
…1311)

* add TopDownGetBboxCenterScale transform

* update topdown coco

* update topdown aic

* update coco deeppose and coco-wholebody

* update topdown crowdpose

* update halpe/jhmdb/h36m

* update mhp/ochuman/posetrack18

* update mhp/ochuman/posetrack18

* update all datasets

* add unittest

* remove irrelevant files

* refactor inference apis

* separate xywh2cs and random shift

* update configs

* update mpii configs

* add create_ceph_configs

* fix typo

* minor fix

* fix unittest

* fix coco-wholebody-dataset

* fix typos in configs

* fix posetrack18 configs

* fix posetrack18 configs

* delete config with bboxshift

* modify accuracy records of Halpe

* update accuracy of AP10k

* update colab tutorial and unittest

* rename _do_keypoint_eval->_do_python_keypoint_eval

Co-authored-by: lupeng <penglu2097@gmail.com>
@ly015 ly015 mentioned this pull request May 17, 2022
6 tasks
shuheilocale pushed a commit to shuheilocale/mmpose that referenced this pull request May 6, 2023
…pen-mmlab#1311)

* add TopDownGetBboxCenterScale transform

* update topdown coco

* update topdown aic

* update coco deeppose and coco-wholebody

* update topdown crowdpose

* update halpe/jhmdb/h36m

* update mhp/ochuman/posetrack18

* update mhp/ochuman/posetrack18

* update all datasets

* add unittest

* remove irrelevant files

* refactor inference apis

* separate xywh2cs and random shift

* update configs

* update mpii configs

* add create_ceph_configs

* fix typo

* minor fix

* fix unittest

* fix coco-wholebody-dataset

* fix typos in configs

* fix posetrack18 configs

* fix posetrack18 configs

* delete config with bboxshift

* modify accuracy records of Halpe

* update accuracy of AP10k

* update colab tutorial and unittest

* rename _do_keypoint_eval->_do_python_keypoint_eval

Co-authored-by: lupeng <penglu2097@gmail.com>
ajgrafton pushed a commit to ajgrafton/mmpose that referenced this pull request Mar 6, 2024
…pen-mmlab#1311)

* add TopDownGetBboxCenterScale transform

* update topdown coco

* update topdown aic

* update coco deeppose and coco-wholebody

* update topdown crowdpose

* update halpe/jhmdb/h36m

* update mhp/ochuman/posetrack18

* update mhp/ochuman/posetrack18

* update all datasets

* add unittest

* remove irrelevant files

* refactor inference apis

* separate xywh2cs and random shift

* update configs

* update mpii configs

* add create_ceph_configs

* fix typo

* minor fix

* fix unittest

* fix coco-wholebody-dataset

* fix typos in configs

* fix posetrack18 configs

* fix posetrack18 configs

* delete config with bboxshift

* modify accuracy records of Halpe

* update accuracy of AP10k

* update colab tutorial and unittest

* rename _do_keypoint_eval->_do_python_keypoint_eval

Co-authored-by: lupeng <penglu2097@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants