fix the bug about the image dimension

master
Wei-Cheng Tseng 3 years ago
parent b02703bec5
commit 7b6dfba1d1

3
.gitignore vendored

@ -6,4 +6,5 @@
*.npz
*.dae
data/*
logs/*
logs/*
.vscode/

@ -81,7 +81,11 @@ def load_blender_data(basedir, half_res=False, testskip=1):
imgs_half_res = np.zeros((imgs.shape[0], H, W, 4))
for i, img in enumerate(imgs):
imgs_half_res[i] = cv2.resize(img, (H, W), interpolation=cv2.INTER_AREA)
# According to the api defined in the link below, the dimension
# should be represented as (W, H).
# https://www.tutorialkart.com/opencv/python/opencv-python-resize-image/
imgs_half_res[i] = cv2.resize(img, (W, H), interpolation=cv2.INTER_AREA)
# imgs_half_res[i] = cv2.resize(img, (H, W), interpolation=cv2.INTER_AREA)
imgs = imgs_half_res
# imgs = tf.image.resize_area(imgs, [400, 400]).numpy()

Loading…
Cancel
Save