Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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
|
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(
|