Update run.py
Browse files
run.py
CHANGED
@@ -46,16 +46,16 @@ def segment(im, interval_s=2):
|
|
46 |
imout[..., 1] = np.clip(imout[..., 1] + logits_n * 200, 0, 254)
|
47 |
return imout #, cnt #np.flipud(im)
|
48 |
|
49 |
-
with gr.Blocks() as demo:
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
|
60 |
if __name__ == "__main__":
|
61 |
|
|
|
46 |
imout[..., 1] = np.clip(imout[..., 1] + logits_n * 200, 0, 254)
|
47 |
return imout #, cnt #np.flipud(im)
|
48 |
|
49 |
+
# with gr.Blocks() as demo:
|
50 |
+
# inp = gr.Image(sources=["webcam"], streaming=True)
|
51 |
+
# inp.stream(segment, inputs=inp, outputs=[gr.Image()])
|
52 |
+
|
53 |
+
demo = gr.Interface(
|
54 |
+
segment,
|
55 |
+
[gr.Image(sources=["webcam"], streaming=True)],
|
56 |
+
["image"],
|
57 |
+
css=".output-image, .input-image, .image-preview {height: 400px !important}"
|
58 |
+
)
|
59 |
|
60 |
if __name__ == "__main__":
|
61 |
|