mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-19 22:00:35 +08:00
Summary: Signed-off-by: Michele Sanna <sanna@arrival.com> fixes the bin_size calculation with a formula for any image_size > 64. Matches the values chosen so far. simple test: ``` import numpy as np import matplotlib.pyplot as plt image_size = np.arange(64, 2048) bin_size = np.where(image_size <= 64, 8, (2 ** np.maximum(np.ceil(np.log2(image_size)) - 4, 4)).astype(int)) print(image_size) print(bin_size) for ims, bins in zip(image_size, bin_size): if ims <= 64: assert bins == 8 elif ims <= 256: assert bins == 16 elif ims <= 512: assert bins == 32 elif ims <= 1024: assert bins == 64 elif ims <= 2048: assert bins == 128 assert (ims + bins - 1) // bins < 22 plt.plot(image_size, bin_size) plt.grid() plt.show() ```  Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/90 Reviewed By: jcjohnson Differential Revision: D21160372 Pulled By: nikhilaravi fbshipit-source-id: 660cf5832f4ca5be243c435a6bed969596fc0188