Pytorch-Keypoint-Detection icon indicating copy to clipboard operation
Pytorch-Keypoint-Detection copied to clipboard

关于分割和关键点检测

Open lichunxiang93 opened this issue 6 years ago • 3 comments

请问我如何同时实现分割和关键点检测任务?

lichunxiang93 avatar Nov 07 '19 09:11 lichunxiang93

分割任务可以参考官网教程https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html。 要实现分割和关键点检测可以有如下思路: 1 分开训练两个模型,最后将结果拼在一起 2 更改mask-rcnn的结构,输出的mask分为两部分,一是用于分割用,channel数量是你的类别数; 二是用于关键点检测用的,channel数是你的关键点数量。 这两种mask的输出结果是concat在一起的,同时进行监督,输入的dataset也需要你去重写。整体代码量较大,需要熟读pytorch实现mask r-cnn的源码。

scnuhealthy avatar Nov 08 '19 06:11 scnuhealthy

我看了torchvision中的源码,源码中dataset会根据数据集中是否有keypoints和mask获得对应的标签字典,我在想是否可以直接在您代码上再加入一个keypoint检测分支即可,源码中会根据mask和keypoint分支类型的实现计算得到loss字典。正在尝试该方法......

lichunxiang93 avatar Nov 08 '19 07:11 lichunxiang93

需要做的是增加一个head,为此还需要增加这个head的监督代码和dataset代码。 在这个逻辑上,如果mmdetection框架的话,可能实现起来会更快。

scnuhealthy avatar Nov 08 '19 07:11 scnuhealthy