rongliangzi / Dense-Scale-Network-for-Crowd-Counting

An unofficial implement of paper "Dense Scale Network for Crowd Counting", link: https://arxiv.org/abs/1906.09707
31 stars 8 forks source link

cv2 interpolation to resize the target #8

Open victorjourne opened 2 years ago

victorjourne commented 2 years ago

It would be more accurate to use the INTER_AREA interpolation than the INTER_CUBIC one for the resize of the target. Indeed, this downsampling is more natural here because it computes the weighted average of pixels.

Moreover, the rescale should be normalized with int(target.shape[0]) * int(target.shape[1])/ (int(target.shape[1]/ratio) * int(target.shape[0]/ratio)) rather than ratio**2.

It is not that minor, the current resize produces 1% of error.

I will make a PR for that!

Thanks

rongliangzi commented 2 years ago

Much appreciation for your contribution!