From a75b921c68dfda908bc0583080e6c29f90732280 Mon Sep 17 00:00:00 2001 From: lupeng Date: Wed, 11 Oct 2023 11:31:22 +0800 Subject: [PATCH 1/4] skip warnings --- .../deepfashion/hrnet_deepfashion.yml | 28 +++++++++---------- mmpose/models/pose_estimators/base.py | 18 ++++++++++-- mmpose/visualization/local_visualizer.py | 7 +++++ 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/hrnet_deepfashion.yml b/configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/hrnet_deepfashion.yml index 0c24947d3d..c60634c335 100644 --- a/configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/hrnet_deepfashion.yml +++ b/configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/hrnet_deepfashion.yml @@ -1,18 +1,18 @@ Collections: -- Name: HRNet - Paper: - Title: Deep high-resolution representation learning for human pose estimation - URL: http://openaccess.thecvf.com/content_CVPR_2019/html/Sun_Deep_High-Resolution_Representation_Learning_for_Human_Pose_Estimation_CVPR_2019_paper.html - README: https://github.com/open-mmlab/mmpose/blob/main/docs/src/papers/backbones/hrnet.md -- Name: UDP - Paper: - Title: 'The Devil Is in the Details: Delving Into Unbiased Data Processing for - Human Pose Estimation' - URL: http://openaccess.thecvf.com/content_CVPR_2020/html/Huang_The_Devil_Is_in_the_Details_Delving_Into_Unbiased_Data_CVPR_2020_paper.html - README: https://github.com/open-mmlab/mmpose/blob/main/docs/src/papers/techniques/udp.md +# - Name: HRNet +# Paper: +# Title: Deep high-resolution representation learning for human pose estimation +# URL: http://openaccess.thecvf.com/content_CVPR_2019/html/Sun_Deep_High-Resolution_Representation_Learning_for_Human_Pose_Estimation_CVPR_2019_paper.html +# README: https://github.com/open-mmlab/mmpose/blob/main/docs/src/papers/backbones/hrnet.md +# - Name: UDP +# Paper: +# Title: 'The Devil Is in the Details: Delving Into Unbiased Data Processing for +# Human Pose Estimation' +# URL: http://openaccess.thecvf.com/content_CVPR_2020/html/Huang_The_Devil_Is_in_the_Details_Delving_Into_Unbiased_Data_CVPR_2020_paper.html +# README: https://github.com/open-mmlab/mmpose/blob/main/docs/src/papers/techniques/udp.md Models: - Config: configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/td-hm_hrnet-w48_udp_8xb32-210e_deepfashion_lower-256x192.py - In Collection: HRNet, UDP + In Collection: UDP Metadata: Architecture: &id001 - HRNet @@ -28,7 +28,7 @@ Models: Task: Fashion 2D Keypoint Weights: https://download.openmmlab.com/mmpose/v1/fashion_2d_keypoint/topdown_heatmap/deepfashion/td-hm_hrnet-w48_udp_8xb32-210e_deepfashion_lower-256x192-ddaf747d_20230810.pth - Config: configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/td-hm_hrnet-w48_udp_8xb32-210e_deepfashion_upper-256x192.py - In Collection: HRNet, UDP + In Collection: UDP Metadata: Architecture: *id001 Training Data: DeepFashion @@ -42,7 +42,7 @@ Models: Task: Fashion 2D Keypoint Weights: https://download.openmmlab.com/mmpose/v1/fashion_2d_keypoint/topdown_heatmap/deepfashion/td-hm_hrnet-w48_udp_8xb32-210e_deepfashion_upper-256x192-de7c0eb1_20230810.pth - Config: configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/td-hm_hrnet-w48_udp_8xb32-210e_deepfashion_full-256x192.py - In Collection: HRNet, UDP + In Collection: UDP Metadata: Architecture: *id001 Training Data: DeepFashion diff --git a/mmpose/models/pose_estimators/base.py b/mmpose/models/pose_estimators/base.py index e98b2caeb8..474e0a49d6 100644 --- a/mmpose/models/pose_estimators/base.py +++ b/mmpose/models/pose_estimators/base.py @@ -202,18 +202,32 @@ def extract_feat(self, inputs: Tensor) -> Tuple[Tensor]: def _load_state_dict_pre_hook(self, state_dict, prefix, local_meta, *args, **kwargs): - """A hook function to convert old-version state dict of + """A hook function to. + + 1) convert old-version state dict of :class:`TopdownHeatmapSimpleHead` (before MMPose v1.0.0) to a compatible format of :class:`HeatmapHead`. + 2) remove the weights in data_preprocessor to avoid warning + `unexpected key in source state_dict: ...`. These weights are + initialized with given arguments and remain same during training + and inference. + The hook will be automatically registered during initialization. """ + + keys = list(state_dict.keys()) + + # remove the keys in data_preprocessor to avoid warning + for k in keys: + if k in ('data_preprocessor.mean', 'data_preprocessor.std'): + del state_dict[k] + version = local_meta.get('version', None) if version and version >= self._version: return # convert old-version state dict - keys = list(state_dict.keys()) for k in keys: if 'keypoint_head' in k: v = state_dict.pop(k) diff --git a/mmpose/visualization/local_visualizer.py b/mmpose/visualization/local_visualizer.py index 4e7bb92348..2c2664cf86 100644 --- a/mmpose/visualization/local_visualizer.py +++ b/mmpose/visualization/local_visualizer.py @@ -1,5 +1,6 @@ # Copyright (c) OpenMMLab. All rights reserved. import math +import warnings from typing import Dict, List, Optional, Tuple, Union import cv2 @@ -117,6 +118,12 @@ def __init__(self, show_keypoint_weight: bool = False, backend: str = 'opencv', alpha: float = 1.0): + + warnings.filterwarnings( + 'ignore', + message='.*please provide the `save_dir` argument.*', + category=UserWarning) + super().__init__( name=name, image=image, From 1b93b4b0f71fa6cfa444e99283d90ed511fb39ee Mon Sep 17 00:00:00 2001 From: lupeng Date: Wed, 11 Oct 2023 11:33:29 +0800 Subject: [PATCH 2/4] update --- .../deepfashion/hrnet_deepfashion.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/hrnet_deepfashion.yml b/configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/hrnet_deepfashion.yml index c60634c335..06c297ef8e 100644 --- a/configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/hrnet_deepfashion.yml +++ b/configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/hrnet_deepfashion.yml @@ -1,15 +1,3 @@ -Collections: -# - Name: HRNet -# Paper: -# Title: Deep high-resolution representation learning for human pose estimation -# URL: http://openaccess.thecvf.com/content_CVPR_2019/html/Sun_Deep_High-Resolution_Representation_Learning_for_Human_Pose_Estimation_CVPR_2019_paper.html -# README: https://github.com/open-mmlab/mmpose/blob/main/docs/src/papers/backbones/hrnet.md -# - Name: UDP -# Paper: -# Title: 'The Devil Is in the Details: Delving Into Unbiased Data Processing for -# Human Pose Estimation' -# URL: http://openaccess.thecvf.com/content_CVPR_2020/html/Huang_The_Devil_Is_in_the_Details_Delving_Into_Unbiased_Data_CVPR_2020_paper.html -# README: https://github.com/open-mmlab/mmpose/blob/main/docs/src/papers/techniques/udp.md Models: - Config: configs/fashion_2d_keypoint/topdown_heatmap/deepfashion/td-hm_hrnet-w48_udp_8xb32-210e_deepfashion_lower-256x192.py In Collection: UDP From 751d0d573164a9b6b2eb51d4a65f0d787bb7f7ec Mon Sep 17 00:00:00 2001 From: lupeng Date: Wed, 11 Oct 2023 11:56:42 +0800 Subject: [PATCH 3/4] update mmcv version --- requirements/mminstall.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/mminstall.txt b/requirements/mminstall.txt index 30d8402a42..5b4ce06fe9 100644 --- a/requirements/mminstall.txt +++ b/requirements/mminstall.txt @@ -1,3 +1,3 @@ -mmcv>=2.0.0,<2.1.0 +mmcv>=2.0.0,<2.2.0 mmdet>=3.0.0,<3.2.0 mmengine>=0.4.0,<1.0.0 From f57bf789c68bc6d1c4df3885b9d138bda7fede9b Mon Sep 17 00:00:00 2001 From: lupeng Date: Wed, 11 Oct 2023 12:59:23 +0800 Subject: [PATCH 4/4] update required mmcv & mmdet version --- mmpose/__init__.py | 2 +- requirements/mminstall.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mmpose/__init__.py b/mmpose/__init__.py index ad7946470d..583ede0a4d 100644 --- a/mmpose/__init__.py +++ b/mmpose/__init__.py @@ -6,7 +6,7 @@ from .version import __version__, short_version mmcv_minimum_version = '2.0.0rc4' -mmcv_maximum_version = '2.1.0' +mmcv_maximum_version = '2.2.0' mmcv_version = digit_version(mmcv.__version__) mmengine_minimum_version = '0.6.0' diff --git a/requirements/mminstall.txt b/requirements/mminstall.txt index 5b4ce06fe9..32eb00aceb 100644 --- a/requirements/mminstall.txt +++ b/requirements/mminstall.txt @@ -1,3 +1,3 @@ mmcv>=2.0.0,<2.2.0 -mmdet>=3.0.0,<3.2.0 +mmdet>=3.0.0,<3.3.0 mmengine>=0.4.0,<1.0.0