freddyaboulton HF staff commited on
Commit
3cf5d84
·
verified ·
1 Parent(s): 4f7cb34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -72,8 +72,8 @@ def stream_object_detection(video, conf_threshold):
72
  outputs,
73
  target_sizes=torch.tensor([(height, width)] * len(batch)),
74
  threshold=conf_threshold)
75
-
76
- for i, (array, box) in enumerate(zip(batch, boxes)):
77
  pil_image = draw_bounding_boxes(Image.fromarray(array), box, model, conf_threshold)
78
  frame = np.array(pil_image)
79
  # Convert RGB to BGR
@@ -84,8 +84,6 @@ def stream_object_detection(video, conf_threshold):
84
  end = time.time()
85
  print("time taken for processing boxes", end - start)
86
 
87
- n_frames += 1
88
-
89
 
90
  with gr.Blocks() as app:
91
  gr.HTML(
 
72
  outputs,
73
  target_sizes=torch.tensor([(height, width)] * len(batch)),
74
  threshold=conf_threshold)
75
+
76
+ for _, (array, box) in enumerate(zip(batch, boxes)):
77
  pil_image = draw_bounding_boxes(Image.fromarray(array), box, model, conf_threshold)
78
  frame = np.array(pil_image)
79
  # Convert RGB to BGR
 
84
  end = time.time()
85
  print("time taken for processing boxes", end - start)
86
 
 
 
87
 
88
  with gr.Blocks() as app:
89
  gr.HTML(