Update run.py
Browse files
run.py
CHANGED
@@ -48,7 +48,7 @@ def segment(im, interval_s=2):
|
|
48 |
logits_n = (logits[0, 0] - logits[0, 0].min()) / (logits[0, 0].max() - logits[0, 0].min())
|
49 |
logits_n = cv2.resize(logits_n, (im.shape[1], im.shape[0]))
|
50 |
imout[..., 1] = np.clip(imout[..., 1] + logits_n * 200, 0, 254)
|
51 |
-
return imout
|
52 |
|
53 |
# with gr.Blocks() as demo:
|
54 |
# inp = gr.Image(sources=["webcam"], streaming=True)
|
@@ -57,7 +57,7 @@ def segment(im, interval_s=2):
|
|
57 |
demo = gr.Interface(
|
58 |
segment,
|
59 |
[gr.Image(sources=["webcam"], streaming=True)],
|
60 |
-
[
|
61 |
css=".output-image, .input-image, .image-preview {height: 400px !important}"
|
62 |
)
|
63 |
|
|
|
48 |
logits_n = (logits[0, 0] - logits[0, 0].min()) / (logits[0, 0].max() - logits[0, 0].min())
|
49 |
logits_n = cv2.resize(logits_n, (im.shape[1], im.shape[0]))
|
50 |
imout[..., 1] = np.clip(imout[..., 1] + logits_n * 200, 0, 254)
|
51 |
+
return imout, cnt #np.flipud(im)
|
52 |
|
53 |
# with gr.Blocks() as demo:
|
54 |
# inp = gr.Image(sources=["webcam"], streaming=True)
|
|
|
57 |
demo = gr.Interface(
|
58 |
segment,
|
59 |
[gr.Image(sources=["webcam"], streaming=True)],
|
60 |
+
[gr.Image(), gt.Number()],
|
61 |
css=".output-image, .input-image, .image-preview {height: 400px !important}"
|
62 |
)
|
63 |
|