Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -271,6 +271,9 @@ def segment_image(image):
|
|
| 271 |
return image, legend, stats, superimposed_image
|
| 272 |
|
| 273 |
def superimpose_images(image1, image2, alpha=0.5):
|
|
|
|
|
|
|
|
|
|
| 274 |
# Convert NumPy arrays to PIL images
|
| 275 |
image1 = Image.fromarray(image1)
|
| 276 |
|
|
|
|
| 271 |
return image, legend, stats, superimposed_image
|
| 272 |
|
| 273 |
def superimpose_images(image1, image2, alpha=0.5):
|
| 274 |
+
|
| 275 |
+
if image1.dtype != np.uint8:
|
| 276 |
+
image1 = (image1 * 255).astype(np.uint8) if image1.max() <= 1 else image1.astype(np.uint8)
|
| 277 |
# Convert NumPy arrays to PIL images
|
| 278 |
image1 = Image.fromarray(image1)
|
| 279 |
|