Update handler.py
Browse files- handler.py +1 -7
handler.py
CHANGED
@@ -202,14 +202,10 @@ class EndpointHandler():
|
|
202 |
continue
|
203 |
# batch_images.append(batch_paths[j])
|
204 |
elif isinstance(src, PIL.Image.Image):
|
205 |
-
print("OK")
|
206 |
# Handle PIL Image objects
|
207 |
new = src.convert("RGB")
|
208 |
-
print("OK")
|
209 |
new.load()
|
210 |
-
print("OK")
|
211 |
width, height = new.size
|
212 |
-
print("OK")
|
213 |
if width < 250 or height < 250:
|
214 |
print("OKERROR")
|
215 |
results[str(j)] = {'error': 'Image quality not high enough'}
|
@@ -217,9 +213,7 @@ class EndpointHandler():
|
|
217 |
raise Exception('Image quality not high enough')
|
218 |
|
219 |
batch_images.append(new)
|
220 |
-
|
221 |
-
valid_inputs.append(str(j))
|
222 |
-
print("OK")
|
223 |
|
224 |
|
225 |
except Exception as e:
|
|
|
202 |
continue
|
203 |
# batch_images.append(batch_paths[j])
|
204 |
elif isinstance(src, PIL.Image.Image):
|
|
|
205 |
# Handle PIL Image objects
|
206 |
new = src.convert("RGB")
|
|
|
207 |
new.load()
|
|
|
208 |
width, height = new.size
|
|
|
209 |
if width < 250 or height < 250:
|
210 |
print("OKERROR")
|
211 |
results[str(j)] = {'error': 'Image quality not high enough'}
|
|
|
213 |
raise Exception('Image quality not high enough')
|
214 |
|
215 |
batch_images.append(new)
|
216 |
+
validUrls.append(str(i)+str(j))
|
|
|
|
|
217 |
|
218 |
|
219 |
except Exception as e:
|