From e71f2fe5cf9ed7cd4eccd3b099b231a526438875 Mon Sep 17 00:00:00 2001 From: jinsheng Date: Mon, 3 Aug 2020 20:52:03 +0800 Subject: [PATCH 1/2] change name to mpii_trb --- configs/top_down/resnet/README.md | 4 +- .../res50_mpii_trb_256x256.py} | 8 +- docs/getting_started.md | 73 ++++++++++++------- mmpose/datasets/datasets/__init__.py | 6 +- mmpose/datasets/datasets/top_down/__init__.py | 4 +- ...dataset.py => topdown_mpii_trb_dataset.py} | 4 +- 6 files changed, 61 insertions(+), 38 deletions(-) rename configs/top_down/resnet/{trbmpi/res50_trbmpi_256x256.py => mpii_trb/res50_mpii_trb_256x256.py} (93%) rename mmpose/datasets/datasets/top_down/{topdown_trbmpi_dataset.py => topdown_mpii_trb_dataset.py} (98%) diff --git a/configs/top_down/resnet/README.md b/configs/top_down/resnet/README.md index 9116fe9a90..ee07097b4c 100644 --- a/configs/top_down/resnet/README.md +++ b/configs/top_down/resnet/README.md @@ -24,8 +24,8 @@ | pose_resnet_152 | 256x192 | 0.735 | 0.905 | 0.812 | 0.790 | 0.943 | [ckpt](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/top_down/resnet/res152_coco_256x192-f6e307c2_20200709.pth) | [log](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/top_down/resnet/res152_coco_256x192_20200709.log.json) | | pose_resnet_152 | 384x288 | 0.750 | 0.908 | 0.821 | 0.800 | 0.942 | [ckpt](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/top_down/resnet/res152_coco_384x288-3860d4c9_20200709.pth) | [log](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/top_down/resnet/res152_coco_384x288_20200709.log.json) | -### Results on TRB-MPI val set. +### Results on MPII-TRB val set. | Arch | Input Size | Skeleton Acc | Contour Acc | Mean Acc | ckpt | log | | :--- | :--------: | :------: | :------: |:------: |:------: |:------: | -| pose_resnet_50 | 256x256 | 0.884 | 0.855 | 0.865 | [ckpt](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/top_down/resnet/res50_trbmpi_256x256-f0305d2e_20200727.pth) | [log](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/top_down/resnet/res50_trbmpi_256x256_20200727.log.json) | +| pose_resnet_50 | 256x256 | 0.884 | 0.855 | 0.865 | [ckpt](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/top_down/resnet/res50_mpii_trb_256x256-f0305d2e_20200727.pth) | [log](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/top_down/resnet/res50_mpii_trb_256x256_20200727.log.json) | diff --git a/configs/top_down/resnet/trbmpi/res50_trbmpi_256x256.py b/configs/top_down/resnet/mpii_trb/res50_mpii_trb_256x256.py similarity index 93% rename from configs/top_down/resnet/trbmpi/res50_trbmpi_256x256.py rename to configs/top_down/resnet/mpii_trb/res50_mpii_trb_256x256.py index 70d67e7aca..77268c18ac 100644 --- a/configs/top_down/resnet/trbmpi/res50_trbmpi_256x256.py +++ b/configs/top_down/resnet/mpii_trb/res50_mpii_trb_256x256.py @@ -102,14 +102,14 @@ samples_per_gpu=32, workers_per_gpu=2, train=dict( - type='TopDownTRBMPIDataset', - ann_file=f'{data_root}/annotations/trb_mpi_train.json', + type='TopDownMpiiTrbDataset', + ann_file=f'{data_root}/annotations/mpii_trb_train.json', img_prefix=f'{data_root}/images/', data_cfg=data_cfg, pipeline=train_pipeline), val=dict( - type='TopDownTRBMPIDataset', - ann_file=f'{data_root}/annotations/trb_mpi_val.json', + type='TopDownMpiiTrbDataset', + ann_file=f'{data_root}/annotations/mpii_trb_val.json', img_prefix=f'{data_root}/images/', data_cfg=data_cfg, pipeline=valid_pipeline), diff --git a/docs/getting_started.md b/docs/getting_started.md index 59de6bed5d..710ee65bfe 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -8,8 +8,38 @@ For installation instructions, please see [install.md](install.md). It is recommended to symlink the dataset root to `$MMPOSE/data`. If your folder structure is different, you may need to change the corresponding paths in config files. +**For COCO data**, please download from [COCO download](http://cocodataset.org/#download), 2017 Train/Val is needed for COCO keypoints training and validation. [HRNet-Human-Pose-Estimation](https://github.com/HRNet/HRNet-Human-Pose-Estimation) provides person detection result of COCO val2017 to reproduce our multi-person pose estimation results. Please download from [OneDrive](https://1drv.ms/f/s!AhIXJn_J-blWzzDXoz5BeFl8sWM-) +Download and extract them under $MMPOSE/data, and make them look like this: + +``` +mmpose +├── mmpose +├── docs +├── tests +├── tools +├── configs +`── data + │── coco + │-- annotations + │ │-- person_keypoints_train2017.json + │ |-- person_keypoints_val2017.json + |-- person_detection_results + | |-- COCO_val2017_detections_AP_H_56_person.json + │-- train2017 + │ │-- 000000000009.jpg + │ │-- 000000000025.jpg + │ │-- 000000000030.jpg + │ │-- ... + `-- val2017 + │-- 000000000139.jpg + │-- 000000000285.jpg + │-- 000000000632.jpg + │-- ... + +``` + **For MPII data**, please download from [MPII Human Pose Dataset](http://human-pose.mpi-inf.mpg.de/). -We support both MPII dataset and TRB-MPI dataset. We have converted the original annotation files into json format, please download them from [mpii_annotations](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/datasets/mpii_annotations.tar.gz). +We have converted the original annotation files into json format, please download them from [mpii_annotations](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/datasets/mpii_annotations.tar). Extract them under {MMPose}/data, and make them look like this: ``` @@ -22,21 +52,21 @@ mmpose `── data │── mpii |── annotations - | |── trb_mpi_train.json - | |── trb_mpi_val.json - | |── gt_valid.mat - | |── test.json - | |── train.json - | |── trainval.json - | `── valid.json + | |── mpii_gt_valid.mat + | |── mpii_test.json + | |── mpii_train.json + | |── mpii_trainval.json + | `── mpii_valid.json `── images |── 000001163.jpg |── 000003072.jpg ``` -**For COCO data**, please download from [COCO download](http://cocodataset.org/#download), 2017 Train/Val is needed for COCO keypoints training and validation. [HRNet-Human-Pose-Estimation](https://github.com/HRNet/HRNet-Human-Pose-Estimation) provides person detection result of COCO val2017 to reproduce our multi-person pose estimation results. Please download from [OneDrive](https://1drv.ms/f/s!AhIXJn_J-blWzzDXoz5BeFl8sWM-) -Download and extract them under $MMPOSE/data, and make them look like this: + +**For MPII-TRB data**, please download from [MPII Human Pose Dataset](http://human-pose.mpi-inf.mpg.de/). +Please download the annotation files from [mpii_trb_annotations](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/datasets/mpii_trb_annotations.tar). +Extract them under {MMPose}/data, and make them look like this: ``` mmpose @@ -46,22 +76,13 @@ mmpose ├── tools ├── configs `── data - │── coco - │-- annotations - │ │-- person_keypoints_train2017.json - │ |-- person_keypoints_val2017.json - |-- person_detection_results - | |-- COCO_val2017_detections_AP_H_56_person.json - │-- train2017 - │ │-- 000000000009.jpg - │ │-- 000000000025.jpg - │ │-- 000000000030.jpg - │ │-- ... - `-- val2017 - │-- 000000000139.jpg - │-- 000000000285.jpg - │-- 000000000632.jpg - │-- ... + │── mpii + |── annotations + | |── trb_mpi_train.json + | |── trb_mpi_val.json + `── images + |── 000001163.jpg + |── 000003072.jpg ``` diff --git a/mmpose/datasets/datasets/__init__.py b/mmpose/datasets/datasets/__init__.py index e88a6a570b..143a547349 100644 --- a/mmpose/datasets/datasets/__init__.py +++ b/mmpose/datasets/datasets/__init__.py @@ -1,4 +1,6 @@ from .bottom_up import BottomUpCocoDataset -from .top_down import TopDownCocoDataset, TopDownTRBMPIDataset +from .top_down import TopDownCocoDataset, TopDownMpiiTrbDataset -__all__ = ['TopDownCocoDataset', 'BottomUpCocoDataset', 'TopDownTRBMPIDataset'] +__all__ = [ + 'TopDownCocoDataset', 'BottomUpCocoDataset', 'TopDownMpiiTrbDataset' +] diff --git a/mmpose/datasets/datasets/top_down/__init__.py b/mmpose/datasets/datasets/top_down/__init__.py index ef4f0061ee..75ac18b1d3 100644 --- a/mmpose/datasets/datasets/top_down/__init__.py +++ b/mmpose/datasets/datasets/top_down/__init__.py @@ -1,4 +1,4 @@ from .topdown_coco_dataset import TopDownCocoDataset -from .topdown_trbmpi_dataset import TopDownTRBMPIDataset +from .topdown_mpii_trb_dataset import TopDownMpiiTrbDataset -__all__ = ['TopDownCocoDataset', 'TopDownTRBMPIDataset'] +__all__ = ['TopDownCocoDataset', 'TopDownMpiiTrbDataset'] diff --git a/mmpose/datasets/datasets/top_down/topdown_trbmpi_dataset.py b/mmpose/datasets/datasets/top_down/topdown_mpii_trb_dataset.py similarity index 98% rename from mmpose/datasets/datasets/top_down/topdown_trbmpi_dataset.py rename to mmpose/datasets/datasets/top_down/topdown_mpii_trb_dataset.py index 84e5d29e4c..5e66b6ec03 100644 --- a/mmpose/datasets/datasets/top_down/topdown_trbmpi_dataset.py +++ b/mmpose/datasets/datasets/top_down/topdown_mpii_trb_dataset.py @@ -11,8 +11,8 @@ @DATASETS.register_module() -class TopDownTRBMPIDataset(TopDownBaseDataset): - """CocoDataset dataset for top-down pose estimation. +class TopDownMpiiTrbDataset(TopDownBaseDataset): + """MPII-TRB Dataset dataset for top-down pose estimation. The dataset loads raw features and apply specified transforms to return a dict containing the image tensors and other information. From 80b6c6acc3b601720eced0c56028e641ad9c4175 Mon Sep 17 00:00:00 2001 From: jinsheng Date: Mon, 3 Aug 2020 21:34:30 +0800 Subject: [PATCH 2/2] fix bugs --- mmpose/datasets/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmpose/datasets/__init__.py b/mmpose/datasets/__init__.py index 64326d2d9b..10782d27de 100644 --- a/mmpose/datasets/__init__.py +++ b/mmpose/datasets/__init__.py @@ -1,12 +1,12 @@ from .builder import build_dataloader, build_dataset from .datasets import (BottomUpCocoDataset, TopDownCocoDataset, - TopDownTRBMPIDataset) + TopDownMpiiTrbDataset) from .pipelines import Compose from .registry import DATASETS, PIPELINES from .samplers import DistributedSampler __all__ = [ - 'TopDownCocoDataset', 'BottomUpCocoDataset', 'TopDownTRBMPIDataset', + 'TopDownCocoDataset', 'BottomUpCocoDataset', 'TopDownMpiiTrbDataset', 'build_dataloader', 'build_dataset', 'Compose', 'DistributedSampler', 'DATASETS', 'PIPELINES' ]