Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,6 +48,9 @@ def process_image(input_image):
|
|
48 |
output_image = prediction[0] * 0.5 + 0.5 # Denormalize to [0, 1]
|
49 |
output_image = tf.clip_by_value(output_image, 0, 1)
|
50 |
|
|
|
|
|
|
|
51 |
# Convert to numpy array and then to PIL Image
|
52 |
output_array = (output_image.numpy() * 255).astype(np.uint8)
|
53 |
output_pil = Image.fromarray(output_array)
|
|
|
48 |
output_image = prediction[0] * 0.5 + 0.5 # Denormalize to [0, 1]
|
49 |
output_image = tf.clip_by_value(output_image, 0, 1)
|
50 |
|
51 |
+
# Resize the output image to the desired resolution
|
52 |
+
output_image = tf.image.resize(output_image, output_resolution, method='bilinear')
|
53 |
+
|
54 |
# Convert to numpy array and then to PIL Image
|
55 |
output_array = (output_image.numpy() * 255).astype(np.uint8)
|
56 |
output_pil = Image.fromarray(output_array)
|