This commit is contained in:
Matt Tancik committed 2022-12-22 10:05:50 -08:00
1 parent 0de536c268
commit b09efbb8ab
1 file changed
+1 -1
+1 -1
View File
@@ -66,7 +66,7 @@ class InputDataset(Dataset):
pil_image = pil_image.resize(newsize, resample=Image.BILINEAR)
image = np.array(pil_image, dtype="uint8") # shape is (h, w) or (h, w, 3 or 4)
if len(image.shape) == 2:
image = (image[:, :, None].repeat(3, axis=2))
image = image[:, :, None].repeat(3, axis=2)
assert len(image.shape) == 3
assert image.dtype == np.uint8
assert image.shape[2] in [3, 4], f"Image shape of {image.shape} is in correct."