Spaces:
Running
on
T4
Running
on
T4
drop progress
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import os
|
| 2 |
from typing import TypeVar
|
| 3 |
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
import numpy as np
|
| 6 |
import supervision as sv
|
|
@@ -99,8 +100,7 @@ def video_processing_inference(
|
|
| 99 |
input_video: str,
|
| 100 |
confidence: float,
|
| 101 |
resolution: int,
|
| 102 |
-
checkpoint: str
|
| 103 |
-
progress=gr.Progress()
|
| 104 |
):
|
| 105 |
model = load_model(resolution=resolution, checkpoint=checkpoint)
|
| 106 |
|
|
@@ -115,7 +115,7 @@ def video_processing_inference(
|
|
| 115 |
frames_generator = sv.get_video_frames_generator(input_video, end=total)
|
| 116 |
|
| 117 |
with sv.VideoSink(output_video, video_info=video_info) as sink:
|
| 118 |
-
for frame in
|
| 119 |
annotated_frame = detect_and_annotate(
|
| 120 |
model=model,
|
| 121 |
image=frame,
|
|
|
|
| 1 |
import os
|
| 2 |
from typing import TypeVar
|
| 3 |
|
| 4 |
+
from tqdm import tqdm
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
import supervision as sv
|
|
|
|
| 100 |
input_video: str,
|
| 101 |
confidence: float,
|
| 102 |
resolution: int,
|
| 103 |
+
checkpoint: str
|
|
|
|
| 104 |
):
|
| 105 |
model = load_model(resolution=resolution, checkpoint=checkpoint)
|
| 106 |
|
|
|
|
| 115 |
frames_generator = sv.get_video_frames_generator(input_video, end=total)
|
| 116 |
|
| 117 |
with sv.VideoSink(output_video, video_info=video_info) as sink:
|
| 118 |
+
for frame in tqdm(frames_generator, total=total):
|
| 119 |
annotated_frame = detect_and_annotate(
|
| 120 |
model=model,
|
| 121 |
image=frame,
|