Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cSpell.words": [
"Depthwise",
"posenet"
]
}
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
_base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco_wholebody.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
_base_ = ["../../../../_base_/default_runtime.py", "../../../../_base_/datasets/coco_wholebody.py"]
evaluation = dict(interval=10, metric="mAP", save_best="AP")

optimizer = dict(
type='Adam',
type="Adam",
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='linear',
warmup_iters=500,
warmup_ratio=0.001,
step=[170, 200])
lr_config = dict(policy="step", warmup="linear", warmup_iters=500, warmup_ratio=0.001, step=[170, 200])
total_epochs = 210
channel_cfg = dict(
num_output_channels=133,
dataset_joints=133,
dataset_channel=[
list(range(133)),
],
inference_channel=list(range(133)))
inference_channel=list(range(133)),
)

# model settings
model = dict(
type='TopDown',
pretrained=None,
type="TopdownPoseEstimator",
# pretrained=None,
backbone=dict(
type='ViT',
type="ViT",
img_size=(256, 192),
patch_size=16,
embed_dim=1280,
Expand All @@ -42,108 +35,143 @@
qkv_bias=True,
drop_path_rate=0.3,
),
keypoint_head=dict(
type='TopdownHeatmapSimpleHead',
head=dict(
type="TopdownHeatmapSimpleHead",
in_channels=1280,
num_deconv_layers=2,
num_deconv_filters=(256, 256),
num_deconv_kernels=(4, 4),
extra=dict(final_conv_kernel=1, ),
out_channels=channel_cfg['num_output_channels'],
loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)),
extra=dict(
final_conv_kernel=1,
),
out_channels=channel_cfg["num_output_channels"],
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))
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=channel_cfg['num_output_channels'],
num_joints=channel_cfg['dataset_joints'],
dataset_channel=channel_cfg['dataset_channel'],
inference_channel=channel_cfg['inference_channel'],
num_output_channels=channel_cfg["num_output_channels"],
num_joints=channel_cfg["dataset_joints"],
dataset_channel=channel_cfg["dataset_channel"],
inference_channel=channel_cfg["inference_channel"],
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',
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="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'],
type="Collect",
keys=["img", "target", "target_weight"],
meta_keys=[
'image_file', 'joints_3d', 'joints_3d_visible', 'center', 'scale',
'rotation', 'bbox_score', 'flip_pairs'
]),
"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="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'
]),
type="Collect",
keys=["img"],
meta_keys=["image_file", "center", "scale", "rotation", "bbox_score", "flip_pairs"],
),
]

test_pipeline = val_pipeline

data_root = 'data/coco'
data_root = "data/coco"
data_mode = "topdown"

data = dict(
samples_per_gpu=64,
workers_per_gpu=2,
val_dataloader=dict(samples_per_gpu=32),
test_dataloader=dict(samples_per_gpu=32),
train=dict(
type='TopDownCocoWholeBodyDataset',
ann_file=f'{data_root}/annotations/coco_wholebody_train_v1.0.json',
img_prefix=f'{data_root}/train2017/',
type="TopDownCocoWholeBodyDataset",
ann_file=f"{data_root}/annotations/coco_wholebody_train_v1.0.json",
img_prefix=f"{data_root}/train2017/",
data_cfg=data_cfg,
pipeline=train_pipeline,
dataset_info={{_base_.dataset_info}}),
dataset_info={{_base_.dataset_info}},
),
val=dict(
type='TopDownCocoWholeBodyDataset',
ann_file=f'{data_root}/annotations/coco_wholebody_val_v1.0.json',
img_prefix=f'{data_root}/val2017/',
type="TopDownCocoWholeBodyDataset",
ann_file=f"{data_root}/annotations/coco_wholebody_val_v1.0.json",
img_prefix=f"{data_root}/val2017/",
data_cfg=data_cfg,
pipeline=val_pipeline,
dataset_info={{_base_.dataset_info}}),
dataset_info={{_base_.dataset_info}},
),
test=dict(
type='TopDownCocoWholeBodyDataset',
ann_file=f'{data_root}/annotations/coco_wholebody_val_v1.0.json',
img_prefix=f'{data_root}/val2017/',
type="TopDownCocoWholeBodyDataset",
ann_file=f"{data_root}/annotations/coco_wholebody_val_v1.0.json",
img_prefix=f"{data_root}/val2017/",
data_cfg=data_cfg,
pipeline=test_pipeline,
dataset_info={{_base_.dataset_info}}),
dataset_info={{_base_.dataset_info}},
),
)

train_dataloader = dict(
batch_size=64,
num_workers=4,
persistent_works=True,
sampler=dict(type="DefaultSampler", shuffle=True),
dataset=dict(
type="TopDownCocoWholeBodyDataset",
data_root=data_root,
data_mode=data_mode,
ann_file="annotations/coco_wholebody_train_v1.0.json",
data_prefix=dict(img="train2017/"),
data_cfg=data_cfg,
pipeline=train_pipeline,
),
)

val_dataloader = dict(
batch_size=32,
num_workers=4,
persistent_works=True,
drop_last=False,
sampler=dict(type="DefaultSampler", shuffle=False, round_up=False),
dataset=dict(
type="TopDownCocoWholeBodyDataset",
data_root=data_root,
data_mode=data_mode,
ann_file="annotations/coco_wholebody_val_v1.0.json",
data_prefix=dict(img="val2017/"),
test_mode=True,
data_cfg=data_cfg,
pipeline=val_pipeline,
),
)

test_dataloader = val_dataloader
34 changes: 34 additions & 0 deletions mmpose/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: 2.1

# this allows you to use CircleCI's dynamic configuration feature
setup: true

# the path-filtering orb is required to continue a pipeline based on
# the path of an updated fileset
orbs:
path-filtering: circleci/path-filtering@0.1.2

workflows:
# the always-run workflow is always triggered, regardless of the pipeline parameters.
always-run:
jobs:
# the path-filtering/filter job determines which pipeline
# parameters to update.
- path-filtering/filter:
name: check-updated-files
# 3-column, whitespace-delimited mapping. One mapping per
# line:
# <regex path-to-test> <parameter-to-set> <value-of-pipeline-parameter>
mapping: |
mmpose/.* lint_only false
requirements/.* lint_only false
tests/.* lint_only false
tools/.* lint_only false
configs/.* lint_only false
.circleci/.* lint_only false
base-revision: dev-1.x
# this is the path of the configuration we should trigger once
# path filtering and pipeline parameter value updates are
# complete. In this case, we are using the parent dynamic
# configuration itself.
config-path: .circleci/test.yml
11 changes: 11 additions & 0 deletions mmpose/.circleci/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG PYTORCH="1.7.1"
ARG CUDA="11.0"
ARG CUDNN="8"

FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel

# To fix GPG key error when running apt-get update
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub

RUN apt-get update && apt-get install -y ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx
19 changes: 19 additions & 0 deletions mmpose/.circleci/scripts/get_mmcv_var.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

TORCH=$1
CUDA=$2

# 10.2 -> cu102
MMCV_CUDA="cu`echo ${CUDA} | tr -d '.'`"

# MMCV only provides pre-compiled packages for torch 1.x.0
# which works for any subversions of torch 1.x.
# We force the torch version to be 1.x.0 to ease package searching
# and avoid unnecessary rebuild during MMCV's installation.
TORCH_VER_ARR=(${TORCH//./ })
TORCH_VER_ARR[2]=0
printf -v MMCV_TORCH "%s." "${TORCH_VER_ARR[@]}"
MMCV_TORCH=${MMCV_TORCH%?} # Remove the last dot

echo "export MMCV_CUDA=${MMCV_CUDA}" >> $BASH_ENV
echo "export MMCV_TORCH=${MMCV_TORCH}" >> $BASH_ENV
Loading