gatesla commited on
Commit
063f8ab
·
1 Parent(s): b3b8437

Update app.py

Browse files

Misunderstood docs

Files changed (1) hide show
  1. app.py +2 -1
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
- final_str = "{ABOVE THRESHOLD OR EQUAL:*^50}\n".format("centered") + final_str_abv + "\n{BELOW THRESHOLD:*^50}\n".format("centered")+final_str_else
 
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