Open In Colab
MMPose Tutorial
Welcome to MMPose colab tutorial! In this tutorial, we will show you how to

perform inference with an MMPose model
train a new mmpose model with your own datasets
Let's start!

Install MMPose
We recommend to use a conda environment to install mmpose and its dependencies. And compilers nvcc and gcc are required.

# check NVCC version
!nvcc -V

# check GCC version
!gcc --version

# check python in conda environment
!which python
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:10:02_PDT_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.TC455_06.29069683_0
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

/home/PJLAB/liyining/anaconda3/envs/pt1.9/bin/python
# install pytorch
!pip install torch

# install mmcv-full
!pip install mmcv-full

# install mmdet for inference demo
!pip install mmdet

# clone mmpose repo
!rm -rf mmpose
!git clone https://github.com/open-mmlab/mmpose.git
%cd mmpose

# install mmpose dependencies
!pip install -r requirements.txt

# install mmpose in develop mode
!pip install -e .
Requirement already satisfied: mmcv-full in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (1.3.9)
Requirement already satisfied: Pillow in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmcv-full) (8.3.1)
Requirement already satisfied: yapf in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmcv-full) (0.31.0)
Requirement already satisfied: pyyaml in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmcv-full) (5.4.1)
Requirement already satisfied: addict in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmcv-full) (2.4.0)
Requirement already satisfied: numpy in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmcv-full) (1.21.1)
Requirement already satisfied: mmdet in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (2.15.0)
Requirement already satisfied: numpy in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmdet) (1.21.1)
Requirement already satisfied: terminaltables in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmdet) (3.1.0)
Requirement already satisfied: pycocotools in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmdet) (2.0.2)
Requirement already satisfied: six in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmdet) (1.16.0)
Requirement already satisfied: matplotlib in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmdet) (3.4.2)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->mmdet) (1.3.1)
Requirement already satisfied: cycler>=0.10 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->mmdet) (0.10.0)
Requirement already satisfied: python-dateutil>=2.7 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->mmdet) (2.8.2)
Requirement already satisfied: pyparsing>=2.2.1 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->mmdet) (2.4.7)
Requirement already satisfied: pillow>=6.2.0 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->mmdet) (8.3.1)
Requirement already satisfied: cython>=0.27.3 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from pycocotools->mmdet) (0.29.24)
Requirement already satisfied: setuptools>=18.0 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from pycocotools->mmdet) (52.0.0.post20210125)
Cloning into 'mmpose'...
remote: Enumerating objects: 12253, done.
remote: Counting objects: 100% (4193/4193), done.
remote: Compressing objects: 100% (1401/1401), done.
remote: Total 12253 (delta 3029), reused 3479 (delta 2695), pack-reused 8060
Receiving objects: 100% (12253/12253), 21.00 MiB | 2.92 MiB/s, done.
Resolving deltas: 100% (8230/8230), done.
Checking connectivity... done.
/home/SENSETIME/liyining/openmmlab/misc/colab/mmpose
Ignoring dataclasses: markers 'python_version == "3.6"' don't match your environment
Collecting poseval@ git+https://github.com/svenkreiss/poseval.git
  Cloning https://github.com/svenkreiss/poseval.git to /tmp/pip-install-d12g7njf/poseval_66b19fe8a11a4135b1a0064566177a26
  Running command git clone -q https://github.com/svenkreiss/poseval.git /tmp/pip-install-d12g7njf/poseval_66b19fe8a11a4135b1a0064566177a26
  Resolved https://github.com/svenkreiss/poseval.git to commit 3128c5cbcf90946e5164ff438ad651e113e64613
  Running command git submodule update --init --recursive -q
Requirement already satisfied: numpy in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from -r requirements/build.txt (line 2)) (1.21.1)
Collecting torch>=1.3
  Using cached torch-1.9.0-cp39-cp39-manylinux1_x86_64.whl (831.4 MB)
Collecting chumpy
  Using cached chumpy-0.70-py3-none-any.whl
Collecting json_tricks
  Using cached json_tricks-3.15.5-py2.py3-none-any.whl (26 kB)
Requirement already satisfied: matplotlib in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from -r requirements/runtime.txt (line 4)) (3.4.2)
Collecting munkres
  Using cached munkres-1.1.4-py2.py3-none-any.whl (7.0 kB)
Collecting opencv-python
  Using cached opencv_python-4.5.3.56-cp39-cp39-manylinux2014_x86_64.whl (49.9 MB)
Requirement already satisfied: pillow in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from -r requirements/runtime.txt (line 8)) (8.3.1)
Collecting scipy
  Using cached scipy-1.7.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (28.5 MB)
Collecting torchvision
  Using cached torchvision-0.10.0-cp39-cp39-manylinux1_x86_64.whl (22.1 MB)
Collecting xtcocotools>=1.8
  Downloading xtcocotools-1.10-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (303 kB)
     |████████████████████████████████| 303 kB 1.1 MB/s 
Collecting coverage
  Using cached coverage-5.5-cp39-cp39-manylinux2010_x86_64.whl (243 kB)
Collecting flake8
  Using cached flake8-3.9.2-py2.py3-none-any.whl (73 kB)
Collecting interrogate
  Using cached interrogate-1.4.0-py3-none-any.whl (28 kB)
Collecting isort==4.3.21
  Using cached isort-4.3.21-py2.py3-none-any.whl (42 kB)
Collecting pytest
  Using cached pytest-6.2.4-py3-none-any.whl (280 kB)
Collecting pytest-runner
  Using cached pytest_runner-5.3.1-py3-none-any.whl (7.1 kB)
Collecting smplx>=0.1.28
  Using cached smplx-0.1.28-py3-none-any.whl (29 kB)
Collecting xdoctest>=0.10.0
  Using cached xdoctest-0.15.5-py3-none-any.whl (113 kB)
Requirement already satisfied: yapf in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from -r requirements/tests.txt (line 9)) (0.31.0)
Collecting albumentations>=0.3.2
  Using cached albumentations-1.0.3.tar.gz (173 kB)
Collecting onnx
  Downloading onnx-1.10.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (12.3 MB)
     |████████████████████████████████| 12.3 MB 4.1 MB/s 
Collecting onnxruntime
  Using cached onnxruntime-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB)
Collecting pyrender
  Using cached pyrender-0.1.45-py3-none-any.whl (1.2 MB)
Collecting trimesh
  Downloading trimesh-3.9.26-py3-none-any.whl (634 kB)
     |████████████████████████████████| 634 kB 978 kB/s 
Collecting typing-extensions
  Using cached typing_extensions-3.10.0.0-py3-none-any.whl (26 kB)
Requirement already satisfied: six>=1.11.0 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from chumpy->-r requirements/runtime.txt (line 1)) (1.16.0)
Requirement already satisfied: python-dateutil>=2.7 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->-r requirements/runtime.txt (line 4)) (2.8.2)
Requirement already satisfied: cycler>=0.10 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->-r requirements/runtime.txt (line 4)) (0.10.0)
Requirement already satisfied: pyparsing>=2.2.1 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->-r requirements/runtime.txt (line 4)) (2.4.7)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->-r requirements/runtime.txt (line 4)) (1.3.1)
Requirement already satisfied: cython>=0.27.3 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from xtcocotools>=1.8->-r requirements/runtime.txt (line 11)) (0.29.24)
Requirement already satisfied: setuptools>=18.0 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from xtcocotools>=1.8->-r requirements/runtime.txt (line 11)) (52.0.0.post20210125)
Collecting mccabe<0.7.0,>=0.6.0
  Using cached mccabe-0.6.1-py2.py3-none-any.whl (8.6 kB)
Collecting pycodestyle<2.8.0,>=2.7.0
  Using cached pycodestyle-2.7.0-py2.py3-none-any.whl (41 kB)
Collecting pyflakes<2.4.0,>=2.3.0
  Using cached pyflakes-2.3.1-py2.py3-none-any.whl (68 kB)
Collecting toml
  Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting colorama
  Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting tabulate
  Using cached tabulate-0.8.9-py3-none-any.whl (25 kB)
Collecting click
  Using cached click-8.0.1-py3-none-any.whl (97 kB)
Collecting py
  Using cached py-1.10.0-py2.py3-none-any.whl (97 kB)
Requirement already satisfied: attrs in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from interrogate->-r requirements/tests.txt (line 3)) (21.2.0)
Collecting iniconfig
  Using cached iniconfig-1.1.1-py2.py3-none-any.whl (5.0 kB)
Requirement already satisfied: packaging in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from pytest->-r requirements/tests.txt (line 5)) (21.0)
Collecting pluggy<1.0.0a1,>=0.12
  Using cached pluggy-0.13.1-py2.py3-none-any.whl (18 kB)
Collecting scikit-image>=0.16.1
  Using cached scikit_image-0.18.2-cp39-cp39-manylinux2010_x86_64.whl (34.6 MB)
Requirement already satisfied: PyYAML in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from albumentations>=0.3.2->-r requirements/optional.txt (line 1)) (5.4.1)
Collecting opencv-python-headless>=4.1.1
  Using cached opencv_python_headless-4.5.3.56-cp39-cp39-manylinux2014_x86_64.whl (37.1 MB)
Collecting protobuf
  Using cached protobuf-3.17.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB)
Collecting flatbuffers
  Using cached flatbuffers-2.0-py2.py3-none-any.whl (26 kB)
Collecting motmetrics>=1.2
  Using cached motmetrics-1.2.0-py3-none-any.whl (151 kB)
Collecting shapely
  Using cached Shapely-1.7.1-1-cp39-cp39-manylinux1_x86_64.whl (1.0 MB)
Collecting tqdm
  Downloading tqdm-4.62.0-py2.py3-none-any.whl (76 kB)
     |████████████████████████████████| 76 kB 1.0 MB/s 
Collecting networkx
  Using cached networkx-2.6.2-py3-none-any.whl (1.9 MB)
Collecting freetype-py
  Using cached freetype_py-2.2.0-py3-none-manylinux1_x86_64.whl (890 kB)
Collecting pyglet>=1.4.10
  Using cached pyglet-1.5.18-py3-none-any.whl (1.1 MB)
Collecting imageio
  Using cached imageio-2.9.0-py3-none-any.whl (3.3 MB)
Collecting PyOpenGL==3.1.0
  Using cached PyOpenGL-3.1.0-py3-none-any.whl
Collecting pytest-benchmark
  Using cached pytest_benchmark-3.4.1-py2.py3-none-any.whl (50 kB)
Collecting flake8-import-order
  Using cached flake8_import_order-0.18.1-py2.py3-none-any.whl (15 kB)
Collecting pandas>=0.23.1
  Using cached pandas-1.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.7 MB)
Collecting xmltodict>=0.12.0
  Using cached xmltodict-0.12.0-py2.py3-none-any.whl (9.2 kB)
Requirement already satisfied: pytz>=2017.3 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from pandas>=0.23.1->motmetrics>=1.2->poseval@ git+https://github.com/svenkreiss/poseval.git->-r requirements/optional.txt (line 4)) (2021.1)
Collecting tifffile>=2019.7.26
  Using cached tifffile-2021.7.30-py3-none-any.whl (171 kB)
Collecting PyWavelets>=1.1.1
  Using cached PyWavelets-1.1.1-cp39-cp39-manylinux1_x86_64.whl (4.3 MB)
Collecting py-cpuinfo
  Using cached py_cpuinfo-8.0.0-py3-none-any.whl
Skipping wheel build for albumentations, due to binaries being disabled for it.
Building wheels for collected packages: poseval
  Building wheel for poseval (setup.py) ... - \ done
  Created wheel for poseval: filename=poseval-0.1.0-py3-none-any.whl size=25993 sha256=412ec354869baa10f28ba8938ca6a63c0c9233d8fbb839377f201c398d1cf5a6
  Stored in directory: /tmp/pip-ephem-wheel-cache-12d_ns95/wheels/0f/4a/c4/17e52eb6f9f3371b8cf1863940bff5118b00875b66809f9f51
Successfully built poseval
Installing collected packages: toml, py, pluggy, iniconfig, pytest, pyflakes, pycodestyle, py-cpuinfo, mccabe, xmltodict, typing-extensions, tifffile, scipy, PyWavelets, pytest-benchmark, pandas, networkx, imageio, flake8-import-order, flake8, trimesh, tqdm, torch, tabulate, shapely, scikit-image, PyOpenGL, pyglet, protobuf, opencv-python-headless, motmetrics, freetype-py, flatbuffers, colorama, click, xtcocotools, xdoctest, torchvision, smplx, pytest-runner, pyrender, poseval, opencv-python, onnxruntime, onnx, munkres, json-tricks, isort, interrogate, coverage, chumpy, albumentations
    Running setup.py install for albumentations ... - \ done
Successfully installed PyOpenGL-3.1.0 PyWavelets-1.1.1 albumentations-1.0.3 chumpy-0.70 click-8.0.1 colorama-0.4.4 coverage-5.5 flake8-3.9.2 flake8-import-order-0.18.1 flatbuffers-2.0 freetype-py-2.2.0 imageio-2.9.0 iniconfig-1.1.1 interrogate-1.4.0 isort-4.3.21 json-tricks-3.15.5 mccabe-0.6.1 motmetrics-1.2.0 munkres-1.1.4 networkx-2.6.2 onnx-1.10.1 onnxruntime-1.8.1 opencv-python-4.5.3.56 opencv-python-headless-4.5.3.56 pandas-1.3.1 pluggy-0.13.1 poseval-0.1.0 protobuf-3.17.3 py-1.10.0 py-cpuinfo-8.0.0 pycodestyle-2.7.0 pyflakes-2.3.1 pyglet-1.5.18 pyrender-0.1.45 pytest-6.2.4 pytest-benchmark-3.4.1 pytest-runner-5.3.1 scikit-image-0.18.2 scipy-1.7.1 shapely-1.7.1 smplx-0.1.28 tabulate-0.8.9 tifffile-2021.7.30 toml-0.10.2 torch-1.9.0 torchvision-0.10.0 tqdm-4.62.0 trimesh-3.9.26 typing-extensions-3.10.0.0 xdoctest-0.15.5 xmltodict-0.12.0 xtcocotools-1.10
Obtaining file:///home/SENSETIME/liyining/openmmlab/misc/colab/mmpose
Requirement already satisfied: chumpy in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmpose==0.16.0) (0.70)
Requirement already satisfied: json_tricks in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmpose==0.16.0) (3.15.5)
Requirement already satisfied: matplotlib in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmpose==0.16.0) (3.4.2)
Requirement already satisfied: munkres in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmpose==0.16.0) (1.1.4)
Requirement already satisfied: numpy in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmpose==0.16.0) (1.21.1)
Requirement already satisfied: opencv-python in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmpose==0.16.0) (4.5.3.56)
Requirement already satisfied: pillow in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmpose==0.16.0) (8.3.1)
Requirement already satisfied: scipy in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmpose==0.16.0) (1.7.1)
Requirement already satisfied: torchvision in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmpose==0.16.0) (0.10.0)
Requirement already satisfied: xtcocotools>=1.8 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from mmpose==0.16.0) (1.10)
Requirement already satisfied: cython>=0.27.3 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from xtcocotools>=1.8->mmpose==0.16.0) (0.29.24)
Requirement already satisfied: setuptools>=18.0 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from xtcocotools>=1.8->mmpose==0.16.0) (52.0.0.post20210125)
Requirement already satisfied: python-dateutil>=2.7 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->mmpose==0.16.0) (2.8.2)
Requirement already satisfied: cycler>=0.10 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->mmpose==0.16.0) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->mmpose==0.16.0) (1.3.1)
Requirement already satisfied: pyparsing>=2.2.1 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from matplotlib->mmpose==0.16.0) (2.4.7)
Requirement already satisfied: six in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from cycler>=0.10->matplotlib->mmpose==0.16.0) (1.16.0)
Requirement already satisfied: torch==1.9.0 in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from torchvision->mmpose==0.16.0) (1.9.0)
Requirement already satisfied: typing-extensions in /home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages (from torch==1.9.0->torchvision->mmpose==0.16.0) (3.10.0.0)
Installing collected packages: mmpose
  Running setup.py develop for mmpose
Successfully installed mmpose-0.16.0
# Check Pytorch installation
import torch, torchvision
print('torch version:', torch.__version__, torch.cuda.is_available())
print('torchvision version:', torchvision.__version__)

# Check MMPose installation
import mmpose
print('mmpose version:', mmpose.__version__)

# Check mmcv installation
from mmcv.ops import get_compiling_cuda_version, get_compiler_version
print('cuda version:', get_compiling_cuda_version())
print('compiler information:', get_compiler_version())
torch version: 1.9.0+cu111 True
torchvision version: 0.10.0+cu111
mmpose version: 0.18.0
cuda version: 11.1
compiler information: GCC 9.3
Inference with an MMPose model
MMPose provides high level APIs for model inference and training.

import cv2
from mmpose.apis import (inference_top_down_pose_model, init_pose_model,
                         vis_pose_result, process_mmdet_results)
from mmdet.apis import inference_detector, init_detector
local_runtime = False

try:
  from google.colab.patches import cv2_imshow  # for image visualization in colab
except:
  local_runtime = True

pose_config = 'configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/hrnet_w48_coco_256x192.py'
pose_checkpoint = 'https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth'
det_config = 'demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py'
det_checkpoint = 'https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth'

# initialize pose model
pose_model = init_pose_model(pose_config, pose_checkpoint)
# initialize detector
det_model = init_detector(det_config, det_checkpoint)

img = 'tests/data/coco/000000196141.jpg'

# inference detection
mmdet_results = inference_detector(det_model, img)

# extract person (COCO_ID=1) bounding boxes from the detection results
person_results = process_mmdet_results(mmdet_results, cat_id=1)

# inference pose
pose_results, returned_outputs = inference_top_down_pose_model(pose_model,
                                                               img,
                                                               person_results,
                                                               bbox_thr=0.3,
                                                               format='xyxy',
                                                               dataset=pose_model.cfg.data.test.type)

# show pose estimation results
vis_result = vis_pose_result(pose_model,
                             img,
                             pose_results,
                             dataset=pose_model.cfg.data.test.type,
                             show=False)
# reduce image size
vis_result = cv2.resize(vis_result, dsize=None, fx=0.5, fy=0.5)

if local_runtime:
  from IPython.display import Image, display
  import tempfile
  import os.path as osp
  with tempfile.TemporaryDirectory() as tmpdir:
    file_name = osp.join(tmpdir, 'pose_results.png')
    cv2.imwrite(file_name, vis_result)
    display(Image(file_name))
else:
  cv2_imshow(vis_result)
Use load_from_http loader
/home/PJLAB/liyining/anaconda3/envs/pt1.9/lib/python3.9/site-packages/mmdet/core/anchor/builder.py:16: UserWarning: ``build_anchor_generator`` would be deprecated soon, please use ``build_prior_generator`` 
  warnings.warn(
Use load_from_http loader
/home/PJLAB/liyining/anaconda3/envs/pt1.9/lib/python3.9/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at  /pytorch/c10/core/TensorImpl.h:1156.)
  return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
/home/PJLAB/liyining/anaconda3/envs/pt1.9/lib/python3.9/site-packages/mmdet/core/anchor/anchor_generator.py:324: UserWarning: ``grid_anchors`` would be deprecated soon. Please use ``grid_priors`` 
  warnings.warn('``grid_anchors`` would be deprecated soon. '
/home/PJLAB/liyining/anaconda3/envs/pt1.9/lib/python3.9/site-packages/mmdet/core/anchor/anchor_generator.py:360: UserWarning: ``single_level_grid_anchors`` would be deprecated soon. Please use ``single_level_grid_priors`` 
  warnings.warn(

Train a pose estimation model on a customized dataset
To train a model on a customized dataset with MMPose, there are usually three steps:

Support the dataset in MMPose
Create a config
Perform training and evaluation
Add a new dataset
There are two methods to support a customized dataset in MMPose. The first one is to convert the data to a supported format (e.g. COCO) and use the corresponding dataset class (e.g. TopdownCOCODataset), as described in the document. The second one is to add a new dataset class. In this tutorial, we give an example of the second method.

We first download the demo dataset, which contains 100 samples (75 for training and 25 for validation) selected from COCO train2017 dataset. The annotations are stored in a different format from the original COCO format.

# download dataset
%mkdir data
%cd data
!wget https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/datasets/coco_tiny.tar
!tar -xf coco_tiny.tar
%cd ..
mkdir: cannot create directory ‘data’: File exists
/home/PJLAB/liyining/openmmlab/mmpose/data
--2021-09-22 22:27:21--  https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmpose/datasets/coco_tiny.tar
Resolving openmmlab.oss-cn-hangzhou.aliyuncs.com (openmmlab.oss-cn-hangzhou.aliyuncs.com)... 124.160.145.51
Connecting to openmmlab.oss-cn-hangzhou.aliyuncs.com (openmmlab.oss-cn-hangzhou.aliyuncs.com)|124.160.145.51|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16558080 (16M) [application/x-tar]
Saving to: ‘coco_tiny.tar.1’

coco_tiny.tar.1     100%[===================>]  15.79M  14.7MB/s    in 1.1s    

2021-09-22 22:27:24 (14.7 MB/s) - ‘coco_tiny.tar.1’ saved [16558080/16558080]

/home/PJLAB/liyining/openmmlab/mmpose
# check the directory structure
!apt-get -q install tree
!tree data/coco_tiny
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
data/coco_tiny
├── images
│   ├── 000000012754.jpg
│   ├── 000000017741.jpg
│   ├── 000000019157.jpg
│   ├── 000000019523.jpg
│   ├── 000000019608.jpg
│   ├── 000000022816.jpg
│   ├── 000000031092.jpg
│   ├── 000000032124.jpg
│   ├── 000000037209.jpg
│   ├── 000000050713.jpg
│   ├── 000000057703.jpg
│   ├── 000000064909.jpg
│   ├── 000000076942.jpg
│   ├── 000000079754.jpg
│   ├── 000000083935.jpg
│   ├── 000000085316.jpg
│   ├── 000000101013.jpg
│   ├── 000000101172.jpg
│   ├── 000000103134.jpg
│   ├── 000000103163.jpg
│   ├── 000000105647.jpg
│   ├── 000000107960.jpg
│   ├── 000000117891.jpg
│   ├── 000000118181.jpg
│   ├── 000000120021.jpg
│   ├── 000000128119.jpg
│   ├── 000000143908.jpg
│   ├── 000000145025.jpg
│   ├── 000000147386.jpg
│   ├── 000000147979.jpg
│   ├── 000000154222.jpg
│   ├── 000000160190.jpg
│   ├── 000000161112.jpg
│   ├── 000000175737.jpg
│   ├── 000000177069.jpg
│   ├── 000000184659.jpg
│   ├── 000000209468.jpg
│   ├── 000000210060.jpg
│   ├── 000000215867.jpg
│   ├── 000000216861.jpg
│   ├── 000000227224.jpg
│   ├── 000000246265.jpg
│   ├── 000000254919.jpg
│   ├── 000000263687.jpg
│   ├── 000000264628.jpg
│   ├── 000000268927.jpg
│   ├── 000000271177.jpg
│   ├── 000000275219.jpg
│   ├── 000000277542.jpg
│   ├── 000000279140.jpg
│   ├── 000000286813.jpg
│   ├── 000000297980.jpg
│   ├── 000000301641.jpg
│   ├── 000000312341.jpg
│   ├── 000000325768.jpg
│   ├── 000000332221.jpg
│   ├── 000000345071.jpg
│   ├── 000000346965.jpg
│   ├── 000000347836.jpg
│   ├── 000000349437.jpg
│   ├── 000000360735.jpg
│   ├── 000000362343.jpg
│   ├── 000000364079.jpg
│   ├── 000000364113.jpg
│   ├── 000000386279.jpg
│   ├── 000000386968.jpg
│   ├── 000000388619.jpg
│   ├── 000000390137.jpg
│   ├── 000000390241.jpg
│   ├── 000000390298.jpg
│   ├── 000000390348.jpg
│   ├── 000000398606.jpg
│   ├── 000000400456.jpg
│   ├── 000000402514.jpg
│   ├── 000000403255.jpg
│   ├── 000000403432.jpg
│   ├── 000000410350.jpg
│   ├── 000000453065.jpg
│   ├── 000000457254.jpg
│   ├── 000000464153.jpg
│   ├── 000000464515.jpg
│   ├── 000000465418.jpg
│   ├── 000000480591.jpg
│   ├── 000000484279.jpg
│   ├── 000000494014.jpg
│   ├── 000000515289.jpg
│   ├── 000000516805.jpg
│   ├── 000000521994.jpg
│   ├── 000000528962.jpg
│   ├── 000000534736.jpg
│   ├── 000000535588.jpg
│   ├── 000000537548.jpg
│   ├── 000000553698.jpg
│   ├── 000000555622.jpg
│   ├── 000000566456.jpg
│   ├── 000000567171.jpg
│   └── 000000568961.jpg
├── train.json
└── val.json

1 directory, 99 files
# check the annotation format
import json
import pprint

anns = json.load(open('data/coco_tiny/train.json'))

print(type(anns), len(anns))
pprint.pprint(anns[0], compact=True)
<class 'list'> 75
{'bbox': [267.03, 104.32, 229.19, 320],
 'image_file': '000000537548.jpg',
 'image_size': [640, 480],
 'keypoints': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 325, 160, 2, 398,
               177, 2, 0, 0, 0, 437, 238, 2, 0, 0, 0, 477, 270, 2, 287, 255, 1,
               339, 267, 2, 0, 0, 0, 423, 314, 2, 0, 0, 0, 355, 367, 2]}
After downloading the data, we implement a new dataset class to load data samples for model training and validation. Assume that we are going to train a top-down pose estimation model (refer to Top-down Pose Estimation for a brief introduction), the new dataset class inherits TopDownBaseDataset.

import json
import os
import os.path as osp
from collections import OrderedDict
import tempfile

import numpy as np

from mmpose.core.evaluation.top_down_eval import (keypoint_nme,
                                                  keypoint_pck_accuracy)
from mmpose.datasets.builder import DATASETS
from mmpose.datasets.datasets.base import Kpt2dSviewRgbImgTopDownDataset


@DATASETS.register_module()
class TopDownCOCOTinyDataset(Kpt2dSviewRgbImgTopDownDataset):

	def __init__(self,
				 ann_file,
				 img_prefix,
				 data_cfg,
				 pipeline,
				 dataset_info=None,
				 test_mode=False):
		super().__init__(
			ann_file, img_prefix, data_cfg, pipeline, dataset_info, coco_style=False, test_mode=test_mode)

		# flip_pairs, upper_body_ids and lower_body_ids will be used
		# in some data augmentations like random flip
		self.ann_info['flip_pairs'] = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10],
									   [11, 12], [13, 14], [15, 16]]
		self.ann_info['upper_body_ids'] = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
		self.ann_info['lower_body_ids'] = (11, 12, 13, 14, 15, 16)

		self.ann_info['joint_weights'] = None
		self.ann_info['use_different_joint_weights'] = False

		self.dataset_name = 'coco_tiny'
		self.db = self._get_db()

	def _get_db(self):
		with open(self.ann_file) as f:
			anns = json.load(f)

		db = []
		for idx, ann in enumerate(anns):
			# get image path
			image_file = osp.join(self.img_prefix, ann['image_file'])
			# get bbox
			bbox = ann['bbox']
			center, scale = self._xywh2cs(*bbox)
			# get keypoints
			keypoints = np.array(
				ann['keypoints'], dtype=np.float32).reshape(-1, 3)
			num_joints = keypoints.shape[0]
			joints_3d = np.zeros((num_joints, 3), dtype=np.float32)
			joints_3d[:, :2] = keypoints[:, :2]
			joints_3d_visible = np.zeros((num_joints, 3), dtype=np.float32)
			joints_3d_visible[:, :2] = np.minimum(1, keypoints[:, 2:3])

			sample = {
				'image_file': image_file,
				'center': center,
				'scale': scale,
				'bbox': bbox,
				'rotation': 0,
				'joints_3d': joints_3d,
				'joints_3d_visible': joints_3d_visible,
				'bbox_score': 1,
				'bbox_id': idx,
			}
			db.append(sample)

		return db

	def _xywh2cs(self, x, y, w, h):
		"""This encodes bbox(x, y, w, h) into (center, scale)
		Args:
			x, y, w, h
		Returns:
			tuple: A tuple containing center and scale.
			- center (np.ndarray[float32](2,)): center of the bbox (x, y).
			- scale (np.ndarray[float32](2,)): scale of the bbox w & h.
		"""
		aspect_ratio = self.ann_info['image_size'][0] / self.ann_info[
			'image_size'][1]
		center = np.array([x + w * 0.5, y + h * 0.5], dtype=np.float32)
		if w > aspect_ratio * h:
			h = w * 1.0 / aspect_ratio
		elif w < aspect_ratio * h:
			w = h * aspect_ratio

		# pixel std is 200.0
		scale = np.array([w / 200.0, h / 200.0], dtype=np.float32)
		# padding to include proper amount of context
		scale = scale * 1.25
		return center, scale

	def evaluate(self, results, res_folder=None, metric='PCK', **kwargs):
		"""Evaluate keypoint detection results. The pose prediction results will
		be saved in `${res_folder}/result_keypoints.json`.

		Note:
		batch_size: N
		num_keypoints: K
		heatmap height: H
		heatmap width: W

		Args:
		results (list(preds, boxes, image_path, output_heatmap))
			:preds (np.ndarray[N,K,3]): The first two dimensions are
				coordinates, score is the third dimension of the array.
			:boxes (np.ndarray[N,6]): [center[0], center[1], scale[0]
				, scale[1],area, score]
			:image_paths (list[str]): For example, ['Test/source/0.jpg']
			:output_heatmap (np.ndarray[N, K, H, W]): model outputs.

		res_folder (str, optional): The folder to save the testing
                results. If not specified, a temp folder will be created.
                Default: None.
		metric (str | list[str]): Metric to be performed.
			Options: 'PCK', 'NME'.

		Returns:
			dict: Evaluation results for evaluation metric.
		"""
		metrics = metric if isinstance(metric, list) else [metric]
		allowed_metrics = ['PCK', 'NME']
		for metric in metrics:
			if metric not in allowed_metrics:
				raise KeyError(f'metric {metric} is not supported')

		if res_folder is not None:
            tmp_folder = None
            res_file = osp.join(res_folder, 'result_keypoints.json')
        else:
            tmp_folder = tempfile.TemporaryDirectory()
            res_file = osp.join(tmp_folder.name, 'result_keypoints.json')

		kpts = []
		for result in results:
			preds = result['preds']
			boxes = result['boxes']
			image_paths = result['image_paths']
			bbox_ids = result['bbox_ids']

			batch_size = len(image_paths)
			for i in range(batch_size):
				kpts.append({
					'keypoints': preds[i].tolist(),
					'center': boxes[i][0:2].tolist(),
					'scale': boxes[i][2:4].tolist(),
					'area': float(boxes[i][4]),
					'score': float(boxes[i][5]),
					'bbox_id': bbox_ids[i]
				})
		kpts = self._sort_and_unique_bboxes(kpts)

		self._write_keypoint_results(kpts, res_file)
		info_str = self._report_metric(res_file, metrics)
		name_value = OrderedDict(info_str)

		if tmp_folder is not None:
			tmp_folder.cleanup()

		return name_value

	def _report_metric(self, res_file, metrics, pck_thr=0.3):
		"""Keypoint evaluation.

		Args:
		res_file (str): Json file stored prediction results.
		metrics (str | list[str]): Metric to be performed.
			Options: 'PCK', 'NME'.
		pck_thr (float): PCK threshold, default: 0.3.

		Returns:
		dict: Evaluation results for evaluation metric.
		"""
		info_str = []

		with open(res_file, 'r') as fin:
			preds = json.load(fin)
		assert len(preds) == len(self.db)

		outputs = []
		gts = []
		masks = []

		for pred, item in zip(preds, self.db):
			outputs.append(np.array(pred['keypoints'])[:, :-1])
			gts.append(np.array(item['joints_3d'])[:, :-1])
			masks.append((np.array(item['joints_3d_visible'])[:, 0]) > 0)

		outputs = np.array(outputs)
		gts = np.array(gts)
		masks = np.array(masks)

		normalize_factor = self._get_normalize_factor(gts)

		if 'PCK' in metrics:
			_, pck, _ = keypoint_pck_accuracy(outputs, gts, masks, pck_thr,
											  normalize_factor)
			info_str.append(('PCK', pck))

		if 'NME' in metrics:
			info_str.append(
				('NME', keypoint_nme(outputs, gts, masks, normalize_factor)))

		return info_str

	@staticmethod
	def _write_keypoint_results(keypoints, res_file):
		"""Write results into a json file."""

		with open(res_file, 'w') as f:
			json.dump(keypoints, f, sort_keys=True, indent=4)

	@staticmethod
	def _sort_and_unique_bboxes(kpts, key='bbox_id'):
		"""sort kpts and remove the repeated ones."""
		kpts = sorted(kpts, key=lambda x: x[key])
		num = len(kpts)
		for i in range(num - 1, 0, -1):
			if kpts[i][key] == kpts[i - 1][key]:
				del kpts[i]

		return kpts
	
	@staticmethod
	def _get_normalize_factor(gts):
		"""Get inter-ocular distance as the normalize factor, measured as the
		Euclidean distance between the outer corners of the eyes.

		Args:
			gts (np.ndarray[N, K, 2]): Groundtruth keypoint location.

		Return:
			np.ndarray[N, 2]: normalized factor
		"""

		interocular = np.linalg.norm(
			gts[:, 0, :] - gts[:, 1, :], axis=1, keepdims=True)
		return np.tile(interocular, [1, 2])
Create a config file
In the next step, we create a config file which configures the model, dataset and runtime settings. More information can be found at Learn about Configs. A common practice to create a config file is deriving from a existing one. In this tutorial, we load a config file that trains a HRNet on COCO dataset, and modify it to adapt to the COCOTiny dataset.

from mmcv import Config
cfg = Config.fromfile(
    './configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/hrnet_w32_coco_256x192.py'
)

# set basic configs
cfg.data_root = 'data/coco_tiny'
cfg.work_dir = 'work_dirs/hrnet_w32_coco_tiny_256x192'
cfg.gpu_ids = range(1)
cfg.seed = 0

# set log interval
cfg.log_config.interval = 1

# set evaluation configs
cfg.evaluation.interval = 10
cfg.evaluation.metric = 'PCK'
cfg.evaluation.save_best = 'PCK'

# set learning rate policy
lr_config = dict(
    policy='step',
    warmup='linear',
    warmup_iters=10,
    warmup_ratio=0.001,
    step=[17, 35])
cfg.total_epochs = 40

# set batch size
cfg.data.samples_per_gpu = 16
cfg.data.val_dataloader = dict(samples_per_gpu=16)
cfg.data.test_dataloader = dict(samples_per_gpu=16)


# set dataset configs
cfg.data.train.type = 'TopDownCOCOTinyDataset'
cfg.data.train.ann_file = f'{cfg.data_root}/train.json'
cfg.data.train.img_prefix = f'{cfg.data_root}/images/'

cfg.data.val.type = 'TopDownCOCOTinyDataset'
cfg.data.val.ann_file = f'{cfg.data_root}/val.json'
cfg.data.val.img_prefix = f'{cfg.data_root}/images/'

cfg.data.test.type = 'TopDownCOCOTinyDataset'
cfg.data.test.ann_file = f'{cfg.data_root}/val.json'
cfg.data.test.img_prefix = f'{cfg.data_root}/images/'

print(cfg.pretty_text)
dataset_info = dict(
    dataset_name='coco',
    paper_info=dict(
        author=
        'Lin, Tsung-Yi and Maire, Michael and Belongie, Serge and Hays, James and Perona, Pietro and Ramanan, Deva and Doll{\'a}r, Piotr and Zitnick, C Lawrence',
        title='Microsoft coco: Common objects in context',
        container='European conference on computer vision',
        year='2014',
        homepage='http://cocodataset.org/'),
    keypoint_info=dict({
        0:
        dict(name='nose', id=0, color=[51, 153, 255], type='upper', swap=''),
        1:
        dict(
            name='left_eye',
            id=1,
            color=[51, 153, 255],
            type='upper',
            swap='right_eye'),
        2:
        dict(
            name='right_eye',
            id=2,
            color=[51, 153, 255],
            type='upper',
            swap='left_eye'),
        3:
        dict(
            name='left_ear',
            id=3,
            color=[51, 153, 255],
            type='upper',
            swap='right_ear'),
        4:
        dict(
            name='right_ear',
            id=4,
            color=[51, 153, 255],
            type='upper',
            swap='left_ear'),
        5:
        dict(
            name='left_shoulder',
            id=5,
            color=[0, 255, 0],
            type='upper',
            swap='right_shoulder'),
        6:
        dict(
            name='right_shoulder',
            id=6,
            color=[255, 128, 0],
            type='upper',
            swap='left_shoulder'),
        7:
        dict(
            name='left_elbow',
            id=7,
            color=[0, 255, 0],
            type='upper',
            swap='right_elbow'),
        8:
        dict(
            name='right_elbow',
            id=8,
            color=[255, 128, 0],
            type='upper',
            swap='left_elbow'),
        9:
        dict(
            name='left_wrist',
            id=9,
            color=[0, 255, 0],
            type='upper',
            swap='right_wrist'),
        10:
        dict(
            name='right_wrist',
            id=10,
            color=[255, 128, 0],
            type='upper',
            swap='left_wrist'),
        11:
        dict(
            name='left_hip',
            id=11,
            color=[0, 255, 0],
            type='lower',
            swap='right_hip'),
        12:
        dict(
            name='right_hip',
            id=12,
            color=[255, 128, 0],
            type='lower',
            swap='left_hip'),
        13:
        dict(
            name='left_knee',
            id=13,
            color=[0, 255, 0],
            type='lower',
            swap='right_knee'),
        14:
        dict(
            name='right_knee',
            id=14,
            color=[255, 128, 0],
            type='lower',
            swap='left_knee'),
        15:
        dict(
            name='left_ankle',
            id=15,
            color=[0, 255, 0],
            type='lower',
            swap='right_ankle'),
        16:
        dict(
            name='right_ankle',
            id=16,
            color=[255, 128, 0],
            type='lower',
            swap='left_ankle')
    }),
    skeleton_info=dict({
        0:
        dict(link=('left_ankle', 'left_knee'), id=0, color=[0, 255, 0]),
        1:
        dict(link=('left_knee', 'left_hip'), id=1, color=[0, 255, 0]),
        2:
        dict(link=('right_ankle', 'right_knee'), id=2, color=[255, 128, 0]),
        3:
        dict(link=('right_knee', 'right_hip'), id=3, color=[255, 128, 0]),
        4:
        dict(link=('left_hip', 'right_hip'), id=4, color=[51, 153, 255]),
        5:
        dict(link=('left_shoulder', 'left_hip'), id=5, color=[51, 153, 255]),
        6:
        dict(link=('right_shoulder', 'right_hip'), id=6, color=[51, 153, 255]),
        7:
        dict(
            link=('left_shoulder', 'right_shoulder'),
            id=7,
            color=[51, 153, 255]),
        8:
        dict(link=('left_shoulder', 'left_elbow'), id=8, color=[0, 255, 0]),
        9:
        dict(
            link=('right_shoulder', 'right_elbow'), id=9, color=[255, 128, 0]),
        10:
        dict(link=('left_elbow', 'left_wrist'), id=10, color=[0, 255, 0]),
        11:
        dict(link=('right_elbow', 'right_wrist'), id=11, color=[255, 128, 0]),
        12:
        dict(link=('left_eye', 'right_eye'), id=12, color=[51, 153, 255]),
        13:
        dict(link=('nose', 'left_eye'), id=13, color=[51, 153, 255]),
        14:
        dict(link=('nose', 'right_eye'), id=14, color=[51, 153, 255]),
        15:
        dict(link=('left_eye', 'left_ear'), id=15, color=[51, 153, 255]),
        16:
        dict(link=('right_eye', 'right_ear'), id=16, color=[51, 153, 255]),
        17:
        dict(link=('left_ear', 'left_shoulder'), id=17, color=[51, 153, 255]),
        18:
        dict(
            link=('right_ear', 'right_shoulder'), id=18, color=[51, 153, 255])
    }),
    joint_weights=[
        1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.5, 1.5, 1.0, 1.0, 1.2,
        1.2, 1.5, 1.5
    ],
    sigmas=[
        0.026, 0.025, 0.025, 0.035, 0.035, 0.079, 0.079, 0.072, 0.072, 0.062,
        0.062, 0.107, 0.107, 0.087, 0.087, 0.089, 0.089
    ])
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='PCK', save_best='PCK')
optimizer = dict(type='Adam', lr=0.0005)
optimizer_config = dict(grad_clip=None)
lr_config = dict(
    policy='step',
    warmup='linear',
    warmup_iters=500,
    warmup_ratio=0.001,
    step=[170, 200])
total_epochs = 40
log_config = dict(interval=1, hooks=[dict(type='TextLoggerHook')])
channel_cfg = dict(
    num_output_channels=17,
    dataset_joints=17,
    dataset_channel=[[
        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
    ]],
    inference_channel=[
        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
    ])
model = dict(
    type='TopDown',
    pretrained=
    'https://download.openmmlab.com/mmpose/pretrain_models/hrnet_w32-36af842e.pth',
    backbone=dict(
        type='HRNet',
        in_channels=3,
        extra=dict(
            stage1=dict(
                num_modules=1,
                num_branches=1,
                block='BOTTLENECK',
                num_blocks=(4, ),
                num_channels=(64, )),
            stage2=dict(
                num_modules=1,
                num_branches=2,
                block='BASIC',
                num_blocks=(4, 4),
                num_channels=(32, 64)),
            stage3=dict(
                num_modules=4,
                num_branches=3,
                block='BASIC',
                num_blocks=(4, 4, 4),
                num_channels=(32, 64, 128)),
            stage4=dict(
                num_modules=3,
                num_branches=4,
                block='BASIC',
                num_blocks=(4, 4, 4, 4),
                num_channels=(32, 64, 128, 256)))),
    keypoint_head=dict(
        type='TopdownHeatmapSimpleHead',
        in_channels=32,
        out_channels=17,
        num_deconv_layers=0,
        extra=dict(final_conv_kernel=1),
        loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)),
    train_cfg=dict(),
    test_cfg=dict(
        flip_test=True,
        post_process='default',
        shift_heatmap=True,
        modulate_kernel=11))
data_cfg = dict(
    image_size=[192, 256],
    heatmap_size=[48, 64],
    num_output_channels=17,
    num_joints=17,
    dataset_channel=[[
        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
    ]],
    inference_channel=[
        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
    ],
    soft_nms=False,
    nms_thr=1.0,
    oks_thr=0.9,
    vis_thr=0.2,
    use_gt_bbox=False,
    det_bbox_thr=0.0,
    bbox_file=
    'data/coco/person_detection_results/COCO_val2017_detections_AP_H_56_person.json'
)
train_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(type='TopDownRandomFlip', flip_prob=0.5),
    dict(
        type='TopDownHalfBodyTransform',
        num_joints_half_body=8,
        prob_half_body=0.3),
    dict(
        type='TopDownGetRandomScaleRotation', rot_factor=40, scale_factor=0.5),
    dict(type='TopDownAffine'),
    dict(type='ToTensor'),
    dict(
        type='NormalizeTensor',
        mean=[0.485, 0.456, 0.406],
        std=[0.229, 0.224, 0.225]),
    dict(type='TopDownGenerateTarget', sigma=2),
    dict(
        type='Collect',
        keys=['img', 'target', 'target_weight'],
        meta_keys=[
            'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale',
            'rotation', 'bbox_score', 'flip_pairs'
        ])
]
val_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(type='TopDownAffine'),
    dict(type='ToTensor'),
    dict(
        type='NormalizeTensor',
        mean=[0.485, 0.456, 0.406],
        std=[0.229, 0.224, 0.225]),
    dict(
        type='Collect',
        keys=['img'],
        meta_keys=[
            'image_file', 'center', 'scale', 'rotation', 'bbox_score',
            'flip_pairs'
        ])
]
test_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(type='TopDownAffine'),
    dict(type='ToTensor'),
    dict(
        type='NormalizeTensor',
        mean=[0.485, 0.456, 0.406],
        std=[0.229, 0.224, 0.225]),
    dict(
        type='Collect',
        keys=['img'],
        meta_keys=[
            'image_file', 'center', 'scale', 'rotation', 'bbox_score',
            'flip_pairs'
        ])
]
data_root = 'data/coco_tiny'
data = dict(
    samples_per_gpu=16,
    workers_per_gpu=2,
    val_dataloader=dict(samples_per_gpu=16),
    test_dataloader=dict(samples_per_gpu=16),
    train=dict(
        type='TopDownCOCOTinyDataset',
        ann_file='data/coco_tiny/train.json',
        img_prefix='data/coco_tiny/images/',
        data_cfg=dict(
            image_size=[192, 256],
            heatmap_size=[48, 64],
            num_output_channels=17,
            num_joints=17,
            dataset_channel=[[
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
            ]],
            inference_channel=[
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
            ],
            soft_nms=False,
            nms_thr=1.0,
            oks_thr=0.9,
            vis_thr=0.2,
            use_gt_bbox=False,
            det_bbox_thr=0.0,
            bbox_file=
            'data/coco/person_detection_results/COCO_val2017_detections_AP_H_56_person.json'
        ),
        pipeline=[
            dict(type='LoadImageFromFile'),
            dict(type='TopDownRandomFlip', flip_prob=0.5),
            dict(
                type='TopDownHalfBodyTransform',
                num_joints_half_body=8,
                prob_half_body=0.3),
            dict(
                type='TopDownGetRandomScaleRotation',
                rot_factor=40,
                scale_factor=0.5),
            dict(type='TopDownAffine'),
            dict(type='ToTensor'),
            dict(
                type='NormalizeTensor',
                mean=[0.485, 0.456, 0.406],
                std=[0.229, 0.224, 0.225]),
            dict(type='TopDownGenerateTarget', sigma=2),
            dict(
                type='Collect',
                keys=['img', 'target', 'target_weight'],
                meta_keys=[
                    'image_file', 'joints_3d', 'joints_3d_visible', 'center',
                    'scale', 'rotation', 'bbox_score', 'flip_pairs'
                ])
        ],
        dataset_info=dict(
            dataset_name='coco',
            paper_info=dict(
                author=
                'Lin, Tsung-Yi and Maire, Michael and Belongie, Serge and Hays, James and Perona, Pietro and Ramanan, Deva and Doll{\'a}r, Piotr and Zitnick, C Lawrence',
                title='Microsoft coco: Common objects in context',
                container='European conference on computer vision',
                year='2014',
                homepage='http://cocodataset.org/'),
            keypoint_info=dict({
                0:
                dict(
                    name='nose',
                    id=0,
                    color=[51, 153, 255],
                    type='upper',
                    swap=''),
                1:
                dict(
                    name='left_eye',
                    id=1,
                    color=[51, 153, 255],
                    type='upper',
                    swap='right_eye'),
                2:
                dict(
                    name='right_eye',
                    id=2,
                    color=[51, 153, 255],
                    type='upper',
                    swap='left_eye'),
                3:
                dict(
                    name='left_ear',
                    id=3,
                    color=[51, 153, 255],
                    type='upper',
                    swap='right_ear'),
                4:
                dict(
                    name='right_ear',
                    id=4,
                    color=[51, 153, 255],
                    type='upper',
                    swap='left_ear'),
                5:
                dict(
                    name='left_shoulder',
                    id=5,
                    color=[0, 255, 0],
                    type='upper',
                    swap='right_shoulder'),
                6:
                dict(
                    name='right_shoulder',
                    id=6,
                    color=[255, 128, 0],
                    type='upper',
                    swap='left_shoulder'),
                7:
                dict(
                    name='left_elbow',
                    id=7,
                    color=[0, 255, 0],
                    type='upper',
                    swap='right_elbow'),
                8:
                dict(
                    name='right_elbow',
                    id=8,
                    color=[255, 128, 0],
                    type='upper',
                    swap='left_elbow'),
                9:
                dict(
                    name='left_wrist',
                    id=9,
                    color=[0, 255, 0],
                    type='upper',
                    swap='right_wrist'),
                10:
                dict(
                    name='right_wrist',
                    id=10,
                    color=[255, 128, 0],
                    type='upper',
                    swap='left_wrist'),
                11:
                dict(
                    name='left_hip',
                    id=11,
                    color=[0, 255, 0],
                    type='lower',
                    swap='right_hip'),
                12:
                dict(
                    name='right_hip',
                    id=12,
                    color=[255, 128, 0],
                    type='lower',
                    swap='left_hip'),
                13:
                dict(
                    name='left_knee',
                    id=13,
                    color=[0, 255, 0],
                    type='lower',
                    swap='right_knee'),
                14:
                dict(
                    name='right_knee',
                    id=14,
                    color=[255, 128, 0],
                    type='lower',
                    swap='left_knee'),
                15:
                dict(
                    name='left_ankle',
                    id=15,
                    color=[0, 255, 0],
                    type='lower',
                    swap='right_ankle'),
                16:
                dict(
                    name='right_ankle',
                    id=16,
                    color=[255, 128, 0],
                    type='lower',
                    swap='left_ankle')
            }),
            skeleton_info=dict({
                0:
                dict(
                    link=('left_ankle', 'left_knee'), id=0, color=[0, 255, 0]),
                1:
                dict(link=('left_knee', 'left_hip'), id=1, color=[0, 255, 0]),
                2:
                dict(
                    link=('right_ankle', 'right_knee'),
                    id=2,
                    color=[255, 128, 0]),
                3:
                dict(
                    link=('right_knee', 'right_hip'),
                    id=3,
                    color=[255, 128, 0]),
                4:
                dict(
                    link=('left_hip', 'right_hip'), id=4, color=[51, 153,
                                                                 255]),
                5:
                dict(
                    link=('left_shoulder', 'left_hip'),
                    id=5,
                    color=[51, 153, 255]),
                6:
                dict(
                    link=('right_shoulder', 'right_hip'),
                    id=6,
                    color=[51, 153, 255]),
                7:
                dict(
                    link=('left_shoulder', 'right_shoulder'),
                    id=7,
                    color=[51, 153, 255]),
                8:
                dict(
                    link=('left_shoulder', 'left_elbow'),
                    id=8,
                    color=[0, 255, 0]),
                9:
                dict(
                    link=('right_shoulder', 'right_elbow'),
                    id=9,
                    color=[255, 128, 0]),
                10:
                dict(
                    link=('left_elbow', 'left_wrist'),
                    id=10,
                    color=[0, 255, 0]),
                11:
                dict(
                    link=('right_elbow', 'right_wrist'),
                    id=11,
                    color=[255, 128, 0]),
                12:
                dict(
                    link=('left_eye', 'right_eye'),
                    id=12,
                    color=[51, 153, 255]),
                13:
                dict(link=('nose', 'left_eye'), id=13, color=[51, 153, 255]),
                14:
                dict(link=('nose', 'right_eye'), id=14, color=[51, 153, 255]),
                15:
                dict(
                    link=('left_eye', 'left_ear'), id=15, color=[51, 153,
                                                                 255]),
                16:
                dict(
                    link=('right_eye', 'right_ear'),
                    id=16,
                    color=[51, 153, 255]),
                17:
                dict(
                    link=('left_ear', 'left_shoulder'),
                    id=17,
                    color=[51, 153, 255]),
                18:
                dict(
                    link=('right_ear', 'right_shoulder'),
                    id=18,
                    color=[51, 153, 255])
            }),
            joint_weights=[
                1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.5, 1.5, 1.0,
                1.0, 1.2, 1.2, 1.5, 1.5
            ],
            sigmas=[
                0.026, 0.025, 0.025, 0.035, 0.035, 0.079, 0.079, 0.072, 0.072,
                0.062, 0.062, 0.107, 0.107, 0.087, 0.087, 0.089, 0.089
            ])),
    val=dict(
        type='TopDownCOCOTinyDataset',
        ann_file='data/coco_tiny/val.json',
        img_prefix='data/coco_tiny/images/',
        data_cfg=dict(
            image_size=[192, 256],
            heatmap_size=[48, 64],
            num_output_channels=17,
            num_joints=17,
            dataset_channel=[[
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
            ]],
            inference_channel=[
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
            ],
            soft_nms=False,
            nms_thr=1.0,
            oks_thr=0.9,
            vis_thr=0.2,
            use_gt_bbox=False,
            det_bbox_thr=0.0,
            bbox_file=
            'data/coco/person_detection_results/COCO_val2017_detections_AP_H_56_person.json'
        ),
        pipeline=[
            dict(type='LoadImageFromFile'),
            dict(type='TopDownAffine'),
            dict(type='ToTensor'),
            dict(
                type='NormalizeTensor',
                mean=[0.485, 0.456, 0.406],
                std=[0.229, 0.224, 0.225]),
            dict(
                type='Collect',
                keys=['img'],
                meta_keys=[
                    'image_file', 'center', 'scale', 'rotation', 'bbox_score',
                    'flip_pairs'
                ])
        ],
        dataset_info=dict(
            dataset_name='coco',
            paper_info=dict(
                author=
                'Lin, Tsung-Yi and Maire, Michael and Belongie, Serge and Hays, James and Perona, Pietro and Ramanan, Deva and Doll{\'a}r, Piotr and Zitnick, C Lawrence',
                title='Microsoft coco: Common objects in context',
                container='European conference on computer vision',
                year='2014',
                homepage='http://cocodataset.org/'),
            keypoint_info=dict({
                0:
                dict(
                    name='nose',
                    id=0,
                    color=[51, 153, 255],
                    type='upper',
                    swap=''),
                1:
                dict(
                    name='left_eye',
                    id=1,
                    color=[51, 153, 255],
                    type='upper',
                    swap='right_eye'),
                2:
                dict(
                    name='right_eye',
                    id=2,
                    color=[51, 153, 255],
                    type='upper',
                    swap='left_eye'),
                3:
                dict(
                    name='left_ear',
                    id=3,
                    color=[51, 153, 255],
                    type='upper',
                    swap='right_ear'),
                4:
                dict(
                    name='right_ear',
                    id=4,
                    color=[51, 153, 255],
                    type='upper',
                    swap='left_ear'),
                5:
                dict(
                    name='left_shoulder',
                    id=5,
                    color=[0, 255, 0],
                    type='upper',
                    swap='right_shoulder'),
                6:
                dict(
                    name='right_shoulder',
                    id=6,
                    color=[255, 128, 0],
                    type='upper',
                    swap='left_shoulder'),
                7:
                dict(
                    name='left_elbow',
                    id=7,
                    color=[0, 255, 0],
                    type='upper',
                    swap='right_elbow'),
                8:
                dict(
                    name='right_elbow',
                    id=8,
                    color=[255, 128, 0],
                    type='upper',
                    swap='left_elbow'),
                9:
                dict(
                    name='left_wrist',
                    id=9,
                    color=[0, 255, 0],
                    type='upper',
                    swap='right_wrist'),
                10:
                dict(
                    name='right_wrist',
                    id=10,
                    color=[255, 128, 0],
                    type='upper',
                    swap='left_wrist'),
                11:
                dict(
                    name='left_hip',
                    id=11,
                    color=[0, 255, 0],
                    type='lower',
                    swap='right_hip'),
                12:
                dict(
                    name='right_hip',
                    id=12,
                    color=[255, 128, 0],
                    type='lower',
                    swap='left_hip'),
                13:
                dict(
                    name='left_knee',
                    id=13,
                    color=[0, 255, 0],
                    type='lower',
                    swap='right_knee'),
                14:
                dict(
                    name='right_knee',
                    id=14,
                    color=[255, 128, 0],
                    type='lower',
                    swap='left_knee'),
                15:
                dict(
                    name='left_ankle',
                    id=15,
                    color=[0, 255, 0],
                    type='lower',
                    swap='right_ankle'),
                16:
                dict(
                    name='right_ankle',
                    id=16,
                    color=[255, 128, 0],
                    type='lower',
                    swap='left_ankle')
            }),
            skeleton_info=dict({
                0:
                dict(
                    link=('left_ankle', 'left_knee'), id=0, color=[0, 255, 0]),
                1:
                dict(link=('left_knee', 'left_hip'), id=1, color=[0, 255, 0]),
                2:
                dict(
                    link=('right_ankle', 'right_knee'),
                    id=2,
                    color=[255, 128, 0]),
                3:
                dict(
                    link=('right_knee', 'right_hip'),
                    id=3,
                    color=[255, 128, 0]),
                4:
                dict(
                    link=('left_hip', 'right_hip'), id=4, color=[51, 153,
                                                                 255]),
                5:
                dict(
                    link=('left_shoulder', 'left_hip'),
                    id=5,
                    color=[51, 153, 255]),
                6:
                dict(
                    link=('right_shoulder', 'right_hip'),
                    id=6,
                    color=[51, 153, 255]),
                7:
                dict(
                    link=('left_shoulder', 'right_shoulder'),
                    id=7,
                    color=[51, 153, 255]),
                8:
                dict(
                    link=('left_shoulder', 'left_elbow'),
                    id=8,
                    color=[0, 255, 0]),
                9:
                dict(
                    link=('right_shoulder', 'right_elbow'),
                    id=9,
                    color=[255, 128, 0]),
                10:
                dict(
                    link=('left_elbow', 'left_wrist'),
                    id=10,
                    color=[0, 255, 0]),
                11:
                dict(
                    link=('right_elbow', 'right_wrist'),
                    id=11,
                    color=[255, 128, 0]),
                12:
                dict(
                    link=('left_eye', 'right_eye'),
                    id=12,
                    color=[51, 153, 255]),
                13:
                dict(link=('nose', 'left_eye'), id=13, color=[51, 153, 255]),
                14:
                dict(link=('nose', 'right_eye'), id=14, color=[51, 153, 255]),
                15:
                dict(
                    link=('left_eye', 'left_ear'), id=15, color=[51, 153,
                                                                 255]),
                16:
                dict(
                    link=('right_eye', 'right_ear'),
                    id=16,
                    color=[51, 153, 255]),
                17:
                dict(
                    link=('left_ear', 'left_shoulder'),
                    id=17,
                    color=[51, 153, 255]),
                18:
                dict(
                    link=('right_ear', 'right_shoulder'),
                    id=18,
                    color=[51, 153, 255])
            }),
            joint_weights=[
                1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.5, 1.5, 1.0,
                1.0, 1.2, 1.2, 1.5, 1.5
            ],
            sigmas=[
                0.026, 0.025, 0.025, 0.035, 0.035, 0.079, 0.079, 0.072, 0.072,
                0.062, 0.062, 0.107, 0.107, 0.087, 0.087, 0.089, 0.089
            ])),
    test=dict(
        type='TopDownCOCOTinyDataset',
        ann_file='data/coco_tiny/val.json',
        img_prefix='data/coco_tiny/images/',
        data_cfg=dict(
            image_size=[192, 256],
            heatmap_size=[48, 64],
            num_output_channels=17,
            num_joints=17,
            dataset_channel=[[
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
            ]],
            inference_channel=[
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
            ],
            soft_nms=False,
            nms_thr=1.0,
            oks_thr=0.9,
            vis_thr=0.2,
            use_gt_bbox=False,
            det_bbox_thr=0.0,
            bbox_file=
            'data/coco/person_detection_results/COCO_val2017_detections_AP_H_56_person.json'
        ),
        pipeline=[
            dict(type='LoadImageFromFile'),
            dict(type='TopDownAffine'),
            dict(type='ToTensor'),
            dict(
                type='NormalizeTensor',
                mean=[0.485, 0.456, 0.406],
                std=[0.229, 0.224, 0.225]),
            dict(
                type='Collect',
                keys=['img'],
                meta_keys=[
                    'image_file', 'center', 'scale', 'rotation', 'bbox_score',
                    'flip_pairs'
                ])
        ],
        dataset_info=dict(
            dataset_name='coco',
            paper_info=dict(
                author=
                'Lin, Tsung-Yi and Maire, Michael and Belongie, Serge and Hays, James and Perona, Pietro and Ramanan, Deva and Doll{\'a}r, Piotr and Zitnick, C Lawrence',
                title='Microsoft coco: Common objects in context',
                container='European conference on computer vision',
                year='2014',
                homepage='http://cocodataset.org/'),
            keypoint_info=dict({
                0:
                dict(
                    name='nose',
                    id=0,
                    color=[51, 153, 255],
                    type='upper',
                    swap=''),
                1:
                dict(
                    name='left_eye',
                    id=1,
                    color=[51, 153, 255],
                    type='upper',
                    swap='right_eye'),
                2:
                dict(
                    name='right_eye',
                    id=2,
                    color=[51, 153, 255],
                    type='upper',
                    swap='left_eye'),
                3:
                dict(
                    name='left_ear',
                    id=3,
                    color=[51, 153, 255],
                    type='upper',
                    swap='right_ear'),
                4:
                dict(
                    name='right_ear',
                    id=4,
                    color=[51, 153, 255],
                    type='upper',
                    swap='left_ear'),
                5:
                dict(
                    name='left_shoulder',
                    id=5,
                    color=[0, 255, 0],
                    type='upper',
                    swap='right_shoulder'),
                6:
                dict(
                    name='right_shoulder',
                    id=6,
                    color=[255, 128, 0],
                    type='upper',
                    swap='left_shoulder'),
                7:
                dict(
                    name='left_elbow',
                    id=7,
                    color=[0, 255, 0],
                    type='upper',
                    swap='right_elbow'),
                8:
                dict(
                    name='right_elbow',
                    id=8,
                    color=[255, 128, 0],
                    type='upper',
                    swap='left_elbow'),
                9:
                dict(
                    name='left_wrist',
                    id=9,
                    color=[0, 255, 0],
                    type='upper',
                    swap='right_wrist'),
                10:
                dict(
                    name='right_wrist',
                    id=10,
                    color=[255, 128, 0],
                    type='upper',
                    swap='left_wrist'),
                11:
                dict(
                    name='left_hip',
                    id=11,
                    color=[0, 255, 0],
                    type='lower',
                    swap='right_hip'),
                12:
                dict(
                    name='right_hip',
                    id=12,
                    color=[255, 128, 0],
                    type='lower',
                    swap='left_hip'),
                13:
                dict(
                    name='left_knee',
                    id=13,
                    color=[0, 255, 0],
                    type='lower',
                    swap='right_knee'),
                14:
                dict(
                    name='right_knee',
                    id=14,
                    color=[255, 128, 0],
                    type='lower',
                    swap='left_knee'),
                15:
                dict(
                    name='left_ankle',
                    id=15,
                    color=[0, 255, 0],
                    type='lower',
                    swap='right_ankle'),
                16:
                dict(
                    name='right_ankle',
                    id=16,
                    color=[255, 128, 0],
                    type='lower',
                    swap='left_ankle')
            }),
            skeleton_info=dict({
                0:
                dict(
                    link=('left_ankle', 'left_knee'), id=0, color=[0, 255, 0]),
                1:
                dict(link=('left_knee', 'left_hip'), id=1, color=[0, 255, 0]),
                2:
                dict(
                    link=('right_ankle', 'right_knee'),
                    id=2,
                    color=[255, 128, 0]),
                3:
                dict(
                    link=('right_knee', 'right_hip'),
                    id=3,
                    color=[255, 128, 0]),
                4:
                dict(
                    link=('left_hip', 'right_hip'), id=4, color=[51, 153,
                                                                 255]),
                5:
                dict(
                    link=('left_shoulder', 'left_hip'),
                    id=5,
                    color=[51, 153, 255]),
                6:
                dict(
                    link=('right_shoulder', 'right_hip'),
                    id=6,
                    color=[51, 153, 255]),
                7:
                dict(
                    link=('left_shoulder', 'right_shoulder'),
                    id=7,
                    color=[51, 153, 255]),
                8:
                dict(
                    link=('left_shoulder', 'left_elbow'),
                    id=8,
                    color=[0, 255, 0]),
                9:
                dict(
                    link=('right_shoulder', 'right_elbow'),
                    id=9,
                    color=[255, 128, 0]),
                10:
                dict(
                    link=('left_elbow', 'left_wrist'),
                    id=10,
                    color=[0, 255, 0]),
                11:
                dict(
                    link=('right_elbow', 'right_wrist'),
                    id=11,
                    color=[255, 128, 0]),
                12:
                dict(
                    link=('left_eye', 'right_eye'),
                    id=12,
                    color=[51, 153, 255]),
                13:
                dict(link=('nose', 'left_eye'), id=13, color=[51, 153, 255]),
                14:
                dict(link=('nose', 'right_eye'), id=14, color=[51, 153, 255]),
                15:
                dict(
                    link=('left_eye', 'left_ear'), id=15, color=[51, 153,
                                                                 255]),
                16:
                dict(
                    link=('right_eye', 'right_ear'),
                    id=16,
                    color=[51, 153, 255]),
                17:
                dict(
                    link=('left_ear', 'left_shoulder'),
                    id=17,
                    color=[51, 153, 255]),
                18:
                dict(
                    link=('right_ear', 'right_shoulder'),
                    id=18,
                    color=[51, 153, 255])
            }),
            joint_weights=[
                1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.5, 1.5, 1.0,
                1.0, 1.2, 1.2, 1.5, 1.5
            ],
            sigmas=[
                0.026, 0.025, 0.025, 0.035, 0.035, 0.079, 0.079, 0.072, 0.072,
                0.062, 0.062, 0.107, 0.107, 0.087, 0.087, 0.089, 0.089
            ])))
work_dir = 'work_dirs/hrnet_w32_coco_tiny_256x192'
gpu_ids = range(0, 1)
seed = 0

Train and Evaluation
from mmpose.datasets import build_dataset
from mmpose.models import build_posenet
from mmpose.apis import train_model
import mmcv

# build dataset
datasets = [build_dataset(cfg.data.train)]

# build model
model = build_posenet(cfg.model)

# create work_dir
mmcv.mkdir_or_exist(cfg.work_dir)

# train model
train_model(
    model, datasets, cfg, distributed=False, validate=True, meta=dict())
Use load_from_http loader
Downloading: "https://download.openmmlab.com/mmpose/pretrain_models/hrnet_w32-36af842e.pth" to /home/PJLAB/liyining/.cache/torch/hub/checkpoints/hrnet_w32-36af842e.pth
  0%|          | 0.00/126M [00:00<?, ?B/s]
2021-09-22 22:37:43,193 - mmpose - WARNING - The model and loaded state dict do not match exactly

unexpected key in source state_dict: head.0.0.0.conv1.weight, head.0.0.0.bn1.weight, head.0.0.0.bn1.bias, head.0.0.0.bn1.running_mean, head.0.0.0.bn1.running_var, head.0.0.0.bn1.num_batches_tracked, head.0.0.0.conv2.weight, head.0.0.0.bn2.weight, head.0.0.0.bn2.bias, head.0.0.0.bn2.running_mean, head.0.0.0.bn2.running_var, head.0.0.0.bn2.num_batches_tracked, head.0.0.0.conv3.weight, head.0.0.0.bn3.weight, head.0.0.0.bn3.bias, head.0.0.0.bn3.running_mean, head.0.0.0.bn3.running_var, head.0.0.0.bn3.num_batches_tracked, head.0.0.0.downsample.0.weight, head.0.0.0.downsample.1.weight, head.0.0.0.downsample.1.bias, head.0.0.0.downsample.1.running_mean, head.0.0.0.downsample.1.running_var, head.0.0.0.downsample.1.num_batches_tracked, head.0.1.0.conv1.weight, head.0.1.0.bn1.weight, head.0.1.0.bn1.bias, head.0.1.0.bn1.running_mean, head.0.1.0.bn1.running_var, head.0.1.0.bn1.num_batches_tracked, head.0.1.0.conv2.weight, head.0.1.0.bn2.weight, head.0.1.0.bn2.bias, head.0.1.0.bn2.running_mean, head.0.1.0.bn2.running_var, head.0.1.0.bn2.num_batches_tracked, head.0.1.0.conv3.weight, head.0.1.0.bn3.weight, head.0.1.0.bn3.bias, head.0.1.0.bn3.running_mean, head.0.1.0.bn3.running_var, head.0.1.0.bn3.num_batches_tracked, head.0.1.0.downsample.0.weight, head.0.1.0.downsample.1.weight, head.0.1.0.downsample.1.bias, head.0.1.0.downsample.1.running_mean, head.0.1.0.downsample.1.running_var, head.0.1.0.downsample.1.num_batches_tracked, head.0.2.0.conv1.weight, head.0.2.0.bn1.weight, head.0.2.0.bn1.bias, head.0.2.0.bn1.running_mean, head.0.2.0.bn1.running_var, head.0.2.0.bn1.num_batches_tracked, head.0.2.0.conv2.weight, head.0.2.0.bn2.weight, head.0.2.0.bn2.bias, head.0.2.0.bn2.running_mean, head.0.2.0.bn2.running_var, head.0.2.0.bn2.num_batches_tracked, head.0.2.0.conv3.weight, head.0.2.0.bn3.weight, head.0.2.0.bn3.bias, head.0.2.0.bn3.running_mean, head.0.2.0.bn3.running_var, head.0.2.0.bn3.num_batches_tracked, head.0.2.0.downsample.0.weight, head.0.2.0.downsample.1.weight, head.0.2.0.downsample.1.bias, head.0.2.0.downsample.1.running_mean, head.0.2.0.downsample.1.running_var, head.0.2.0.downsample.1.num_batches_tracked, head.1.0.0.conv1.weight, head.1.0.0.bn1.weight, head.1.0.0.bn1.bias, head.1.0.0.bn1.running_mean, head.1.0.0.bn1.running_var, head.1.0.0.bn1.num_batches_tracked, head.1.0.0.conv2.weight, head.1.0.0.bn2.weight, head.1.0.0.bn2.bias, head.1.0.0.bn2.running_mean, head.1.0.0.bn2.running_var, head.1.0.0.bn2.num_batches_tracked, head.1.0.0.conv3.weight, head.1.0.0.bn3.weight, head.1.0.0.bn3.bias, head.1.0.0.bn3.running_mean, head.1.0.0.bn3.running_var, head.1.0.0.bn3.num_batches_tracked, head.1.0.0.downsample.0.weight, head.1.0.0.downsample.1.weight, head.1.0.0.downsample.1.bias, head.1.0.0.downsample.1.running_mean, head.1.0.0.downsample.1.running_var, head.1.0.0.downsample.1.num_batches_tracked, head.1.1.0.conv1.weight, head.1.1.0.bn1.weight, head.1.1.0.bn1.bias, head.1.1.0.bn1.running_mean, head.1.1.0.bn1.running_var, head.1.1.0.bn1.num_batches_tracked, head.1.1.0.conv2.weight, head.1.1.0.bn2.weight, head.1.1.0.bn2.bias, head.1.1.0.bn2.running_mean, head.1.1.0.bn2.running_var, head.1.1.0.bn2.num_batches_tracked, head.1.1.0.conv3.weight, head.1.1.0.bn3.weight, head.1.1.0.bn3.bias, head.1.1.0.bn3.running_mean, head.1.1.0.bn3.running_var, head.1.1.0.bn3.num_batches_tracked, head.1.1.0.downsample.0.weight, head.1.1.0.downsample.1.weight, head.1.1.0.downsample.1.bias, head.1.1.0.downsample.1.running_mean, head.1.1.0.downsample.1.running_var, head.1.1.0.downsample.1.num_batches_tracked, head.2.0.0.conv1.weight, head.2.0.0.bn1.weight, head.2.0.0.bn1.bias, head.2.0.0.bn1.running_mean, head.2.0.0.bn1.running_var, head.2.0.0.bn1.num_batches_tracked, head.2.0.0.conv2.weight, head.2.0.0.bn2.weight, head.2.0.0.bn2.bias, head.2.0.0.bn2.running_mean, head.2.0.0.bn2.running_var, head.2.0.0.bn2.num_batches_tracked, head.2.0.0.conv3.weight, head.2.0.0.bn3.weight, head.2.0.0.bn3.bias, head.2.0.0.bn3.running_mean, head.2.0.0.bn3.running_var, head.2.0.0.bn3.num_batches_tracked, head.2.0.0.downsample.0.weight, head.2.0.0.downsample.1.weight, head.2.0.0.downsample.1.bias, head.2.0.0.downsample.1.running_mean, head.2.0.0.downsample.1.running_var, head.2.0.0.downsample.1.num_batches_tracked, head.3.0.0.conv1.weight, head.3.0.0.bn1.weight, head.3.0.0.bn1.bias, head.3.0.0.bn1.running_mean, head.3.0.0.bn1.running_var, head.3.0.0.bn1.num_batches_tracked, head.3.0.0.conv2.weight, head.3.0.0.bn2.weight, head.3.0.0.bn2.bias, head.3.0.0.bn2.running_mean, head.3.0.0.bn2.running_var, head.3.0.0.bn2.num_batches_tracked, head.3.0.0.conv3.weight, head.3.0.0.bn3.weight, head.3.0.0.bn3.bias, head.3.0.0.bn3.running_mean, head.3.0.0.bn3.running_var, head.3.0.0.bn3.num_batches_tracked, head.3.0.0.downsample.0.weight, head.3.0.0.downsample.1.weight, head.3.0.0.downsample.1.bias, head.3.0.0.downsample.1.running_mean, head.3.0.0.downsample.1.running_var, head.3.0.0.downsample.1.num_batches_tracked, fc.weight, fc.bias, stage4.2.fuse_layers.1.0.0.0.weight, stage4.2.fuse_layers.1.0.0.1.weight, stage4.2.fuse_layers.1.0.0.1.bias, stage4.2.fuse_layers.1.0.0.1.running_mean, stage4.2.fuse_layers.1.0.0.1.running_var, stage4.2.fuse_layers.1.0.0.1.num_batches_tracked, stage4.2.fuse_layers.1.2.0.weight, stage4.2.fuse_layers.1.2.1.weight, stage4.2.fuse_layers.1.2.1.bias, stage4.2.fuse_layers.1.2.1.running_mean, stage4.2.fuse_layers.1.2.1.running_var, stage4.2.fuse_layers.1.2.1.num_batches_tracked, stage4.2.fuse_layers.1.3.0.weight, stage4.2.fuse_layers.1.3.1.weight, stage4.2.fuse_layers.1.3.1.bias, stage4.2.fuse_layers.1.3.1.running_mean, stage4.2.fuse_layers.1.3.1.running_var, stage4.2.fuse_layers.1.3.1.num_batches_tracked, stage4.2.fuse_layers.2.0.0.0.weight, stage4.2.fuse_layers.2.0.0.1.weight, stage4.2.fuse_layers.2.0.0.1.bias, stage4.2.fuse_layers.2.0.0.1.running_mean, stage4.2.fuse_layers.2.0.0.1.running_var, stage4.2.fuse_layers.2.0.0.1.num_batches_tracked, stage4.2.fuse_layers.2.0.1.0.weight, stage4.2.fuse_layers.2.0.1.1.weight, stage4.2.fuse_layers.2.0.1.1.bias, stage4.2.fuse_layers.2.0.1.1.running_mean, stage4.2.fuse_layers.2.0.1.1.running_var, stage4.2.fuse_layers.2.0.1.1.num_batches_tracked, stage4.2.fuse_layers.2.1.0.0.weight, stage4.2.fuse_layers.2.1.0.1.weight, stage4.2.fuse_layers.2.1.0.1.bias, stage4.2.fuse_layers.2.1.0.1.running_mean, stage4.2.fuse_layers.2.1.0.1.running_var, stage4.2.fuse_layers.2.1.0.1.num_batches_tracked, stage4.2.fuse_layers.2.3.0.weight, stage4.2.fuse_layers.2.3.1.weight, stage4.2.fuse_layers.2.3.1.bias, stage4.2.fuse_layers.2.3.1.running_mean, stage4.2.fuse_layers.2.3.1.running_var, stage4.2.fuse_layers.2.3.1.num_batches_tracked, stage4.2.fuse_layers.3.0.0.0.weight, stage4.2.fuse_layers.3.0.0.1.weight, stage4.2.fuse_layers.3.0.0.1.bias, stage4.2.fuse_layers.3.0.0.1.running_mean, stage4.2.fuse_layers.3.0.0.1.running_var, stage4.2.fuse_layers.3.0.0.1.num_batches_tracked, stage4.2.fuse_layers.3.0.1.0.weight, stage4.2.fuse_layers.3.0.1.1.weight, stage4.2.fuse_layers.3.0.1.1.bias, stage4.2.fuse_layers.3.0.1.1.running_mean, stage4.2.fuse_layers.3.0.1.1.running_var, stage4.2.fuse_layers.3.0.1.1.num_batches_tracked, stage4.2.fuse_layers.3.0.2.0.weight, stage4.2.fuse_layers.3.0.2.1.weight, stage4.2.fuse_layers.3.0.2.1.bias, stage4.2.fuse_layers.3.0.2.1.running_mean, stage4.2.fuse_layers.3.0.2.1.running_var, stage4.2.fuse_layers.3.0.2.1.num_batches_tracked, stage4.2.fuse_layers.3.1.0.0.weight, stage4.2.fuse_layers.3.1.0.1.weight, stage4.2.fuse_layers.3.1.0.1.bias, stage4.2.fuse_layers.3.1.0.1.running_mean, stage4.2.fuse_layers.3.1.0.1.running_var, stage4.2.fuse_layers.3.1.0.1.num_batches_tracked, stage4.2.fuse_layers.3.1.1.0.weight, stage4.2.fuse_layers.3.1.1.1.weight, stage4.2.fuse_layers.3.1.1.1.bias, stage4.2.fuse_layers.3.1.1.1.running_mean, stage4.2.fuse_layers.3.1.1.1.running_var, stage4.2.fuse_layers.3.1.1.1.num_batches_tracked, stage4.2.fuse_layers.3.2.0.0.weight, stage4.2.fuse_layers.3.2.0.1.weight, stage4.2.fuse_layers.3.2.0.1.bias, stage4.2.fuse_layers.3.2.0.1.running_mean, stage4.2.fuse_layers.3.2.0.1.running_var, stage4.2.fuse_layers.3.2.0.1.num_batches_tracked

2021-09-22 22:37:46,021 - mmpose - INFO - Start running, host: PJLAB\liyining@shai14000065l, work_dir: /home/PJLAB/liyining/openmmlab/mmpose/work_dirs/hrnet_w32_coco_tiny_256x192
2021-09-22 22:37:46,021 - mmpose - INFO - Hooks will be executed in the following order:
before_run:
(VERY_HIGH   ) StepLrUpdaterHook                  
(NORMAL      ) CheckpointHook                     
(NORMAL      ) EvalHook                           
(VERY_LOW    ) TextLoggerHook                     
 -------------------- 
before_train_epoch:
(VERY_HIGH   ) StepLrUpdaterHook                  
(NORMAL      ) EvalHook                           
(LOW         ) IterTimerHook                      
(VERY_LOW    ) TextLoggerHook                     
 -------------------- 
before_train_iter:
(VERY_HIGH   ) StepLrUpdaterHook                  
(NORMAL      ) EvalHook                           
(LOW         ) IterTimerHook                      
 -------------------- 
after_train_iter:
(ABOVE_NORMAL) OptimizerHook                      
(NORMAL      ) CheckpointHook                     
(NORMAL      ) EvalHook                           
(LOW         ) IterTimerHook                      
(VERY_LOW    ) TextLoggerHook                     
 -------------------- 
after_train_epoch:
(NORMAL      ) CheckpointHook                     
(NORMAL      ) EvalHook                           
(VERY_LOW    ) TextLoggerHook                     
 -------------------- 
before_val_epoch:
(LOW         ) IterTimerHook                      
(VERY_LOW    ) TextLoggerHook                     
 -------------------- 
before_val_iter:
(LOW         ) IterTimerHook                      
 -------------------- 
after_val_iter:
(LOW         ) IterTimerHook                      
 -------------------- 
after_val_epoch:
(VERY_LOW    ) TextLoggerHook                     
 -------------------- 
2021-09-22 22:37:46,022 - mmpose - INFO - workflow: [('train', 1)], max: 40 epochs
2021-09-22 22:37:48,774 - mmpose - INFO - Epoch [1][1/4]	lr: 5.000e-07, eta: 0:07:17, time: 2.749, data_time: 2.287, memory: 2594, mse_loss: 0.0020, acc_pose: 0.0000, loss: 0.0020
2021-09-22 22:37:49,164 - mmpose - INFO - Epoch [1][2/4]	lr: 1.499e-06, eta: 0:04:08, time: 0.391, data_time: 0.002, memory: 2903, mse_loss: 0.0025, acc_pose: 0.0152, loss: 0.0025
2021-09-22 22:37:49,549 - mmpose - INFO - Epoch [1][3/4]	lr: 2.498e-06, eta: 0:03:04, time: 0.385, data_time: 0.001, memory: 2903, mse_loss: 0.0019, acc_pose: 0.0270, loss: 0.0019
2021-09-22 22:37:49,937 - mmpose - INFO - Epoch [1][4/4]	lr: 3.497e-06, eta: 0:02:32, time: 0.388, data_time: 0.002, memory: 2903, mse_loss: 0.0020, acc_pose: 0.0104, loss: 0.0020
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:37:52,650 - mmpose - INFO - Epoch [2][1/4]	lr: 4.496e-06, eta: 0:03:23, time: 2.656, data_time: 2.263, memory: 2903, mse_loss: 0.0024, acc_pose: 0.0206, loss: 0.0024
2021-09-22 22:37:53,025 - mmpose - INFO - Epoch [2][2/4]	lr: 5.495e-06, eta: 0:02:58, time: 0.375, data_time: 0.001, memory: 2903, mse_loss: 0.0022, acc_pose: 0.0331, loss: 0.0022
2021-09-22 22:37:53,395 - mmpose - INFO - Epoch [2][3/4]	lr: 6.494e-06, eta: 0:02:39, time: 0.371, data_time: 0.001, memory: 2903, mse_loss: 0.0023, acc_pose: 0.0065, loss: 0.0023
2021-09-22 22:37:53,770 - mmpose - INFO - Epoch [2][4/4]	lr: 7.493e-06, eta: 0:02:26, time: 0.375, data_time: 0.001, memory: 2903, mse_loss: 0.0020, acc_pose: 0.0143, loss: 0.0020
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:37:56,509 - mmpose - INFO - Epoch [3][1/4]	lr: 8.492e-06, eta: 0:02:54, time: 2.685, data_time: 2.248, memory: 2903, mse_loss: 0.0023, acc_pose: 0.0183, loss: 0.0023
2021-09-22 22:37:56,902 - mmpose - INFO - Epoch [3][2/4]	lr: 9.491e-06, eta: 0:02:41, time: 0.393, data_time: 0.001, memory: 2903, mse_loss: 0.0020, acc_pose: 0.0334, loss: 0.0020
2021-09-22 22:37:57,269 - mmpose - INFO - Epoch [3][3/4]	lr: 1.049e-05, eta: 0:02:30, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0017, acc_pose: 0.0139, loss: 0.0017
2021-09-22 22:37:57,632 - mmpose - INFO - Epoch [3][4/4]	lr: 1.149e-05, eta: 0:02:21, time: 0.363, data_time: 0.001, memory: 2903, mse_loss: 0.0022, acc_pose: 0.0119, loss: 0.0022
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:00,246 - mmpose - INFO - Epoch [4][1/4]	lr: 1.249e-05, eta: 0:02:38, time: 2.552, data_time: 2.207, memory: 2903, mse_loss: 0.0023, acc_pose: 0.0152, loss: 0.0023
2021-09-22 22:38:00,579 - mmpose - INFO - Epoch [4][2/4]	lr: 1.349e-05, eta: 0:02:29, time: 0.333, data_time: 0.002, memory: 2903, mse_loss: 0.0019, acc_pose: 0.0250, loss: 0.0019
2021-09-22 22:38:00,946 - mmpose - INFO - Epoch [4][3/4]	lr: 1.449e-05, eta: 0:02:22, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0025, acc_pose: 0.0127, loss: 0.0025
2021-09-22 22:38:01,309 - mmpose - INFO - Epoch [4][4/4]	lr: 1.549e-05, eta: 0:02:16, time: 0.363, data_time: 0.001, memory: 2903, mse_loss: 0.0020, acc_pose: 0.0310, loss: 0.0020
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:03,971 - mmpose - INFO - Epoch [5][1/4]	lr: 1.648e-05, eta: 0:02:29, time: 2.618, data_time: 2.265, memory: 2903, mse_loss: 0.0024, acc_pose: 0.0264, loss: 0.0024
2021-09-22 22:38:04,319 - mmpose - INFO - Epoch [5][2/4]	lr: 1.748e-05, eta: 0:02:22, time: 0.348, data_time: 0.001, memory: 2903, mse_loss: 0.0017, acc_pose: 0.0147, loss: 0.0017
2021-09-22 22:38:04,672 - mmpose - INFO - Epoch [5][3/4]	lr: 1.848e-05, eta: 0:02:16, time: 0.354, data_time: 0.002, memory: 2903, mse_loss: 0.0020, acc_pose: 0.0065, loss: 0.0020
2021-09-22 22:38:05,062 - mmpose - INFO - Epoch [5][4/4]	lr: 1.948e-05, eta: 0:02:11, time: 0.390, data_time: 0.001, memory: 2903, mse_loss: 0.0023, acc_pose: 0.0168, loss: 0.0023
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:07,651 - mmpose - INFO - Epoch [6][1/4]	lr: 2.048e-05, eta: 0:02:21, time: 2.546, data_time: 2.202, memory: 2903, mse_loss: 0.0009, acc_pose: 0.0095, loss: 0.0009
2021-09-22 22:38:07,981 - mmpose - INFO - Epoch [6][2/4]	lr: 2.148e-05, eta: 0:02:16, time: 0.330, data_time: 0.002, memory: 2903, mse_loss: 0.0025, acc_pose: 0.0225, loss: 0.0025
2021-09-22 22:38:08,311 - mmpose - INFO - Epoch [6][3/4]	lr: 2.248e-05, eta: 0:02:11, time: 0.330, data_time: 0.001, memory: 2903, mse_loss: 0.0025, acc_pose: 0.0266, loss: 0.0025
2021-09-22 22:38:08,638 - mmpose - INFO - Epoch [6][4/4]	lr: 2.348e-05, eta: 0:02:06, time: 0.327, data_time: 0.001, memory: 2903, mse_loss: 0.0023, acc_pose: 0.0281, loss: 0.0023
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:11,310 - mmpose - INFO - Epoch [7][1/4]	lr: 2.448e-05, eta: 0:02:14, time: 2.614, data_time: 2.220, memory: 2903, mse_loss: 0.0022, acc_pose: 0.0202, loss: 0.0022
2021-09-22 22:38:11,678 - mmpose - INFO - Epoch [7][2/4]	lr: 2.548e-05, eta: 0:02:10, time: 0.368, data_time: 0.002, memory: 2903, mse_loss: 0.0018, acc_pose: 0.0059, loss: 0.0018
2021-09-22 22:38:12,049 - mmpose - INFO - Epoch [7][3/4]	lr: 2.647e-05, eta: 0:02:06, time: 0.371, data_time: 0.002, memory: 2903, mse_loss: 0.0019, acc_pose: 0.0231, loss: 0.0019
2021-09-22 22:38:12,418 - mmpose - INFO - Epoch [7][4/4]	lr: 2.747e-05, eta: 0:02:02, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0018, acc_pose: 0.0564, loss: 0.0018
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:15,087 - mmpose - INFO - Epoch [8][1/4]	lr: 2.847e-05, eta: 0:02:09, time: 2.617, data_time: 2.224, memory: 2903, mse_loss: 0.0019, acc_pose: 0.0576, loss: 0.0019
2021-09-22 22:38:15,457 - mmpose - INFO - Epoch [8][2/4]	lr: 2.947e-05, eta: 0:02:05, time: 0.370, data_time: 0.002, memory: 2903, mse_loss: 0.0022, acc_pose: 0.0451, loss: 0.0022
2021-09-22 22:38:15,824 - mmpose - INFO - Epoch [8][3/4]	lr: 3.047e-05, eta: 0:02:02, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0021, acc_pose: 0.0161, loss: 0.0021
2021-09-22 22:38:16,191 - mmpose - INFO - Epoch [8][4/4]	lr: 3.147e-05, eta: 0:01:59, time: 0.367, data_time: 0.002, memory: 2903, mse_loss: 0.0024, acc_pose: 0.0953, loss: 0.0024
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:18,866 - mmpose - INFO - Epoch [9][1/4]	lr: 3.247e-05, eta: 0:02:04, time: 2.622, data_time: 2.226, memory: 2903, mse_loss: 0.0022, acc_pose: 0.0718, loss: 0.0022
2021-09-22 22:38:19,231 - mmpose - INFO - Epoch [9][2/4]	lr: 3.347e-05, eta: 0:02:01, time: 0.364, data_time: 0.002, memory: 2903, mse_loss: 0.0022, acc_pose: 0.0466, loss: 0.0022
2021-09-22 22:38:19,596 - mmpose - INFO - Epoch [9][3/4]	lr: 3.447e-05, eta: 0:01:58, time: 0.366, data_time: 0.002, memory: 2903, mse_loss: 0.0018, acc_pose: 0.0562, loss: 0.0018
2021-09-22 22:38:19,963 - mmpose - INFO - Epoch [9][4/4]	lr: 3.547e-05, eta: 0:01:55, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0021, acc_pose: 0.0830, loss: 0.0021
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:22,631 - mmpose - INFO - Epoch [10][1/4]	lr: 3.646e-05, eta: 0:02:00, time: 2.611, data_time: 2.220, memory: 2903, mse_loss: 0.0021, acc_pose: 0.0687, loss: 0.0021
2021-09-22 22:38:22,995 - mmpose - INFO - Epoch [10][2/4]	lr: 3.746e-05, eta: 0:01:57, time: 0.365, data_time: 0.002, memory: 2903, mse_loss: 0.0017, acc_pose: 0.1515, loss: 0.0017
2021-09-22 22:38:23,361 - mmpose - INFO - Epoch [10][3/4]	lr: 3.846e-05, eta: 0:01:54, time: 0.366, data_time: 0.002, memory: 2903, mse_loss: 0.0020, acc_pose: 0.1117, loss: 0.0020
2021-09-22 22:38:23,729 - mmpose - INFO - Epoch [10][4/4]	lr: 3.946e-05, eta: 0:01:51, time: 0.367, data_time: 0.002, memory: 2903, mse_loss: 0.0023, acc_pose: 0.0976, loss: 0.0023
2021-09-22 22:38:23,778 - mmpose - INFO - Saving checkpoint at 10 epochs
[                                                  ] 0/25, elapsed: 0s, ETA:
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 25/25, 43.4 task/s, elapsed: 1s, ETA:     0s
2021-09-22 22:38:25,434 - mmpose - INFO - Now best checkpoint is saved as best_PCK_epoch_10.pth.
2021-09-22 22:38:25,434 - mmpose - INFO - Best PCK is 0.2753 at 10 epoch.
2021-09-22 22:38:25,435 - mmpose - INFO - Epoch(val) [10][2]	PCK: 0.2753
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:28,080 - mmpose - INFO - Epoch [11][1/4]	lr: 4.046e-05, eta: 0:01:55, time: 2.639, data_time: 2.248, memory: 2903, mse_loss: 0.0018, acc_pose: 0.1022, loss: 0.0018
2021-09-22 22:38:28,448 - mmpose - INFO - Epoch [11][2/4]	lr: 4.146e-05, eta: 0:01:53, time: 0.368, data_time: 0.002, memory: 2903, mse_loss: 0.0018, acc_pose: 0.0652, loss: 0.0018
2021-09-22 22:38:28,813 - mmpose - INFO - Epoch [11][3/4]	lr: 4.246e-05, eta: 0:01:50, time: 0.365, data_time: 0.001, memory: 2903, mse_loss: 0.0019, acc_pose: 0.1531, loss: 0.0019
2021-09-22 22:38:29,178 - mmpose - INFO - Epoch [11][4/4]	lr: 4.346e-05, eta: 0:01:47, time: 0.365, data_time: 0.001, memory: 2903, mse_loss: 0.0020, acc_pose: 0.1465, loss: 0.0020
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:31,838 - mmpose - INFO - Epoch [12][1/4]	lr: 4.446e-05, eta: 0:01:51, time: 2.608, data_time: 2.218, memory: 2903, mse_loss: 0.0018, acc_pose: 0.0605, loss: 0.0018
2021-09-22 22:38:32,206 - mmpose - INFO - Epoch [12][2/4]	lr: 4.545e-05, eta: 0:01:48, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0022, acc_pose: 0.1361, loss: 0.0022
2021-09-22 22:38:32,574 - mmpose - INFO - Epoch [12][3/4]	lr: 4.645e-05, eta: 0:01:46, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0019, acc_pose: 0.1523, loss: 0.0019
2021-09-22 22:38:32,942 - mmpose - INFO - Epoch [12][4/4]	lr: 4.745e-05, eta: 0:01:44, time: 0.368, data_time: 0.001, memory: 2903, mse_loss: 0.0022, acc_pose: 0.1340, loss: 0.0022
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:35,606 - mmpose - INFO - Epoch [13][1/4]	lr: 4.845e-05, eta: 0:01:47, time: 2.613, data_time: 2.217, memory: 2903, mse_loss: 0.0021, acc_pose: 0.1284, loss: 0.0021
2021-09-22 22:38:35,973 - mmpose - INFO - Epoch [13][2/4]	lr: 4.945e-05, eta: 0:01:44, time: 0.367, data_time: 0.002, memory: 2903, mse_loss: 0.0019, acc_pose: 0.1190, loss: 0.0019
2021-09-22 22:38:36,348 - mmpose - INFO - Epoch [13][3/4]	lr: 5.045e-05, eta: 0:01:42, time: 0.375, data_time: 0.001, memory: 2903, mse_loss: 0.0022, acc_pose: 0.1670, loss: 0.0022
2021-09-22 22:38:36,724 - mmpose - INFO - Epoch [13][4/4]	lr: 5.145e-05, eta: 0:01:40, time: 0.376, data_time: 0.001, memory: 2903, mse_loss: 0.0020, acc_pose: 0.1706, loss: 0.0020
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:39,416 - mmpose - INFO - Epoch [14][1/4]	lr: 5.245e-05, eta: 0:01:43, time: 2.641, data_time: 2.245, memory: 2903, mse_loss: 0.0020, acc_pose: 0.1876, loss: 0.0020
2021-09-22 22:38:39,786 - mmpose - INFO - Epoch [14][2/4]	lr: 5.345e-05, eta: 0:01:40, time: 0.371, data_time: 0.002, memory: 2903, mse_loss: 0.0022, acc_pose: 0.1800, loss: 0.0022
2021-09-22 22:38:40,159 - mmpose - INFO - Epoch [14][3/4]	lr: 5.445e-05, eta: 0:01:38, time: 0.373, data_time: 0.001, memory: 2903, mse_loss: 0.0020, acc_pose: 0.1617, loss: 0.0020
2021-09-22 22:38:40,527 - mmpose - INFO - Epoch [14][4/4]	lr: 5.544e-05, eta: 0:01:36, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0016, acc_pose: 0.1060, loss: 0.0016
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:43,178 - mmpose - INFO - Epoch [15][1/4]	lr: 5.644e-05, eta: 0:01:38, time: 2.601, data_time: 2.203, memory: 2903, mse_loss: 0.0020, acc_pose: 0.2289, loss: 0.0020
2021-09-22 22:38:43,544 - mmpose - INFO - Epoch [15][2/4]	lr: 5.744e-05, eta: 0:01:36, time: 0.366, data_time: 0.002, memory: 2903, mse_loss: 0.0016, acc_pose: 0.1636, loss: 0.0016
2021-09-22 22:38:43,910 - mmpose - INFO - Epoch [15][3/4]	lr: 5.844e-05, eta: 0:01:34, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0021, acc_pose: 0.1721, loss: 0.0021
2021-09-22 22:38:44,276 - mmpose - INFO - Epoch [15][4/4]	lr: 5.944e-05, eta: 0:01:33, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0017, acc_pose: 0.1038, loss: 0.0017
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:46,914 - mmpose - INFO - Epoch [16][1/4]	lr: 6.044e-05, eta: 0:01:34, time: 2.587, data_time: 2.198, memory: 2903, mse_loss: 0.0020, acc_pose: 0.1295, loss: 0.0020
2021-09-22 22:38:47,283 - mmpose - INFO - Epoch [16][2/4]	lr: 6.144e-05, eta: 0:01:32, time: 0.369, data_time: 0.002, memory: 2903, mse_loss: 0.0018, acc_pose: 0.1358, loss: 0.0018
2021-09-22 22:38:47,651 - mmpose - INFO - Epoch [16][3/4]	lr: 6.244e-05, eta: 0:01:31, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0018, acc_pose: 0.1543, loss: 0.0018
2021-09-22 22:38:48,019 - mmpose - INFO - Epoch [16][4/4]	lr: 6.344e-05, eta: 0:01:29, time: 0.368, data_time: 0.001, memory: 2903, mse_loss: 0.0017, acc_pose: 0.1155, loss: 0.0017
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:50,700 - mmpose - INFO - Epoch [17][1/4]	lr: 6.444e-05, eta: 0:01:30, time: 2.611, data_time: 2.217, memory: 2903, mse_loss: 0.0019, acc_pose: 0.2150, loss: 0.0019
2021-09-22 22:38:51,070 - mmpose - INFO - Epoch [17][2/4]	lr: 6.544e-05, eta: 0:01:29, time: 0.370, data_time: 0.002, memory: 2903, mse_loss: 0.0022, acc_pose: 0.1850, loss: 0.0022
2021-09-22 22:38:51,439 - mmpose - INFO - Epoch [17][3/4]	lr: 6.643e-05, eta: 0:01:27, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0019, acc_pose: 0.1244, loss: 0.0019
2021-09-22 22:38:51,805 - mmpose - INFO - Epoch [17][4/4]	lr: 6.743e-05, eta: 0:01:25, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0018, acc_pose: 0.2272, loss: 0.0018
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:54,470 - mmpose - INFO - Epoch [18][1/4]	lr: 6.843e-05, eta: 0:01:26, time: 2.614, data_time: 2.218, memory: 2903, mse_loss: 0.0020, acc_pose: 0.2409, loss: 0.0020
2021-09-22 22:38:54,840 - mmpose - INFO - Epoch [18][2/4]	lr: 6.943e-05, eta: 0:01:25, time: 0.370, data_time: 0.002, memory: 2903, mse_loss: 0.0017, acc_pose: 0.1534, loss: 0.0017
2021-09-22 22:38:55,209 - mmpose - INFO - Epoch [18][3/4]	lr: 7.043e-05, eta: 0:01:23, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0018, acc_pose: 0.3068, loss: 0.0018
2021-09-22 22:38:55,575 - mmpose - INFO - Epoch [18][4/4]	lr: 7.143e-05, eta: 0:01:21, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0018, acc_pose: 0.2066, loss: 0.0018
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:38:58,277 - mmpose - INFO - Epoch [19][1/4]	lr: 7.243e-05, eta: 0:01:22, time: 2.636, data_time: 2.228, memory: 2903, mse_loss: 0.0019, acc_pose: 0.2946, loss: 0.0019
2021-09-22 22:38:58,651 - mmpose - INFO - Epoch [19][2/4]	lr: 7.343e-05, eta: 0:01:21, time: 0.374, data_time: 0.001, memory: 2903, mse_loss: 0.0014, acc_pose: 0.2669, loss: 0.0014
2021-09-22 22:38:59,019 - mmpose - INFO - Epoch [19][3/4]	lr: 7.443e-05, eta: 0:01:19, time: 0.368, data_time: 0.001, memory: 2903, mse_loss: 0.0020, acc_pose: 0.2514, loss: 0.0020
2021-09-22 22:38:59,388 - mmpose - INFO - Epoch [19][4/4]	lr: 7.543e-05, eta: 0:01:18, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0016, acc_pose: 0.2052, loss: 0.0016
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:02,074 - mmpose - INFO - Epoch [20][1/4]	lr: 7.642e-05, eta: 0:01:19, time: 2.634, data_time: 2.231, memory: 2903, mse_loss: 0.0021, acc_pose: 0.1846, loss: 0.0021
2021-09-22 22:39:02,443 - mmpose - INFO - Epoch [20][2/4]	lr: 7.742e-05, eta: 0:01:17, time: 0.369, data_time: 0.002, memory: 2903, mse_loss: 0.0013, acc_pose: 0.1537, loss: 0.0013
2021-09-22 22:39:02,811 - mmpose - INFO - Epoch [20][3/4]	lr: 7.842e-05, eta: 0:01:15, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0017, acc_pose: 0.2114, loss: 0.0017
2021-09-22 22:39:03,180 - mmpose - INFO - Epoch [20][4/4]	lr: 7.942e-05, eta: 0:01:14, time: 0.368, data_time: 0.001, memory: 2903, mse_loss: 0.0020, acc_pose: 0.2147, loss: 0.0020
2021-09-22 22:39:03,231 - mmpose - INFO - Saving checkpoint at 20 epochs
[                                                  ] 0/25, elapsed: 0s, ETA:
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 25/25, 45.0 task/s, elapsed: 1s, ETA:     0s
2021-09-22 22:39:04,788 - mmpose - INFO - Now best checkpoint is saved as best_PCK_epoch_20.pth.
2021-09-22 22:39:04,789 - mmpose - INFO - Best PCK is 0.3123 at 20 epoch.
2021-09-22 22:39:04,789 - mmpose - INFO - Epoch(val) [20][2]	PCK: 0.3123
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:07,402 - mmpose - INFO - Epoch [21][1/4]	lr: 8.042e-05, eta: 0:01:15, time: 2.609, data_time: 2.218, memory: 2903, mse_loss: 0.0017, acc_pose: 0.2806, loss: 0.0017
2021-09-22 22:39:07,769 - mmpose - INFO - Epoch [21][2/4]	lr: 8.142e-05, eta: 0:01:13, time: 0.366, data_time: 0.002, memory: 2903, mse_loss: 0.0017, acc_pose: 0.2352, loss: 0.0017
2021-09-22 22:39:08,136 - mmpose - INFO - Epoch [21][3/4]	lr: 8.242e-05, eta: 0:01:12, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0021, acc_pose: 0.2968, loss: 0.0021
2021-09-22 22:39:08,502 - mmpose - INFO - Epoch [21][4/4]	lr: 8.342e-05, eta: 0:01:10, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0015, acc_pose: 0.1867, loss: 0.0015
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:11,188 - mmpose - INFO - Epoch [22][1/4]	lr: 8.442e-05, eta: 0:01:11, time: 2.635, data_time: 2.244, memory: 2903, mse_loss: 0.0019, acc_pose: 0.3474, loss: 0.0019
2021-09-22 22:39:11,561 - mmpose - INFO - Epoch [22][2/4]	lr: 8.542e-05, eta: 0:01:09, time: 0.373, data_time: 0.001, memory: 2903, mse_loss: 0.0016, acc_pose: 0.2988, loss: 0.0016
2021-09-22 22:39:11,929 - mmpose - INFO - Epoch [22][3/4]	lr: 8.641e-05, eta: 0:01:08, time: 0.368, data_time: 0.001, memory: 2903, mse_loss: 0.0018, acc_pose: 0.2864, loss: 0.0018
2021-09-22 22:39:12,292 - mmpose - INFO - Epoch [22][4/4]	lr: 8.741e-05, eta: 0:01:07, time: 0.363, data_time: 0.001, memory: 2903, mse_loss: 0.0018, acc_pose: 0.2130, loss: 0.0018
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:14,985 - mmpose - INFO - Epoch [23][1/4]	lr: 8.841e-05, eta: 0:01:07, time: 2.625, data_time: 2.227, memory: 2903, mse_loss: 0.0016, acc_pose: 0.2869, loss: 0.0016
2021-09-22 22:39:15,352 - mmpose - INFO - Epoch [23][2/4]	lr: 8.941e-05, eta: 0:01:06, time: 0.367, data_time: 0.002, memory: 2903, mse_loss: 0.0018, acc_pose: 0.2948, loss: 0.0018
2021-09-22 22:39:15,732 - mmpose - INFO - Epoch [23][3/4]	lr: 9.041e-05, eta: 0:01:04, time: 0.381, data_time: 0.001, memory: 2903, mse_loss: 0.0018, acc_pose: 0.2796, loss: 0.0018
2021-09-22 22:39:16,098 - mmpose - INFO - Epoch [23][4/4]	lr: 9.141e-05, eta: 0:01:03, time: 0.365, data_time: 0.001, memory: 2903, mse_loss: 0.0017, acc_pose: 0.2982, loss: 0.0017
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:18,773 - mmpose - INFO - Epoch [24][1/4]	lr: 9.241e-05, eta: 0:01:03, time: 2.624, data_time: 2.226, memory: 2903, mse_loss: 0.0016, acc_pose: 0.3208, loss: 0.0016
2021-09-22 22:39:19,142 - mmpose - INFO - Epoch [24][2/4]	lr: 9.341e-05, eta: 0:01:02, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0018, acc_pose: 0.2067, loss: 0.0018
2021-09-22 22:39:19,512 - mmpose - INFO - Epoch [24][3/4]	lr: 9.441e-05, eta: 0:01:00, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0020, acc_pose: 0.2734, loss: 0.0020
2021-09-22 22:39:19,879 - mmpose - INFO - Epoch [24][4/4]	lr: 9.540e-05, eta: 0:00:59, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0016, acc_pose: 0.3253, loss: 0.0016
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:22,523 - mmpose - INFO - Epoch [25][1/4]	lr: 9.640e-05, eta: 0:00:59, time: 2.593, data_time: 2.211, memory: 2903, mse_loss: 0.0020, acc_pose: 0.3644, loss: 0.0020
2021-09-22 22:39:22,893 - mmpose - INFO - Epoch [25][2/4]	lr: 9.740e-05, eta: 0:00:58, time: 0.371, data_time: 0.002, memory: 2903, mse_loss: 0.0014, acc_pose: 0.3229, loss: 0.0014
2021-09-22 22:39:23,260 - mmpose - INFO - Epoch [25][3/4]	lr: 9.840e-05, eta: 0:00:57, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0015, acc_pose: 0.3083, loss: 0.0015
2021-09-22 22:39:23,625 - mmpose - INFO - Epoch [25][4/4]	lr: 9.940e-05, eta: 0:00:55, time: 0.365, data_time: 0.001, memory: 2903, mse_loss: 0.0015, acc_pose: 0.2692, loss: 0.0015
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:26,300 - mmpose - INFO - Epoch [26][1/4]	lr: 1.004e-04, eta: 0:00:55, time: 2.623, data_time: 2.235, memory: 2903, mse_loss: 0.0017, acc_pose: 0.3494, loss: 0.0017
2021-09-22 22:39:26,667 - mmpose - INFO - Epoch [26][2/4]	lr: 1.014e-04, eta: 0:00:54, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0013, acc_pose: 0.3283, loss: 0.0013
2021-09-22 22:39:27,033 - mmpose - INFO - Epoch [26][3/4]	lr: 1.024e-04, eta: 0:00:53, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0017, acc_pose: 0.3560, loss: 0.0017
2021-09-22 22:39:27,402 - mmpose - INFO - Epoch [26][4/4]	lr: 1.034e-04, eta: 0:00:52, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0019, acc_pose: 0.2936, loss: 0.0019
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:30,106 - mmpose - INFO - Epoch [27][1/4]	lr: 1.044e-04, eta: 0:00:52, time: 2.643, data_time: 2.248, memory: 2903, mse_loss: 0.0016, acc_pose: 0.3084, loss: 0.0016
2021-09-22 22:39:30,476 - mmpose - INFO - Epoch [27][2/4]	lr: 1.054e-04, eta: 0:00:50, time: 0.371, data_time: 0.002, memory: 2903, mse_loss: 0.0020, acc_pose: 0.3418, loss: 0.0020
2021-09-22 22:39:30,845 - mmpose - INFO - Epoch [27][3/4]	lr: 1.064e-04, eta: 0:00:49, time: 0.368, data_time: 0.001, memory: 2903, mse_loss: 0.0015, acc_pose: 0.3162, loss: 0.0015
2021-09-22 22:39:31,211 - mmpose - INFO - Epoch [27][4/4]	lr: 1.074e-04, eta: 0:00:48, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0018, acc_pose: 0.3371, loss: 0.0018
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:33,896 - mmpose - INFO - Epoch [28][1/4]	lr: 1.084e-04, eta: 0:00:48, time: 2.633, data_time: 2.233, memory: 2903, mse_loss: 0.0019, acc_pose: 0.3924, loss: 0.0019
2021-09-22 22:39:34,263 - mmpose - INFO - Epoch [28][2/4]	lr: 1.094e-04, eta: 0:00:47, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0019, acc_pose: 0.3889, loss: 0.0019
2021-09-22 22:39:34,629 - mmpose - INFO - Epoch [28][3/4]	lr: 1.104e-04, eta: 0:00:45, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0013, acc_pose: 0.2687, loss: 0.0013
2021-09-22 22:39:34,994 - mmpose - INFO - Epoch [28][4/4]	lr: 1.114e-04, eta: 0:00:44, time: 0.365, data_time: 0.001, memory: 2903, mse_loss: 0.0019, acc_pose: 0.3294, loss: 0.0019
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:37,690 - mmpose - INFO - Epoch [29][1/4]	lr: 1.124e-04, eta: 0:00:44, time: 2.642, data_time: 2.247, memory: 2903, mse_loss: 0.0019, acc_pose: 0.4194, loss: 0.0019
2021-09-22 22:39:38,056 - mmpose - INFO - Epoch [29][2/4]	lr: 1.134e-04, eta: 0:00:43, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0017, acc_pose: 0.3326, loss: 0.0017
2021-09-22 22:39:38,423 - mmpose - INFO - Epoch [29][3/4]	lr: 1.144e-04, eta: 0:00:42, time: 0.368, data_time: 0.001, memory: 2903, mse_loss: 0.0017, acc_pose: 0.3295, loss: 0.0017
2021-09-22 22:39:38,788 - mmpose - INFO - Epoch [29][4/4]	lr: 1.154e-04, eta: 0:00:40, time: 0.365, data_time: 0.001, memory: 2903, mse_loss: 0.0014, acc_pose: 0.3882, loss: 0.0014
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:41,450 - mmpose - INFO - Epoch [30][1/4]	lr: 1.164e-04, eta: 0:00:40, time: 2.609, data_time: 2.216, memory: 2903, mse_loss: 0.0017, acc_pose: 0.3309, loss: 0.0017
2021-09-22 22:39:41,816 - mmpose - INFO - Epoch [30][2/4]	lr: 1.174e-04, eta: 0:00:39, time: 0.366, data_time: 0.002, memory: 2903, mse_loss: 0.0014, acc_pose: 0.3749, loss: 0.0014
2021-09-22 22:39:42,184 - mmpose - INFO - Epoch [30][3/4]	lr: 1.184e-04, eta: 0:00:38, time: 0.369, data_time: 0.002, memory: 2903, mse_loss: 0.0018, acc_pose: 0.4279, loss: 0.0018
2021-09-22 22:39:42,550 - mmpose - INFO - Epoch [30][4/4]	lr: 1.194e-04, eta: 0:00:37, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0016, acc_pose: 0.3873, loss: 0.0016
2021-09-22 22:39:42,599 - mmpose - INFO - Saving checkpoint at 30 epochs
[                                                  ] 0/25, elapsed: 0s, ETA:
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 25/25, 44.1 task/s, elapsed: 1s, ETA:     0s
2021-09-22 22:39:44,183 - mmpose - INFO - Now best checkpoint is saved as best_PCK_epoch_30.pth.
2021-09-22 22:39:44,183 - mmpose - INFO - Best PCK is 0.3288 at 30 epoch.
2021-09-22 22:39:44,184 - mmpose - INFO - Epoch(val) [30][2]	PCK: 0.3288
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:46,788 - mmpose - INFO - Epoch [31][1/4]	lr: 1.204e-04, eta: 0:00:36, time: 2.599, data_time: 2.210, memory: 2903, mse_loss: 0.0015, acc_pose: 0.3854, loss: 0.0015
2021-09-22 22:39:47,154 - mmpose - INFO - Epoch [31][2/4]	lr: 1.214e-04, eta: 0:00:35, time: 0.367, data_time: 0.002, memory: 2903, mse_loss: 0.0012, acc_pose: 0.3277, loss: 0.0012
2021-09-22 22:39:47,521 - mmpose - INFO - Epoch [31][3/4]	lr: 1.224e-04, eta: 0:00:34, time: 0.367, data_time: 0.002, memory: 2903, mse_loss: 0.0019, acc_pose: 0.3654, loss: 0.0019
2021-09-22 22:39:47,887 - mmpose - INFO - Epoch [31][4/4]	lr: 1.234e-04, eta: 0:00:33, time: 0.367, data_time: 0.002, memory: 2903, mse_loss: 0.0015, acc_pose: 0.4014, loss: 0.0015
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:50,571 - mmpose - INFO - Epoch [32][1/4]	lr: 1.244e-04, eta: 0:00:33, time: 2.633, data_time: 2.242, memory: 2903, mse_loss: 0.0019, acc_pose: 0.4077, loss: 0.0019
2021-09-22 22:39:50,936 - mmpose - INFO - Epoch [32][2/4]	lr: 1.254e-04, eta: 0:00:31, time: 0.366, data_time: 0.002, memory: 2903, mse_loss: 0.0015, acc_pose: 0.3948, loss: 0.0015
2021-09-22 22:39:51,302 - mmpose - INFO - Epoch [32][3/4]	lr: 1.264e-04, eta: 0:00:30, time: 0.365, data_time: 0.001, memory: 2903, mse_loss: 0.0013, acc_pose: 0.3251, loss: 0.0013
2021-09-22 22:39:51,664 - mmpose - INFO - Epoch [32][4/4]	lr: 1.274e-04, eta: 0:00:29, time: 0.362, data_time: 0.001, memory: 2903, mse_loss: 0.0016, acc_pose: 0.4011, loss: 0.0016
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:54,329 - mmpose - INFO - Epoch [33][1/4]	lr: 1.284e-04, eta: 0:00:29, time: 2.616, data_time: 2.218, memory: 2903, mse_loss: 0.0014, acc_pose: 0.4166, loss: 0.0014
2021-09-22 22:39:54,695 - mmpose - INFO - Epoch [33][2/4]	lr: 1.294e-04, eta: 0:00:28, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0016, acc_pose: 0.4266, loss: 0.0016
2021-09-22 22:39:55,062 - mmpose - INFO - Epoch [33][3/4]	lr: 1.304e-04, eta: 0:00:27, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0014, acc_pose: 0.3923, loss: 0.0014
2021-09-22 22:39:55,429 - mmpose - INFO - Epoch [33][4/4]	lr: 1.314e-04, eta: 0:00:26, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0017, acc_pose: 0.4607, loss: 0.0017
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:39:58,079 - mmpose - INFO - Epoch [34][1/4]	lr: 1.324e-04, eta: 0:00:25, time: 2.598, data_time: 2.215, memory: 2903, mse_loss: 0.0015, acc_pose: 0.3104, loss: 0.0015
2021-09-22 22:39:58,443 - mmpose - INFO - Epoch [34][2/4]	lr: 1.334e-04, eta: 0:00:24, time: 0.365, data_time: 0.003, memory: 2903, mse_loss: 0.0018, acc_pose: 0.4616, loss: 0.0018
2021-09-22 22:39:58,808 - mmpose - INFO - Epoch [34][3/4]	lr: 1.344e-04, eta: 0:00:23, time: 0.366, data_time: 0.001, memory: 2903, mse_loss: 0.0010, acc_pose: 0.3579, loss: 0.0010
2021-09-22 22:39:59,176 - mmpose - INFO - Epoch [34][4/4]	lr: 1.354e-04, eta: 0:00:22, time: 0.367, data_time: 0.001, memory: 2903, mse_loss: 0.0018, acc_pose: 0.4007, loss: 0.0018
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:40:01,843 - mmpose - INFO - Epoch [35][1/4]	lr: 1.364e-04, eta: 0:00:21, time: 2.616, data_time: 2.227, memory: 2903, mse_loss: 0.0018, acc_pose: 0.4073, loss: 0.0018
2021-09-22 22:40:02,211 - mmpose - INFO - Epoch [35][2/4]	lr: 1.374e-04, eta: 0:00:20, time: 0.368, data_time: 0.001, memory: 2903, mse_loss: 0.0017, acc_pose: 0.5594, loss: 0.0017
2021-09-22 22:40:02,582 - mmpose - INFO - Epoch [35][3/4]	lr: 1.384e-04, eta: 0:00:19, time: 0.371, data_time: 0.001, memory: 2903, mse_loss: 0.0013, acc_pose: 0.4707, loss: 0.0013
2021-09-22 22:40:02,951 - mmpose - INFO - Epoch [35][4/4]	lr: 1.394e-04, eta: 0:00:18, time: 0.369, data_time: 0.002, memory: 2903, mse_loss: 0.0015, acc_pose: 0.4522, loss: 0.0015
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:40:05,626 - mmpose - INFO - Epoch [36][1/4]	lr: 1.404e-04, eta: 0:00:17, time: 2.622, data_time: 2.224, memory: 2903, mse_loss: 0.0013, acc_pose: 0.3195, loss: 0.0013
2021-09-22 22:40:05,995 - mmpose - INFO - Epoch [36][2/4]	lr: 1.414e-04, eta: 0:00:16, time: 0.369, data_time: 0.002, memory: 2903, mse_loss: 0.0016, acc_pose: 0.4603, loss: 0.0016
2021-09-22 22:40:06,364 - mmpose - INFO - Epoch [36][3/4]	lr: 1.424e-04, eta: 0:00:15, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0016, acc_pose: 0.3914, loss: 0.0016
2021-09-22 22:40:06,733 - mmpose - INFO - Epoch [36][4/4]	lr: 1.434e-04, eta: 0:00:14, time: 0.369, data_time: 0.001, memory: 2903, mse_loss: 0.0015, acc_pose: 0.5051, loss: 0.0015
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:40:09,418 - mmpose - INFO - Epoch [37][1/4]	lr: 1.444e-04, eta: 0:00:14, time: 2.632, data_time: 2.231, memory: 2903, mse_loss: 0.0014, acc_pose: 0.4651, loss: 0.0014
2021-09-22 22:40:09,789 - mmpose - INFO - Epoch [37][2/4]	lr: 1.454e-04, eta: 0:00:13, time: 0.371, data_time: 0.001, memory: 2903, mse_loss: 0.0016, acc_pose: 0.4974, loss: 0.0016
2021-09-22 22:40:10,162 - mmpose - INFO - Epoch [37][3/4]	lr: 1.464e-04, eta: 0:00:12, time: 0.374, data_time: 0.002, memory: 2903, mse_loss: 0.0016, acc_pose: 0.5292, loss: 0.0016
2021-09-22 22:40:10,533 - mmpose - INFO - Epoch [37][4/4]	lr: 1.474e-04, eta: 0:00:11, time: 0.371, data_time: 0.001, memory: 2903, mse_loss: 0.0014, acc_pose: 0.4183, loss: 0.0014
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:40:13,213 - mmpose - INFO - Epoch [38][1/4]	lr: 1.484e-04, eta: 0:00:10, time: 2.628, data_time: 2.229, memory: 2903, mse_loss: 0.0014, acc_pose: 0.4511, loss: 0.0014
2021-09-22 22:40:13,587 - mmpose - INFO - Epoch [38][2/4]	lr: 1.494e-04, eta: 0:00:09, time: 0.374, data_time: 0.002, memory: 2903, mse_loss: 0.0013, acc_pose: 0.5198, loss: 0.0013
2021-09-22 22:40:13,959 - mmpose - INFO - Epoch [38][3/4]	lr: 1.504e-04, eta: 0:00:08, time: 0.371, data_time: 0.001, memory: 2903, mse_loss: 0.0014, acc_pose: 0.5084, loss: 0.0014
2021-09-22 22:40:14,338 - mmpose - INFO - Epoch [38][4/4]	lr: 1.513e-04, eta: 0:00:07, time: 0.379, data_time: 0.002, memory: 2903, mse_loss: 0.0016, acc_pose: 0.4849, loss: 0.0016
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:40:16,996 - mmpose - INFO - Epoch [39][1/4]	lr: 1.523e-04, eta: 0:00:06, time: 2.606, data_time: 2.221, memory: 2903, mse_loss: 0.0015, acc_pose: 0.4523, loss: 0.0015
2021-09-22 22:40:17,363 - mmpose - INFO - Epoch [39][2/4]	lr: 1.533e-04, eta: 0:00:05, time: 0.367, data_time: 0.002, memory: 2903, mse_loss: 0.0013, acc_pose: 0.5011, loss: 0.0013
2021-09-22 22:40:17,739 - mmpose - INFO - Epoch [39][3/4]	lr: 1.543e-04, eta: 0:00:04, time: 0.376, data_time: 0.001, memory: 2903, mse_loss: 0.0013, acc_pose: 0.5854, loss: 0.0013
2021-09-22 22:40:18,109 - mmpose - INFO - Epoch [39][4/4]	lr: 1.553e-04, eta: 0:00:03, time: 0.370, data_time: 0.001, memory: 2903, mse_loss: 0.0016, acc_pose: 0.4886, loss: 0.0016
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
2021-09-22 22:40:20,760 - mmpose - INFO - Epoch [40][1/4]	lr: 1.563e-04, eta: 0:00:02, time: 2.599, data_time: 2.234, memory: 2903, mse_loss: 0.0014, acc_pose: 0.4787, loss: 0.0014
2021-09-22 22:40:21,109 - mmpose - INFO - Epoch [40][2/4]	lr: 1.573e-04, eta: 0:00:01, time: 0.350, data_time: 0.001, memory: 2903, mse_loss: 0.0013, acc_pose: 0.5198, loss: 0.0013
2021-09-22 22:40:21,459 - mmpose - INFO - Epoch [40][3/4]	lr: 1.583e-04, eta: 0:00:00, time: 0.350, data_time: 0.001, memory: 2903, mse_loss: 0.0012, acc_pose: 0.5001, loss: 0.0012
2021-09-22 22:40:21,805 - mmpose - INFO - Epoch [40][4/4]	lr: 1.593e-04, eta: 0:00:00, time: 0.345, data_time: 0.001, memory: 2903, mse_loss: 0.0014, acc_pose: 0.5597, loss: 0.0014
2021-09-22 22:40:21,852 - mmpose - INFO - Saving checkpoint at 40 epochs
[                                                  ] 0/25, elapsed: 0s, ETA:
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 25/25, 47.2 task/s, elapsed: 1s, ETA:     0s
2021-09-22 22:40:23,387 - mmpose - INFO - Now best checkpoint is saved as best_PCK_epoch_40.pth.
2021-09-22 22:40:23,388 - mmpose - INFO - Best PCK is 0.3473 at 40 epoch.
2021-09-22 22:40:23,388 - mmpose - INFO - Epoch(val) [40][2]	PCK: 0.3473
Test the trained model. Since the model is trained on a toy dataset coco-tiny, its performance would be as good as the ones in our model zoo. Here we mainly show how to inference and visualize a local model checkpoint.

from mmpose.apis import (inference_top_down_pose_model, init_pose_model,
                         vis_pose_result, process_mmdet_results)
from mmdet.apis import inference_detector, init_detector
local_runtime = False

try:
  from google.colab.patches import cv2_imshow  # for image visualization in colab
except:
  local_runtime = True


pose_checkpoint = 'work_dirs/hrnet_w32_coco_tiny_256x192/latest.pth'
det_config = 'demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py'
det_checkpoint = 'https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth'

# initialize pose model
pose_model = init_pose_model(cfg, pose_checkpoint)
# initialize detector
det_model = init_detector(det_config, det_checkpoint)

img = 'tests/data/coco/000000196141.jpg'

# inference detection
mmdet_results = inference_detector(det_model, img)

# extract person (COCO_ID=1) bounding boxes from the detection results
person_results = process_mmdet_results(mmdet_results, cat_id=1)

# inference pose
pose_results, returned_outputs = inference_top_down_pose_model(pose_model,
                                                               img,
                                                               person_results,
                                                               bbox_thr=0.3,
                                                               format='xyxy',
                                                               dataset='TopDownCocoDataset')

# show pose estimation results
vis_result = vis_pose_result(pose_model,
                             img,
                             pose_results,
                             kpt_score_thr=0.,
                             dataset='TopDownCocoDataset',
                             show=False)

# reduce image size
vis_result = cv2.resize(vis_result, dsize=None, fx=0.5, fy=0.5)

if local_runtime:
  from IPython.display import Image, display
  import tempfile
  import os.path as osp
  import cv2
  with tempfile.TemporaryDirectory() as tmpdir:
    file_name = osp.join(tmpdir, 'pose_results.png')
    cv2.imwrite(file_name, vis_result)
    display(Image(file_name))
else:
  cv2_imshow(vis_result)
Use load_from_local loader
/home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages/mmdet/core/anchor/builder.py:15: UserWarning: ``build_anchor_generator`` would be deprecated soon, please use ``build_prior_generator`` 
  warnings.warn(
Use load_from_http loader
/home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages/mmdet/core/anchor/anchor_generator.py:323: UserWarning: ``grid_anchors`` would be deprecated soon. Please use ``grid_priors`` 
  warnings.warn('``grid_anchors`` would be deprecated soon. '
/home/SENSETIME/liyining/anaconda3/envs/colab/lib/python3.9/site-packages/mmdet/core/anchor/anchor_generator.py:359: UserWarning: ``single_level_grid_anchors`` would be deprecated soon. Please use ``single_level_grid_priors`` 
  warnings.warn(