Update run.py
Browse files
run.py
CHANGED
@@ -55,19 +55,27 @@ def segment(im, interval_s=2):
|
|
55 |
|
56 |
# demo.launch()
|
57 |
|
58 |
-
from gradio_webrtc import WebRTC
|
59 |
|
60 |
-
css = """.my-group {max-width: 600px !important; max-height: 600px !important;}
|
61 |
-
|
62 |
|
63 |
-
with gr.Blocks(css=css) as demo:
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
if __name__ == "__main__":
|
73 |
demo.launch()
|
|
|
55 |
|
56 |
# demo.launch()
|
57 |
|
58 |
+
# from gradio_webrtc import WebRTC
|
59 |
|
60 |
+
# css = """.my-group {max-width: 600px !important; max-height: 600px !important;}
|
61 |
+
# .my-column {display: flex !important; justify-content: center !important; align-items: center !important;}"""
|
62 |
|
63 |
+
# with gr.Blocks(css=css) as demo:
|
64 |
+
# gr.HTML(
|
65 |
+
# )
|
66 |
+
# with gr.Column(elem_classes=["my-column"]):
|
67 |
+
# with gr.Group(elem_classes=["my-group"]):
|
68 |
+
# image = WebRTC(label="Stream")
|
69 |
|
70 |
+
# image.stream(fn=segment, inputs=[image], outputs=[image])
|
71 |
+
|
72 |
+
interface_image = gr.Interface(
|
73 |
+
fn=segment,
|
74 |
+
inputs=[gr.Image(sources=["webcam"], streaming=True)],
|
75 |
+
outputs=["image"],
|
76 |
+
title="Image Inference",
|
77 |
+
cache_examples=False,
|
78 |
+
)
|
79 |
|
80 |
if __name__ == "__main__":
|
81 |
demo.launch()
|