Merge pull request #20 from WeiChengTseng/master

fix the bug about the image dimension
This commit is contained in:
Yen-Chen Lin 2020-12-30 10:03:38 -05:00 committed by GitHub
commit d2d9d7dc7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

3
.gitignore vendored
View file

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

View file

@ -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()