orhir / PoseAnything

A Graph-Based Approach for Category-Agnostic Pose Estimation [ECCV 2024]
https://orhir.github.io/pose-anything/
Apache License 2.0
308 stars 17 forks source link

Training on custom dataset #9

Closed williamhoole closed 6 months ago

williamhoole commented 6 months ago

Is it possible to train/ fine tune the model on a custom dataset?

orhir commented 6 months ago

Of course it is. You will need to change the config file to refer to the new annotation file, by changing the 'data' var in the config.

for example:

data = dict(
    samples_per_gpu=16,
    workers_per_gpu=8,
    train=dict(
        type='TransformerPoseDataset',
        ann_file=f'NEW_ANNOTATION.json',
        img_prefix=f'{NEW_IMAGE_ROOT/',
        # img_prefix=f'{data_root}',
        data_cfg=data_cfg,
        valid_class_ids=None,
        max_kpt_num=channel_cfg['max_kpt_num'],
        num_shots=1,
        pipeline=train_pipeline),

Keep in mind the new annotation should have similar structure as the original MP100 dataset annotation.