scnuhealthy / Tensorflow_PersonLab

Tensorflow implementation of PersonLab (https://arxiv.org/abs/1803.08225)
83 stars 19 forks source link

bilinear interpolation in accumulate_votes #9

Open AlonMendelson opened 4 years ago

AlonMendelson commented 4 years ago

Hi, thanks a lot for the implementation. there's something that i couldn't figure out after reading the paper and reviewing the code. during the computation of the heatmaps the accumulate_votes function is called and some sort of bilinear interpolation is made. could someone please clarify which function is interpolated (in the code it seems to me that the values of this function are stored in the variable ps) and where do the interpolation weights come from (dx,dy) and what do they mean? i'm referring to the following part of the code in the post_proc.py: def accumulate_votes(votes, shape): xs = votes[:,0] ys = votes[:,1] ps = votes[:,2] tl = [np.floor(ys).astype('int32'), np.floor(xs).astype('int32')] tr = [np.floor(ys).astype('int32'), np.ceil(xs).astype('int32')] bl = [np.ceil(ys).astype('int32'), np.floor(xs).astype('int32')] br = [np.ceil(ys).astype('int32'), np.ceil(xs).astype('int32')] dx = xs - tl[1] dy = ys - tl[0] tl_vals = ps(1.-dx)(1.-dy) tr_vals = psdx(1.-dy) bl_vals = psdy(1.-dx) br_vals = psdydx