Update handler.py
Browse files- handler.py +1 -3
handler.py
CHANGED
|
@@ -34,7 +34,6 @@ class EndpointHandler():
|
|
| 34 |
return predictions_array
|
| 35 |
|
| 36 |
def __call__(self, event):
|
| 37 |
-
print('DATA TYPE:', type(event["inputs"]))
|
| 38 |
if "inputs" not in event:
|
| 39 |
return {
|
| 40 |
"statusCode": 400,
|
|
@@ -44,8 +43,7 @@ class EndpointHandler():
|
|
| 44 |
image_path = event["inputs"]
|
| 45 |
|
| 46 |
try:
|
| 47 |
-
image = Image.Image()._new(Image.open(BytesIO(image_path)))
|
| 48 |
-
#image = urlopen(image_path).read()
|
| 49 |
predictions = self.predict_objects(image)
|
| 50 |
return {
|
| 51 |
"statusCode": 200,
|
|
|
|
| 34 |
return predictions_array
|
| 35 |
|
| 36 |
def __call__(self, event):
|
|
|
|
| 37 |
if "inputs" not in event:
|
| 38 |
return {
|
| 39 |
"statusCode": 400,
|
|
|
|
| 43 |
image_path = event["inputs"]
|
| 44 |
|
| 45 |
try:
|
| 46 |
+
image = Image.Image()._new(Image.open(BytesIO(urlopen(image_path).read())))
|
|
|
|
| 47 |
predictions = self.predict_objects(image)
|
| 48 |
return {
|
| 49 |
"statusCode": 200,
|