ChatwithDolly / app.py
john
Update app.py
35bd487
raw
history blame
622 Bytes
import gradio as gr
import cv2
def draw(im):
cv2.rectangle(im,(50,50), (200,200), (0, 255, 255), 2)
return im
def welcome(name):
return f"Hello {name}!"
def background_task():
while True:
print("Background task running...")
time.sleep(1)
with gr.Blocks(theme=gr.themes.Soft()) as demo:
inp = gr.Image(source="webcam", shape=(10,10), streaming=True, hide=True)
out = gr.Image(label='output', )
inp.change(draw, inp, out)
name_input = gr.Textbox(label='Enter your name')
out_text = gr.Textbox()
name_input.change(welcome, name_input, out_text)
demo.launch()