Hi thanks for your work ,i found some questions about this code in utils/crop_and_pad functions
if any([top, bottom, left, right]):
te_im = np.zeros((r + top + bottom, c + left + right, k), np.uint8) # 0 is better than 1 initialization
te_im[top:top + r, left:left + c, :] = img
if top:
te_im[0:top, left:left + c, :] = img_mean
if bottom:
te_im[r + top:, left:left + c, :] = img_mean
if left:
te_im[:, 0:left, :] = img_mean
if right:
te_im[:, c + left:, :] = img_mean
whether it should be change to
if any([top, bottom, left, right]):
te_im = np.zeros((r + top + bottom, c + left + right, k), np.uint8) # 0 is better than 1 initialization
te_im[top:top + r, left:left + c, :] = img
if top:
te_im[0:top,; , :] = img_mean
if bottom:
te_im[r + top:, ;, :] = img_mean
if left:
te_im[:, 0:left, :] = img_mean
if right:
te_im[:, c + left:, :] = img_mean
and the other problem is that it takes a longtime to run bin/create_dataset and bin/create_lmdb
thank you!
Hi thanks for your work ,i found some questions about this code in utils/crop_and_pad functions if any([top, bottom, left, right]): te_im = np.zeros((r + top + bottom, c + left + right, k), np.uint8) # 0 is better than 1 initialization te_im[top:top + r, left:left + c, :] = img if top: te_im[0:top, left:left + c, :] = img_mean if bottom: te_im[r + top:, left:left + c, :] = img_mean if left: te_im[:, 0:left, :] = img_mean if right: te_im[:, c + left:, :] = img_mean
whether it should be change to if any([top, bottom, left, right]): te_im = np.zeros((r + top + bottom, c + left + right, k), np.uint8) # 0 is better than 1 initialization te_im[top:top + r, left:left + c, :] = img if top: te_im[0:top,; , :] = img_mean if bottom: te_im[r + top:, ;, :] = img_mean if left: te_im[:, 0:left, :] = img_mean if right: te_im[:, c + left:, :] = img_mean and the other problem is that it takes a longtime to run bin/create_dataset and bin/create_lmdb thank you!