Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def process_video(video_path, target, progress=gr.Progress()):
|
|
34 |
|
35 |
processed_frames = []
|
36 |
frame_scores = []
|
37 |
-
batch_size =
|
38 |
batch_frames = []
|
39 |
batch_times = []
|
40 |
|
@@ -70,7 +70,7 @@ def process_video(video_path, target, progress=gr.Progress()):
|
|
70 |
boxes, scores, labels = results[i]["boxes"], results[i]["scores"], results[i]["labels"]
|
71 |
|
72 |
for box, score, label in zip(boxes, scores, labels):
|
73 |
-
if score.item() >= 0.
|
74 |
box = [round(i, 2) for i in box.tolist()]
|
75 |
object_label = target
|
76 |
confidence = round(score.item(), 3)
|
@@ -120,7 +120,7 @@ def load_sample_frame(video_path):
|
|
120 |
|
121 |
def gradio_app():
|
122 |
with gr.Blocks() as app:
|
123 |
-
gr.Markdown("# Video Object Detection with Owlv2
|
124 |
|
125 |
video_input = gr.Video(label="Upload Video")
|
126 |
target_input = gr.Textbox(label="Target Object", value="Elephant")
|
|
|
34 |
|
35 |
processed_frames = []
|
36 |
frame_scores = []
|
37 |
+
batch_size = 8
|
38 |
batch_frames = []
|
39 |
batch_times = []
|
40 |
|
|
|
70 |
boxes, scores, labels = results[i]["boxes"], results[i]["scores"], results[i]["labels"]
|
71 |
|
72 |
for box, score, label in zip(boxes, scores, labels):
|
73 |
+
if score.item() >= 0.5:
|
74 |
box = [round(i, 2) for i in box.tolist()]
|
75 |
object_label = target
|
76 |
confidence = round(score.item(), 3)
|
|
|
120 |
|
121 |
def gradio_app():
|
122 |
with gr.Blocks() as app:
|
123 |
+
gr.Markdown("# Video Object Detection with Owlv2")
|
124 |
|
125 |
video_input = gr.Video(label="Upload Video")
|
126 |
target_input = gr.Textbox(label="Target Object", value="Elephant")
|