Update app.py
Browse filesMisunderstood docs
app.py
CHANGED
|
@@ -96,7 +96,8 @@ def detect_objects(model_name,url_input,image_input,threshold):
|
|
| 96 |
else:
|
| 97 |
final_str_else += f"Detected `{model.config.id2label[label.item()]}` with confidence `{round(score.item(), 3)}` at location `{box}`\n"
|
| 98 |
|
| 99 |
-
|
|
|
|
| 100 |
|
| 101 |
return viz_img, final_str
|
| 102 |
|
|
|
|
| 96 |
else:
|
| 97 |
final_str_else += f"Detected `{model.config.id2label[label.item()]}` with confidence `{round(score.item(), 3)}` at location `{box}`\n"
|
| 98 |
|
| 99 |
+
# https://docs.python.org/3/library/string.html#format-examples
|
| 100 |
+
final_str = "{:*^50}\n".format("ABOVE THRESHOLD OR EQUAL") + final_str_abv + "\n{:*^50}\n".format("BELOW THRESHOLD")+final_str_else
|
| 101 |
|
| 102 |
return viz_img, final_str
|
| 103 |
|