Commit
·
0c58d1b
1
Parent(s):
a00846a
Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -30,13 +30,13 @@ class EndpointHandler():
|
|
| 30 |
return predictions_array
|
| 31 |
|
| 32 |
def __call__(self, event):
|
| 33 |
-
if "
|
| 34 |
return {
|
| 35 |
"statusCode": 400,
|
| 36 |
"body": json.dumps("Error: Please provide an 'image_path' parameter."),
|
| 37 |
}
|
| 38 |
|
| 39 |
-
image_path = event["
|
| 40 |
|
| 41 |
try:
|
| 42 |
predictions = self.predict_objects(image_path)
|
|
|
|
| 30 |
return predictions_array
|
| 31 |
|
| 32 |
def __call__(self, event):
|
| 33 |
+
if "inputs" not in event:
|
| 34 |
return {
|
| 35 |
"statusCode": 400,
|
| 36 |
"body": json.dumps("Error: Please provide an 'image_path' parameter."),
|
| 37 |
}
|
| 38 |
|
| 39 |
+
image_path = event["inputs"]
|
| 40 |
|
| 41 |
try:
|
| 42 |
predictions = self.predict_objects(image_path)
|