Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from PIL import Image
|
|
| 4 |
import numpy as np
|
| 5 |
|
| 6 |
# Load your custom regression model
|
| 7 |
-
model_path = "
|
| 8 |
model = tf.keras.models.load_model(model_path)
|
| 9 |
|
| 10 |
labels = ['Wartortle', 'Weedle', 'Weepinbell', 'Weezing']
|
|
@@ -13,7 +13,7 @@ labels = ['Wartortle', 'Weedle', 'Weepinbell', 'Weezing']
|
|
| 13 |
def predict_regression(image):
|
| 14 |
# Preprocess image
|
| 15 |
image = Image.fromarray(image.astype('uint8')) # Convert numpy array to PIL image
|
| 16 |
-
image = image.resize((
|
| 17 |
image = np.array(image)
|
| 18 |
print(image.shape)
|
| 19 |
# Predict
|
|
|
|
| 4 |
import numpy as np
|
| 5 |
|
| 6 |
# Load your custom regression model
|
| 7 |
+
model_path = "pokemon_model_tl.keras"
|
| 8 |
model = tf.keras.models.load_model(model_path)
|
| 9 |
|
| 10 |
labels = ['Wartortle', 'Weedle', 'Weepinbell', 'Weezing']
|
|
|
|
| 13 |
def predict_regression(image):
|
| 14 |
# Preprocess image
|
| 15 |
image = Image.fromarray(image.astype('uint8')) # Convert numpy array to PIL image
|
| 16 |
+
image = image.resize((150, 140)).convert('RGB') #resize the image to 28x28 and converts it to gray scale
|
| 17 |
image = np.array(image)
|
| 18 |
print(image.shape)
|
| 19 |
# Predict
|