noamholz commited on
Commit
eac766a
·
verified ·
1 Parent(s): 2ea6045

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +10 -10
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
- inp = gr.Image(sources=["webcam"], streaming=True)
51
- inp.stream(segment, inputs=inp, outputs=[gr.Image()],
52
- css=".output-image, .input-image, .image-preview {height: 400px !important} ")
53
-
54
- # demo = gr.Interface(
55
- # segment,
56
- # [gr.Image(sources=["webcam"], streaming=False)],
57
- # ["image"],
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