NoahH7 commited on
Commit
d39162a
·
verified ·
1 Parent(s): 7673b17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -21,10 +21,9 @@ results = processor.post_process_object_detection(outputs, target_sizes=target_s
21
  persons = 0
22
  for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
23
  box = [round(i, 2) for i in box.tolist()]
24
- if model.config.id2label[label.item()] == 'person':
25
- print(
26
- f"Detected {model.config.id2label[label.item()]} with confidence "
27
- f"{round(score.item(), 3)} at location {box}"
28
- )
29
- $persons++
30
 
 
21
  persons = 0
22
  for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
23
  box = [round(i, 2) for i in box.tolist()]
24
+ print(
25
+ f"Detected {model.config.id2label[label.item()]} with confidence "
26
+ f"{round(score.item(), 3)} at location {box}"
27
+ )
28
+ $persons++
 
29