Spaces:
Runtime error
Runtime error
Commit
Β·
b47adfd
1
Parent(s):
ba795af
Update app.py
Browse files
app.py
CHANGED
@@ -15,14 +15,14 @@ def infer(original_image):
|
|
15 |
image = keras.preprocessing.image.img_to_array(original_image)
|
16 |
image = image.astype("float32") / 255.0
|
17 |
image = np.expand_dims(image, axis=0)
|
18 |
-
|
19 |
output = model.predict(image)
|
20 |
# print(len(output))
|
21 |
# print([len(a) for a in output])
|
22 |
output_image = output[0] * 255.0
|
23 |
output_image = output_image.clip(0, 255)
|
24 |
output_image = output_image.reshape(
|
25 |
-
(np.shape(
|
26 |
)
|
27 |
output_image = np.uint32(output_image)
|
28 |
|
|
|
15 |
image = keras.preprocessing.image.img_to_array(original_image)
|
16 |
image = image.astype("float32") / 255.0
|
17 |
image = np.expand_dims(image, axis=0)
|
18 |
+
|
19 |
output = model.predict(image)
|
20 |
# print(len(output))
|
21 |
# print([len(a) for a in output])
|
22 |
output_image = output[0] * 255.0
|
23 |
output_image = output_image.clip(0, 255)
|
24 |
output_image = output_image.reshape(
|
25 |
+
(np.shape(image)[0], np.shape(image)[1], 3)
|
26 |
)
|
27 |
output_image = np.uint32(output_image)
|
28 |
|