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

[Fix] skip warnings in demo #2746

Merged
merged 4 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
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: HRNet, UDP
In Collection: UDP
Metadata:
Architecture: &id001
- HRNet
Expand All @@ -28,7 +16,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
Expand All @@ -42,7 +30,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
Expand Down
2 changes: 1 addition & 1 deletion mmpose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
18 changes: 16 additions & 2 deletions mmpose/models/pose_estimators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions mmpose/visualization/local_visualizer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) OpenMMLab. All rights reserved.
import math
import warnings
from typing import Dict, List, Optional, Tuple, Union

import cv2
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions requirements/mminstall.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mmcv>=2.0.0,<2.1.0
mmdet>=3.0.0,<3.2.0
mmcv>=2.0.0,<2.2.0
mmdet>=3.0.0,<3.3.0
mmengine>=0.4.0,<1.0.0
Loading