Spaces:
Runtime error
Runtime error
Update app.py
Browse filesRemoved image resizing from "predict" function because it is now part of the model itself
app.py
CHANGED
@@ -15,20 +15,10 @@ model = from_pretrained_keras(
|
|
15 |
# This is the predict function that takes as input an array-like-image and produces
|
16 |
# the probabilities that this image is either spam or ham
|
17 |
def predict(image):
|
18 |
-
# Resize image
|
19 |
-
#resized_image = keras.layers.Resizing(
|
20 |
-
# IMAGE_SIZE[0],
|
21 |
-
# IMAGE_SIZE[1],
|
22 |
-
# interpolation="bilinear",
|
23 |
-
# crop_to_aspect_ratio=True
|
24 |
-
#)(image)
|
25 |
-
|
26 |
# Add the batch axis
|
27 |
-
#resized_image = tf.expand_dims(resized_image, axis=0)
|
28 |
image = tf.expand_dims(image, axis=0)
|
29 |
|
30 |
# Predict
|
31 |
-
#pred = model.predict(resized_image)
|
32 |
pred = model.predict(image)
|
33 |
prob = float(pred[0][0])
|
34 |
|
|
|
15 |
# This is the predict function that takes as input an array-like-image and produces
|
16 |
# the probabilities that this image is either spam or ham
|
17 |
def predict(image):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
# Add the batch axis
|
|
|
19 |
image = tf.expand_dims(image, axis=0)
|
20 |
|
21 |
# Predict
|
|
|
22 |
pred = model.predict(image)
|
23 |
prob = float(pred[0][0])
|
24 |
|