Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -130,11 +130,11 @@ def distortion_free_resize(image, img_size):
|
|
130 |
image = tf.image.flip_left_right(image)
|
131 |
return image
|
132 |
|
133 |
-
def decode_batch_predictions(
|
134 |
|
135 |
img_size=(128, 32)
|
136 |
-
input_image = tf.
|
137 |
-
input_image = tf.
|
138 |
input_image = distortion_free_resize(input_image, img_size)
|
139 |
input_image = tf.image.convert_image_dtype(input_image, tf.float32)/255.0
|
140 |
|
|
|
130 |
image = tf.image.flip_left_right(image)
|
131 |
return image
|
132 |
|
133 |
+
def decode_batch_predictions(img_path):
|
134 |
|
135 |
img_size=(128, 32)
|
136 |
+
input_image = tf.io.read_file(img_path)
|
137 |
+
input_image = tf.io.decode_png(input_image, channels=1)
|
138 |
input_image = distortion_free_resize(input_image, img_size)
|
139 |
input_image = tf.image.convert_image_dtype(input_image, tf.float32)/255.0
|
140 |
|