pytorch-pose-estimation icon indicating copy to clipboard operation
pytorch-pose-estimation copied to clipboard

Misalignment error

Open lck1201 opened this issue 5 years ago • 0 comments

Hi, you resize(bilinear upsample) the output heatmap and paf to original image size, however, the outputs comes from padded images. Since you have changedthe height-width ratio, would it cause misalignment error?

for i, scale in enumerate(multiplier):
        img_test = cv2.resize(img_raw, (0, 0), fx=scale, fy=scale, interpolation=cv2.INTER_CUBIC)
        img_test_pad, pad = pad_right_down_corner(img_test, param_stride, param_stride)
        img_test_pad = np.transpose(np.float32(img_test_pad[:, :, :, np.newaxis]), (3, 2, 0, 1)) / 256 - 0.5

        feed = Variable(torch.from_numpy(img_test_pad)).cuda()
        output1, output2 = model(feed)

        print(output1.size())
        print(output2.size())

        heatmap = nn.UpsamplingBilinear2d((img_raw.shape[0], img_raw.shape[1])).cuda()(output2)

        paf = nn.UpsamplingBilinear2d((img_raw.shape[0], img_raw.shape[1])).cuda()(output1)

lck1201 avatar Apr 01 '19 04:04 lck1201