Update handler.py
Browse files- handler.py +3 -3
handler.py
CHANGED
|
@@ -32,7 +32,7 @@ class EndpointHandler():
|
|
| 32 |
return predictions_array
|
| 33 |
|
| 34 |
def __call__(self, event):
|
| 35 |
-
print(event["inputs"])
|
| 36 |
if "inputs" not in event:
|
| 37 |
return {
|
| 38 |
"statusCode": 400,
|
|
@@ -42,8 +42,8 @@ class EndpointHandler():
|
|
| 42 |
image_path = event["inputs"]
|
| 43 |
|
| 44 |
try:
|
| 45 |
-
image = urlopen(image_path).read()
|
| 46 |
-
predictions = self.predict_objects(
|
| 47 |
return {
|
| 48 |
"statusCode": 200,
|
| 49 |
"body": json.dumps(predictions),
|
|
|
|
| 32 |
return predictions_array
|
| 33 |
|
| 34 |
def __call__(self, event):
|
| 35 |
+
print('DATA TYPE:', type(event["inputs"]))
|
| 36 |
if "inputs" not in event:
|
| 37 |
return {
|
| 38 |
"statusCode": 400,
|
|
|
|
| 42 |
image_path = event["inputs"]
|
| 43 |
|
| 44 |
try:
|
| 45 |
+
#image = urlopen(image_path).read()
|
| 46 |
+
predictions = self.predict_objects(image_path)
|
| 47 |
return {
|
| 48 |
"statusCode": 200,
|
| 49 |
"body": json.dumps(predictions),
|