Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,8 @@ model = tf.keras.models.load_model(
|
|
26 |
# 3.prediction function (predict())
|
27 |
|
28 |
def load_and_prep_imgg(filename, img_shape=224, scale=True):
|
|
|
|
|
29 |
img = tf.io.read_file(filename)
|
30 |
img = tf.io.decode_image(img, channels=3)
|
31 |
img = tf.image.resize(img, size=[img_shape, img_shape])
|
|
|
26 |
# 3.prediction function (predict())
|
27 |
|
28 |
def load_and_prep_imgg(filename, img_shape=224, scale=True):
|
29 |
+
if not isinstance(filename, str):
|
30 |
+
raise ValueError("The filename must be a string representing the file path.")
|
31 |
img = tf.io.read_file(filename)
|
32 |
img = tf.io.decode_image(img, channels=3)
|
33 |
img = tf.image.resize(img, size=[img_shape, img_shape])
|