Spaces:
Running
Running
change response type
Browse files
main.py
CHANGED
|
@@ -123,7 +123,7 @@ async def classify_image(file: UploadFile = File(None)):
|
|
| 123 |
response_data = {
|
| 124 |
# "prediction": predicted_label,
|
| 125 |
"prediction": predicted_label["label"],
|
| 126 |
-
"confidence":confidence,
|
| 127 |
}
|
| 128 |
# Use the model to classify the image
|
| 129 |
# results = model(image)
|
|
@@ -219,7 +219,7 @@ async def classify_images(request: ImageUrlsRequest):
|
|
| 219 |
detection_result = {
|
| 220 |
# "prediction": predicted_label,
|
| 221 |
"prediction": predicted_label["label"],
|
| 222 |
-
"confidence":confidence,
|
| 223 |
}
|
| 224 |
# Use the model to classify the image
|
| 225 |
# results = model(image)
|
|
|
|
| 123 |
response_data = {
|
| 124 |
# "prediction": predicted_label,
|
| 125 |
"prediction": predicted_label["label"],
|
| 126 |
+
"confidence": str(confidence),
|
| 127 |
}
|
| 128 |
# Use the model to classify the image
|
| 129 |
# results = model(image)
|
|
|
|
| 219 |
detection_result = {
|
| 220 |
# "prediction": predicted_label,
|
| 221 |
"prediction": predicted_label["label"],
|
| 222 |
+
"confidence": str(confidence),
|
| 223 |
}
|
| 224 |
# Use the model to classify the image
|
| 225 |
# results = model(image)
|