Spaces:
Runtime error
Runtime error
Commit
·
02c03be
1
Parent(s):
3e0e577
Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,12 @@ def process_images(files, blending_weight=0.5):
|
|
10 |
|
11 |
# Ensure all images have the same data type (CV_8U)
|
12 |
for i in range(len(images)):
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
15 |
|
16 |
# Perform the image operation (e.g., blending)
|
17 |
result_image = images[0].copy()
|
|
|
10 |
|
11 |
# Ensure all images have the same data type (CV_8U)
|
12 |
for i in range(len(images)):
|
13 |
+
# Ensure the image is a NumPy array and has the desired data type
|
14 |
+
if images is not None:
|
15 |
+
images = images.astype(np.uint8)
|
16 |
+
else:
|
17 |
+
# Handle the case where the image couldn't be loaded
|
18 |
+
print("Failed to load the image")
|
19 |
|
20 |
# Perform the image operation (e.g., blending)
|
21 |
result_image = images[0].copy()
|