Update app.py
Browse files
app.py
CHANGED
@@ -166,6 +166,11 @@ def main_function(plan_name, uploaded_file, interference = True, aps_int = 0, ap
|
|
166 |
# Load plan
|
167 |
if plan_name == "Upload your own image" and uploaded_file is not None:
|
168 |
plan_image = np.array(Image.open(uploaded_file.name))/255
|
|
|
|
|
|
|
|
|
|
|
169 |
plan_grayscale = plan_image[:, :, 0]
|
170 |
plan_in = 1 - plan_grayscale
|
171 |
|
|
|
166 |
# Load plan
|
167 |
if plan_name == "Upload your own image" and uploaded_file is not None:
|
168 |
plan_image = np.array(Image.open(uploaded_file.name))/255
|
169 |
+
|
170 |
+
dimensiones = plan_image.shape
|
171 |
+
if dimensiones[0] != 256 or dimensiones[1] != 256 or dimensiones[3] != 3:
|
172 |
+
raise ValueError("Error in image size. Must [256,256,3].")
|
173 |
+
|
174 |
plan_grayscale = plan_image[:, :, 0]
|
175 |
plan_in = 1 - plan_grayscale
|
176 |
|