ajflorez commited on
Commit
47c1d36
Β·
verified Β·
1 Parent(s): c1afb96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -170,9 +170,9 @@ def main_function(plan_name, uploaded_file, interference = True, aps_int = 0, ap
170
  plan_image = np.array(Image.open(uploaded_file.name))/255
171
 
172
  dimensiones = plan_image.shape
173
- if dimensiones[0] != 256 or dimensiones[1] != 256 or dimensiones[3] != 3:
174
  # raise gradio.Error("Error in dimensions of the uploaded image. Must [256,256,3] πŸ’£πŸŽ†.", duration=5)
175
- raise ValueError("Error in image size. Must [256,256,3].")
176
 
177
  plan_grayscale = plan_image[:, :, 0]
178
  plan_in = 1 - plan_grayscale
 
170
  plan_image = np.array(Image.open(uploaded_file.name))/255
171
 
172
  dimensiones = plan_image.shape
173
+ if len(dimensiones) > 2:
174
  # raise gradio.Error("Error in dimensions of the uploaded image. Must [256,256,3] πŸ’£πŸŽ†.", duration=5)
175
+ raise ValueError("Error in image size. Must [256,256].")
176
 
177
  plan_grayscale = plan_image[:, :, 0]
178
  plan_in = 1 - plan_grayscale