Update handler.py
Browse files- handler.py +6 -7
handler.py
CHANGED
|
@@ -17,13 +17,12 @@ class EndpointHandler():
|
|
| 17 |
cords = [round(x) for x in cords]
|
| 18 |
conf = round(box.conf[0].item(), 2)
|
| 19 |
prediction = {
|
| 20 |
-
"
|
| 21 |
-
"
|
| 22 |
-
"
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
"height": cords[3]}
|
| 27 |
}
|
| 28 |
predictions.append(prediction)
|
| 29 |
predictions_array = {"predictions": predictions}
|
|
|
|
| 17 |
cords = [round(x) for x in cords]
|
| 18 |
conf = round(box.conf[0].item(), 2)
|
| 19 |
prediction = {
|
| 20 |
+
"class": class_id,
|
| 21 |
+
"confidence": conf,
|
| 22 |
+
"x": cords[0],
|
| 23 |
+
"y": cords[1],
|
| 24 |
+
"width": cords[2],
|
| 25 |
+
"height": cords[3]
|
|
|
|
| 26 |
}
|
| 27 |
predictions.append(prediction)
|
| 28 |
predictions_array = {"predictions": predictions}
|