noamholz commited on
Commit
39522bb
·
verified ·
1 Parent(s): 022b6a7

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +9 -11
run.py CHANGED
@@ -42,17 +42,15 @@ def segment(im, interval_s=2):
42
  imout = (logits[0, 0] - logits[0, 0].min()) / (logits[0, 0].max() - logits[0, 0].min())
43
  return imout #, cnt #np.flipud(im)
44
 
45
- # with gr.Blocks() as demo:
46
- # inp = gr.Image(sources=["webcam"], streaming=True)
47
- # inp.stream(segment, inputs=inp, outputs=[gr.Image()])
48
-
49
- demo = gr.Interface(
50
- segment,
51
- gr.Video(sources=["webcam"]),
52
- gr.Video(autoplay=True)
53
- # [gr.Image(sources=["webcam"], streaming=False)],
54
- # ["image"],
55
- )
56
 
57
  if __name__ == "__main__":
58
 
 
42
  imout = (logits[0, 0] - logits[0, 0].min()) / (logits[0, 0].max() - logits[0, 0].min())
43
  return imout #, cnt #np.flipud(im)
44
 
45
+ with gr.Blocks() as demo:
46
+ inp = gr.Image(sources=["webcam"], streaming=False)
47
+ inp.stream(segment, inputs=inp, outputs=[gr.Image()])
48
+
49
+ # demo = gr.Interface(
50
+ # segment,
51
+ # [gr.Image(sources=["webcam"], streaming=False)],
52
+ # ["image"],
53
+ # )
 
 
54
 
55
  if __name__ == "__main__":
56