xingyizhou / CenterNet

Object detection, 3D detection, and pose estimation using center point detection:
MIT License
7.24k stars 1.92k forks source link

why Hourglass-104 predict two output? #573

Open MTfast opened 4 years ago

MTfast commented 4 years ago

from ~/CenterNet-master/src/lib/models/networks/large_hourglass.py

def forward(self, image):
    # print('image shape', image.shape)
    inter = self.pre(image)         
    outs  = []

    for ind in range(self.nstack):
        kp_, cnv_  = self.kps[ind], self.cnvs[ind]
        kp  = kp_(inter)                
        cnv = cnv_(kp)                 

        out = {}
        for head in self.heads:         
            layer = self.__getattr__(head)[ind]
            y = layer(cnv)
            out[head] = y

        outs.append(out)                
        if ind < self.nstack - 1:
            inter = self.inters_[ind](inter) + self.cnvs_[ind](cnv)
            inter = self.relu(inter)
            inter = self.inters[ind](inter)
    return outs                 # 最终的得到的outs是有两个字典(两次预测结果)的列表

why Hourglass-104 predict two output? and when compute the loss functions, take the average of two results

xingyizhou commented 4 years ago

It is the stacked-hourglass design. It has an intermediate output.