Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ labels = ['Afghan', 'African Wild Dog', 'Airedale', 'American Hairless', 'Americ
|
|
| 20 |
def predict_regression(image):
|
| 21 |
# Preprocess image
|
| 22 |
image = Image.fromarray(image.astype('uint8')) # Convert numpy array to PIL image
|
| 23 |
-
image = image.resize((
|
| 24 |
image = np.array(image)
|
| 25 |
print(image.shape)
|
| 26 |
# Predict
|
|
|
|
| 20 |
def predict_regression(image):
|
| 21 |
# Preprocess image
|
| 22 |
image = Image.fromarray(image.astype('uint8')) # Convert numpy array to PIL image
|
| 23 |
+
image = image.resize((150, 150)).convert('L') #resize the image to 150x150 and converts it to gray scale
|
| 24 |
image = np.array(image)
|
| 25 |
print(image.shape)
|
| 26 |
# Predict
|