@@ -33,14 +33,15 @@ def preprocess(image):
3333 image = [image ]
3434
3535 if isinstance (image [0 ], PIL .Image .Image ):
36- w , h = image [0 ].size
37- w , h = map (lambda x : x - x % 32 , (w , h )) # resize to integer multiple of 32
38-
39- image = [np .array (i .resize ((w , h ), resample = PIL_INTERPOLATION ["lanczos" ]))[None , :] for i in image ]
40- image = np .concatenate (image , axis = 0 )
41- image = np .array (image ).astype (np .float32 ) / 255.0
42- image = image .transpose (0 , 3 , 1 , 2 )
43- image = 2.0 * image - 1.0
36+ #w, h = image[0].size
37+ #w, h = map(lambda x: x - x % 32, (w, h)) # resize to integer multiple of 32
38+
39+ #image = [np.array(i.resize((w, h), resample=PIL_INTERPOLATION["lanczos"]))[None, :] for i in image]
40+ #image = np.concatenate(image, axis=0)
41+ #image = np.array(image).astype(np.float32) / 255.0
42+ #image = image.transpose(0, 3, 1, 2)
43+ #image = 2.0 * image - 1.0
44+ image = image .convert ("RGB" )
4445 image = torch .from_numpy (image )
4546 elif isinstance (image [0 ], torch .Tensor ):
4647 image = torch .cat (image , dim = 0 )
0 commit comments