Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -32,11 +32,13 @@ def predict(base64: str, queries: str, box_threshold: float, text_threshold: flo
|
|
32 |
text_threshold=text_threshold,
|
33 |
target_sizes=[image.size[::-1]]
|
34 |
)
|
35 |
-
|
36 |
"scores": [float(s) for s in results[0]["scores"]],
|
37 |
"labels": results[0]["labels"],
|
38 |
"boxes": [[float(x) for x in box] for box in results[0]["boxes"]]
|
39 |
}
|
|
|
|
|
40 |
|
41 |
demo = gr.Interface(
|
42 |
fn=predict,
|
|
|
32 |
text_threshold=text_threshold,
|
33 |
target_sizes=[image.size[::-1]]
|
34 |
)
|
35 |
+
fmt_results = {
|
36 |
"scores": [float(s) for s in results[0]["scores"]],
|
37 |
"labels": results[0]["labels"],
|
38 |
"boxes": [[float(x) for x in box] for box in results[0]["boxes"]]
|
39 |
}
|
40 |
+
print(fmt_results)
|
41 |
+
return fmt_results
|
42 |
|
43 |
demo = gr.Interface(
|
44 |
fn=predict,
|