gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
34.17k stars 2.6k forks source link

I want to specify the resolution of the Webcam #10027

Open Azunyan1111 opened 1 day ago

Azunyan1111 commented 1 day ago

Is your feature request related to a problem? Please describe.
Currently the resolution is hardcoded.

gradio/js/image/shared/stream_utils.ts

export async function get_video_stream(
    include_audio: boolean,
    video_source: HTMLVideoElement,
    device_id?: string
): Promise<MediaStream> {
    const size = {
        width: { ideal: 1920 },
        height: { ideal: 1440 }
    };

Describe the solution you'd like
It would be great if you could specify the resolution.

gradio.Image(label="Input", sources="webcam",webcam_height=720,webcam_width=1280)
yinsumirage commented 7 hours ago

i get it, i'll try for it.