json response
Browse files
app.py
CHANGED
|
@@ -35,6 +35,10 @@ def read_image(image_file: bytes = File(...)):
|
|
| 35 |
f"Detected {model.config.id2label[label.item()]} with confidence "
|
| 36 |
f"{round(score.item(), 3)} at location {box}"
|
| 37 |
)
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
|
|
|
|
| 35 |
f"Detected {model.config.id2label[label.item()]} with confidence "
|
| 36 |
f"{round(score.item(), 3)} at location {box}"
|
| 37 |
)
|
| 38 |
+
response = {}
|
| 39 |
+
response['scores'] = results['scores']
|
| 40 |
+
response['labels'] = results['labels']
|
| 41 |
+
response['boxes'] = results['boxes']
|
| 42 |
+
return response
|
| 43 |
|
| 44 |
|