Skip to content

Commit

Permalink
--update=refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
xiexinch committed Apr 28, 2024
1 parent fb15f42 commit fc87ebd
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 322 deletions.
54 changes: 0 additions & 54 deletions projects/rtmpose3d/configs/default_runtime.py

This file was deleted.

137 changes: 63 additions & 74 deletions projects/rtmpose3d/configs/rtmw3d-l_8xb64_cocktail14-384x288.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
_base_ = ['./default_runtime.py']
_base_ = ['mmpose::_base_/default_runtime.py']

custom_imports = dict(imports=['rtmpose3d'], allow_failed_imports=False)

vis_backends = [
dict(type='LocalVisBackend'),
Expand Down Expand Up @@ -105,7 +107,7 @@
pos_enc=False),
loss=[
dict(
type='KLDiscretLoss2',
type='KLDiscretLossWithWeight',
use_target_weight=True,
beta=10.,
label_softmax=True),
Expand Down Expand Up @@ -195,27 +197,6 @@
dict(type='PackPoseInputs')
]

# h3wb dataset
h3wb_dataset = dict(
type='H36MWholeBodyDataset',
ann_file='annotation_body3d/h3wb_train_bbox.npz',
seq_len=1,
causal=True,
data_root='data/h36m/',
data_prefix=dict(img='images/'),
test_mode=False,
pipeline=[])

# dna rendering dataset
dna_rendering_dataset = dict(
type='DNARenderingDataset',
data_root='data/dna_rendering_part1',
data_mode='topdown',
ann_file='instances.npz',
subset_frac=0.1,
pipeline=[dict(type='LoadMask', backend_args=backend_args)],
)

# mapping

aic_coco133 = [(0, 6), (1, 8), (2, 10), (3, 5), (4, 7), (5, 9), (6, 12),
Expand Down Expand Up @@ -604,14 +585,23 @@
pipeline=[])
ubody_datasets.append(ubody)

# h3wb dataset
h3wb_dataset = dict(
type='H36MWholeBodyDataset',
ann_file='annotation_body3d/h3wb_train_bbox.npz',
seq_len=1,
causal=True,
data_root='data/h36m/',
data_prefix=dict(img='images/'),
test_mode=False,
pipeline=[])

train_datasets = [
dataset_wb,
dataset_body,
dataset_face,
# dataset_hand,
*ubody_datasets,
h3wb_dataset,
# dna_rendering_dataset
]

# data loaders
Expand All @@ -626,20 +616,7 @@
pipeline=train_pipeline,
metainfo=dict(from_file='configs/_base_/datasets/h3wb.py'),
test_mode=False))

# hooks
default_hooks = dict(
checkpoint=dict(
type='CheckpointHook',
save_best='MPJPE',
rule='less',
max_keep_ckpts=1))

# hooks
# default_hooks = dict(
# checkpoint=dict(
# save_best='coco-wholebody/AP', rule='greater', max_keep_ckpts=1))

custom_hooks = [
dict(
type='EMAHook',
Expand All @@ -653,53 +630,65 @@
switch_pipeline=train_pipeline_stage2)
]

default_hooks = dict(
checkpoint=dict(
type='CheckpointHook',
save_best='MPJPE',
rule='less',
max_keep_ckpts=1))

# eval h3wb
val_dataloader = dict(
batch_size=64,
num_workers=10,
persistent_workers=True,
drop_last=False,
sampler=dict(type='DefaultSampler', shuffle=False, round_up=False),
dataset=dict(
type='H36MWholeBodyDataset',
ann_file='annotation_body3d/h3wb_train_bbox.npz',
seq_len=1,
causal=True,
data_root='data/h36m/',
data_prefix=dict(img='images/'),
test_mode=True,
pipeline=val_pipeline))
test_dataloader = val_dataloader

# evaluators
val_evaluator = [
dict(type='SimpleMPJPE', mode='mpjpe'),
dict(type='SimpleMPJPE', mode='p-mpjpe')
]
test_evaluator = val_evaluator

# eval coco
# val_dataloader = dict(
# batch_size=64,
# num_workers=10,
# persistent_workers=True,
# drop_last=False,
# sampler=dict(type='DefaultSampler', shuffle=False, round_up=False),
# dataset=dict(
# type='H36MWholeBodyDataset',
# ann_file='annotation_body3d/h3wb_train_bbox.npz',
# seq_len=1,
# causal=True,
# data_root='data/h36m/',
# data_prefix=dict(img='images/'),
# type='CocoWholeBodyDataset',
# data_root='data/coco/',
# data_mode='topdown',
# ann_file='annotations/coco_wholebody_val_v1.0.json',
# data_prefix=dict(img='val2017/'),
# test_mode=True,
# pipeline=val_pipeline))
# bbox_file='data/coco/person_detection_results/'
# 'COCO_val2017_detections_AP_H_56_person.json',
# pipeline=val_pipeline,
# ))
# test_dataloader = val_dataloader

# # evaluators
# val_evaluator = [
# dict(type='SimpleMPJPE', mode='mpjpe'),
# dict(type='SimpleMPJPE', mode='p-mpjpe')
# ]
# val_evaluator = dict(
# type='CocoWholeBodyMetric',
# ann_file='data/coco/' + 'annotations/coco_wholebody_val_v1.0.json')
# test_evaluator = val_evaluator

# eval coco
val_dataloader = dict(
batch_size=64,
num_workers=10,
persistent_workers=True,
drop_last=False,
sampler=dict(type='DefaultSampler', shuffle=False, round_up=False),
dataset=dict(
type='CocoWholeBodyDataset',
data_root='data/coco/',
data_mode='topdown',
ann_file='annotations/coco_wholebody_val_v1.0.json',
data_prefix=dict(img='val2017/'),
test_mode=True,
bbox_file='data/coco/person_detection_results/'
'COCO_val2017_detections_AP_H_56_person.json',
pipeline=val_pipeline,
))
test_dataloader = val_dataloader

# evaluators
val_evaluator = dict(
type='CocoWholeBodyMetric',
ann_file='data/coco/' + 'annotations/coco_wholebody_val_v1.0.json')
test_evaluator = val_evaluator
# hooks
# default_hooks = dict(
# checkpoint=dict(
# save_best='coco-wholebody/AP', rule='greater', max_keep_ckpts=1))
Loading

0 comments on commit fc87ebd

Please sign in to comment.