TeacherPuffy
commited on
Update preprocess.py
Browse files- preprocess.py +2 -2
preprocess.py
CHANGED
@@ -7,9 +7,9 @@ from PIL import Image
|
|
7 |
def preprocess_image(example, image_size):
|
8 |
image = example['image'].convert('RGB') # Directly use the PIL image
|
9 |
transform = transforms.Compose([
|
10 |
-
transforms.Resize((image_size, image_size)),
|
11 |
transforms.ToTensor(),
|
12 |
-
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
13 |
])
|
14 |
image = transform(image)
|
15 |
return {'image': image, 'label': example['label']}
|
|
|
7 |
def preprocess_image(example, image_size):
|
8 |
image = example['image'].convert('RGB') # Directly use the PIL image
|
9 |
transform = transforms.Compose([
|
10 |
+
#transforms.Resize((image_size, image_size)),
|
11 |
transforms.ToTensor(),
|
12 |
+
#transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
13 |
])
|
14 |
image = transform(image)
|
15 |
return {'image': image, 'label': example['label']}
|