martin8 commited on
Commit
9bfc666
1 Parent(s): 6fd14b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -291,10 +291,10 @@ def yolo_tiny(name):
291
  bboxes = []
292
 
293
  for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
294
- box = [round(i, 12) for i in box.tolist()]
295
  print(
296
  f"Detected {model.config.id2label[label.item()]} with confidence "
297
- f"{round(score.item(), 12)} at location {box}"
298
  )
299
 
300
  label_.append(model.config.id2label[label.item()])
@@ -323,7 +323,7 @@ def resnet_101(name):
323
  label_ = []
324
  bboxes = []
325
  for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
326
- box = [round(i, 12) for i in box.tolist()]
327
  print(
328
  f"Detected {model.config.id2label[label.item()]} with confidence "
329
  f"{round(score.item(), 3)} at location {box}")
@@ -357,7 +357,7 @@ def resnet_50(name):
357
  label_ = []
358
  bboxes = []
359
  for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
360
- box = [round(i, 2) for i in box.tolist()]
361
  print(
362
  f"Detected {model.config.id2label[label.item()]} with confidence "
363
  f"{round(score.item(), 3)} at location {box}"
 
291
  bboxes = []
292
 
293
  for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
294
+ box = [round(i, 1) for i in box.tolist()]
295
  print(
296
  f"Detected {model.config.id2label[label.item()]} with confidence "
297
+ f"{round(score.item(), 1)} at location {box}"
298
  )
299
 
300
  label_.append(model.config.id2label[label.item()])
 
323
  label_ = []
324
  bboxes = []
325
  for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
326
+ box = [round(i, 1) for i in box.tolist()]
327
  print(
328
  f"Detected {model.config.id2label[label.item()]} with confidence "
329
  f"{round(score.item(), 3)} at location {box}")
 
357
  label_ = []
358
  bboxes = []
359
  for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
360
+ box = [round(i, 1) for i in box.tolist()]
361
  print(
362
  f"Detected {model.config.id2label[label.item()]} with confidence "
363
  f"{round(score.item(), 3)} at location {box}"