Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,12 +3,12 @@ import tensorflow as tf
|
|
3 |
from tensorflow.keras.preprocessing import image
|
4 |
import matplotlib.pyplot as plt
|
5 |
import numpy as np
|
6 |
-
|
7 |
# Load the model
|
8 |
model = tf.keras.models.load_model('dogcat_model_bak.h5')
|
9 |
|
10 |
def classify_image(input_image):
|
11 |
-
pil_img =
|
12 |
# Preprocess the image
|
13 |
img1 = pil_img.resize((64, 64))
|
14 |
img2 = pil_img
|
|
|
3 |
from tensorflow.keras.preprocessing import image
|
4 |
import matplotlib.pyplot as plt
|
5 |
import numpy as np
|
6 |
+
from PIL import Image as PIL_Image
|
7 |
# Load the model
|
8 |
model = tf.keras.models.load_model('dogcat_model_bak.h5')
|
9 |
|
10 |
def classify_image(input_image):
|
11 |
+
pil_img = PIL_Image.fromarray(input_image.astype('uint8'), 'RGB')
|
12 |
# Preprocess the image
|
13 |
img1 = pil_img.resize((64, 64))
|
14 |
img2 = pil_img
|