zhengli97 / OKDHP

[ICCV 2021] Official PyTorch Code for "Online Knowledge Distillation for Efficient Pose Estimation"
https://zhengli97.github.io/OKDHP/
43 stars 4 forks source link

question about heatmap_concat in hourglass_okd_share_less.py #8

Closed CatDroid closed 1 month ago

CatDroid commented 2 months ago

in hourglass_okd_share_less.py

class HourglassNet(nn.Module):
   ....
  def forward(self, x):
     ...
     heatmap_concat = torch.cat([out[-3].unsqueeze(1), out[-2].unsqueeze(1), out[-1].unsqueeze(1)], dim=1)

I think 'out' is in the following order (4-stack hourglass, blance branch , share 2-stack)

 out = [ 
    shared_hourglass-0,
    shared_hourglass-1, 
    branch-0-hourglass-0,
    branch-0-hourglass-1,
    branch-1-hourglass-0,
    branch-1-hourglass-1,   # out[-3]
    branch-2-hourglass-0,  # out[-2]
    branch-2-hourglass-1,  # out[-1]
    ]

so , out[-3] out[-2] out[-1] is branch-1-hourglass-1 branch-2-hourglass-0 and branch-2-hourglass-1 , instead of branch-0-hourglass-1, branch-1-hourglass-1, branch-2-hourglass-1? ( in the paper, 'ensemble heatmap' is 'each branch outputs' sum ' ? right ?)

zhengli97 commented 1 month ago

Since this work was done so long ago, I don't remember the exact order of this output. I suggest you reproduce the result and print the output of each branch to see the order.