Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,18 +16,20 @@ model = from_pretrained_keras(
|
|
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 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
)(image)
|
25 |
|
26 |
# Add the batch axis
|
27 |
-
resized_image = tf.expand_dims(resized_image, axis=0)
|
|
|
28 |
|
29 |
# Predict
|
30 |
-
pred = model.predict(resized_image)
|
|
|
31 |
prob = float(pred[0][0])
|
32 |
|
33 |
scoring_output = {
|
|
|
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 |
|
35 |
scoring_output = {
|