mks0601 / PoseFix_RELEASE

Official TensorFlow implementation of "PoseFix: Model-agnostic General Human Pose Refinement Network", CVPR 2019
MIT License
329 stars 64 forks source link

Algorithm error #30

Closed HuangJunJie2017 closed 5 years ago

HuangJunJie2017 commented 5 years ago

in lib/tfflat/base.py iou algorithm will it has impact on the training process? ymax = np.minimum(dst_roi[:,1]+dst_roi[:,3], src_roi[:,0]+src_roi[:,3]) -> ymax = np.minimum(dst_roi[:,1]+dst_roi[:,3], src_roi[:,1]+src_roi[:,3])

def compute_iou(self, src_roi, dst_roi):

    # IoU calculate with GTs
    xmin = np.maximum(dst_roi[:,0], src_roi[:,0])
    ymin = np.maximum(dst_roi[:,1], src_roi[:,1])
    xmax = np.minimum(dst_roi[:,0]+dst_roi[:,2], src_roi[:,0]+src_roi[:,2])
    ymax = np.minimum(dst_roi[:,1]+dst_roi[:,3], src_roi[:,0]+src_roi[:,3])

    interArea = np.maximum(0, xmax - xmin) * np.maximum(0, ymax - ymin)

    boxAArea = dst_roi[:,2] * dst_roi[:,3]
    boxBArea = np.tile(src_roi[:,2] * src_roi[:,3],(len(dst_roi),1))
    sumArea = boxAArea + boxBArea

    iou = interArea / (sumArea - interArea + 1e-5)

    return iou
mks0601 commented 5 years ago

Oh thank you for finding out bug. I think that should be changed to yours. But I think that might effect overall performance marginally because this is only used to synthesize input pose when

  1. there are many people in the input image
  2. the joint is not annotated in the dataset

Anyway, great thanks!