gatesla commited on
Commit
b57b81d
1 Parent(s): 4204a36

Update app.py

Browse files

Used wrong parameter in python sorted ...

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -89,7 +89,7 @@ def detect_objects(model_name,url_input,image_input,threshold):
89
 
90
  final_str_abv = ""
91
  final_str_else = ""
92
- for score, label, box in sorted(zip(processed_outputs["scores"], processed_outputs["labels"], processed_outputs["boxes"]), key = lambda x: x[0].item(), sorted=True):
93
  box = [round(i, 2) for i in box.tolist()]
94
  if score.item() >= threshold:
95
  final_str_abv += f"Detected `{model.config.id2label[label.item()]}` with confidence `{round(score.item(), 3)}` at location `{box}`\n"
 
89
 
90
  final_str_abv = ""
91
  final_str_else = ""
92
+ for score, label, box in sorted(zip(processed_outputs["scores"], processed_outputs["labels"], processed_outputs["boxes"]), key = lambda x: x[0].item(), reverse=True):
93
  box = [round(i, 2) for i in box.tolist()]
94
  if score.item() >= threshold:
95
  final_str_abv += f"Detected `{model.config.id2label[label.item()]}` with confidence `{round(score.item(), 3)}` at location `{box}`\n"