File size: 780 Bytes
b30187c
 
 
e21dceb
b30187c
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# https://huggingface.co/spaces/lampongyuen/Gradio-Webcam-Streaming/blob/main/app.py  (I thought needed video instead of Image)

import gradio as gr
import numpy as np 
import time

def flip(im):
    return np.flipud(im)

def dummyaudioprocess(aud):
    time.sleep(3)

with gr.Blocks() as realtimemedia:
    gr.HTML("Dual Audio and Image and processing test - With inspiration from - https://huggingface.co/spaces/lampongyuen/Gradio-Webcam-Streaming/blob/main/app.py (I thought needed video instead of Image) <br> End goal is SAM on live webcam + audio live with whisper " )
    gr.Interface(flip, gr.Image(sources=["webcam"], streaming=True), "image", live=True)
    gr.Interface(flip, gr.Audio(sources=["mixrophone"], streaming=True), "audio", live=True)

realtimemedia.launch()