NoahH7 commited on
Commit
a3306f8
·
verified ·
1 Parent(s): f454ab9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -18,12 +18,9 @@ outputs = model(**inputs)
18
  target_sizes = torch.tensor([image.size[::-1]])
19
  results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.9)[0]
20
 
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
-
 
18
  target_sizes = torch.tensor([image.size[::-1]])
19
  results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.9)[0]
20
 
 
21
  for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
22
  box = [round(i, 2) for i in box.tolist()]
23
  print(
24
+ f"Detected {model.config.id2label[label.item()]} with confidence "
25
+ f"{round(score.item(), 3)} at location {box}"
26
  )