Spaces:
Runtime error
Runtime error
conf fix
Browse files
app.py
CHANGED
@@ -34,10 +34,10 @@ image_interface = gr.Interface(
|
|
34 |
fn=image_inference,
|
35 |
inputs=[
|
36 |
"image",
|
37 |
-
gr.Slider(0, 1, value=0.
|
38 |
gr.Slider(0, 1, value=0.01, step=0.01, label="NMS Threshold")
|
39 |
],
|
40 |
-
examples=[["assets/sample.png", 0.
|
41 |
outputs=gr.Image(type="pil"),
|
42 |
title="OpenLenda image demo"
|
43 |
)
|
@@ -60,7 +60,7 @@ def video_inference(video_file, confthre, nmsthre, start_sec, duration):
|
|
60 |
fps = cap.get(cv2.CAP_PROP_FPS)
|
61 |
|
62 |
with tempfile.NamedTemporaryFile(suffix=".mp4") as temp_file:
|
63 |
-
out = cv2.VideoWriter(temp_file.name, cv2.VideoWriter_fourcc(*"
|
64 |
|
65 |
num_frames = 0
|
66 |
max_frames = duration * fps
|
|
|
34 |
fn=image_inference,
|
35 |
inputs=[
|
36 |
"image",
|
37 |
+
gr.Slider(0, 1, value=0.4, step=0.01, label="Confidence Threshold", ),
|
38 |
gr.Slider(0, 1, value=0.01, step=0.01, label="NMS Threshold")
|
39 |
],
|
40 |
+
examples=[["assets/sample.png", 0.4, 0.01]],
|
41 |
outputs=gr.Image(type="pil"),
|
42 |
title="OpenLenda image demo"
|
43 |
)
|
|
|
60 |
fps = cap.get(cv2.CAP_PROP_FPS)
|
61 |
|
62 |
with tempfile.NamedTemporaryFile(suffix=".mp4") as temp_file:
|
63 |
+
out = cv2.VideoWriter(temp_file.name, cv2.VideoWriter_fourcc(*"mp4v"), fps, (width, height))
|
64 |
|
65 |
num_frames = 0
|
66 |
max_frames = duration * fps
|