使用mmpose

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是你可以参考的完整修改方案: 1. 修改 animal_2d_keypoint/topdown_heatmap/animalpose/td-hm_res50_8xb64-210e_animalpose-256x256.py 文件: ``` # 修改默认头文件 _head_ = ['head', 'nose', 'back', 'tail'] # 修改num_joints为4 model = dict( type='TopDown', pretrained='torchvision://resnet50', backbone=dict(type='ResNet', depth=50, num_stages=4, out_indices=(3, )), keypoint_head=dict( type='TopdownHeatmapSimpleHead', in_channels=2048, out_channels=4, loss_keypoint=dict(type='JointsMSELoss', use_target_weight=True)), train_cfg=dict(), test_cfg=dict( flip_test=True, post_process='unbiased', shift_heatmap=True, modulate_kernel=11)) # 修改数据集路径和类别数目 data_root = 'data/animalpose/' data = dict( samples_per_gpu=64, workers_per_gpu=2, train=dict( type='AnimalPoseDataset', ann_file=data_root + 'annotations/train.json', img_prefix=data_root + 'images/', data_cfg=data_cfg, pipeline=train_pipeline), val=dict( type='AnimalPoseDataset', ann_file=data_root + 'annotations/val.json', img_prefix=data_root + 'images/', data_cfg=data_cfg, pipeline=test_pipeline), test=dict( type='AnimalPoseDataset', ann_file=data_root + 'annotations/test.json', img_prefix=data_root + 'images/', data_cfg=data_cfg, pipeline=test_pipeline)) # 修改类别数目 classes = ('animal',) num_joints = 4 ``` 2. 修改 _base_/datasets/animalpose.py 文件: ``` # 修改默认头文件和关键点数目 _head_ = ['head', 'nose', 'back', 'tail'] num_joints = 4 # 修改数据集类别数目和关键点名称 class_names = ['animal'] keypoint_names = ['head', 'nose', 'back', 'tail'] ``` 3. 修改 _base_/default_runtime.py 文件: ``` # 修改默认头文件 _head_ = ['head', 'nose', 'back', 'tail'] ``` 修改完成后,你可以使用以下命令启动训练: ``` python tools/train.py configs/animal_2d_keypoint/topdown_heatmap/animalpose/td-hm_res50_8xb64-210e_animalpose-256x256.py ``` 希望这份修改方案对你有帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值