Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The way to start or stop the Image component for wabcam streaming #1323

Closed
1 task done
JefferyChiang opened this issue May 18, 2022 · 2 comments
Closed
1 task done
Labels
enhancement New feature or request svelte Frontend-related issue (JS)

Comments

@JefferyChiang
Copy link
Contributor

  • I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe.

related to #220
I tried the Image streaming function for webcam, and it can performed real time inference correctly.
I'm wondering is there a proper way to trigger start or stop the real time inference?

Describe the solution you'd like

Though I can use another Tab to stop the inference thread, I think it will be more easy to have a button to trigger.

Additional context
Here is my code for testing the Image stream function.

import gradio as gr

def image_mod(image):
    return image.rotate(45)
    
block = gr.Blocks()
with block:
    with gr.Tabs():
        with gr.TabItem("Train"):
            train = gr.Button("Train")
        with gr.TabItem("Inference"):
            with gr.Row():
                input_image = gr.Image(type='pil',label="Input Image", source="webcam",
                                 streaming=True)
                output_image = gr.Image(label="Output Image")
                input_image.change(image_mod,
                           inputs=input_image,
                           outputs=output_image)
block.launch(show_error=True, inbrowser=True)
@pngwn
Copy link
Member

pngwn commented May 18, 2022

@aliabid94

@abidlabs abidlabs added this to the 3.1 milestone May 31, 2022
@freddyaboulton freddyaboulton added the enhancement New feature or request label Jul 6, 2022
@abidlabs abidlabs added the svelte Frontend-related issue (JS) label Jul 11, 2022
@abidlabs abidlabs modified the milestones: 3.1, 3.x Jul 19, 2022
@abidlabs abidlabs removed this from the 3.x milestone Mar 17, 2023
@abidlabs
Copy link
Member

I'll close as this is a duplicate of #3642 and that issue has a bit more activity. We're working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request svelte Frontend-related issue (JS)
Projects
None yet
Development

No branches or pull requests

5 participants