yashzambre commited on
Commit
02c03be
·
1 Parent(s): 3e0e577

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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
- if images[i].dtype != np.uint8:
14
- images[i] = images[i].astype(np.uint8)
 
 
 
 
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()