Spaces:
Runtime error
Runtime error
Commit
Β·
8918e11
1
Parent(s):
41b1504
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,15 +15,14 @@ def infer(original_image):
|
|
| 15 |
image = image.astype("float32") / 255.0
|
| 16 |
image = np.expand_dims(image, axis=0)
|
| 17 |
output_image = model.predict(image)
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
output_image =
|
| 24 |
-
output_image = Image.fromarray(output_image.numpy())
|
| 25 |
-
|
| 26 |
return output_image
|
|
|
|
| 27 |
|
| 28 |
iface = gr.Interface(
|
| 29 |
fn=infer,
|
|
|
|
| 15 |
image = image.astype("float32") / 255.0
|
| 16 |
image = np.expand_dims(image, axis=0)
|
| 17 |
output_image = model.predict(image)
|
| 18 |
+
output_image = output[0] * 255.0
|
| 19 |
+
output_image = output_image.clip(0, 255)
|
| 20 |
+
output_image = output_image.reshape(
|
| 21 |
+
(np.shape(output_image)[0], np.shape(output_image)[1], 3)
|
| 22 |
+
)
|
| 23 |
+
output_image = np.uint32(output_image)
|
|
|
|
|
|
|
| 24 |
return output_image
|
| 25 |
+
|
| 26 |
|
| 27 |
iface = gr.Interface(
|
| 28 |
fn=infer,
|