Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -130,6 +130,7 @@ with gr.Blocks() as app:
|
|
| 130 |
source_tog=gr.Radio(choices=["Image","Video"],value="Image")
|
| 131 |
with gr.Box(visible=False) as im_box:
|
| 132 |
inp_url=gr.Textbox(label="Image URL")
|
|
|
|
| 133 |
inp_im=gr.Image(label="Search Image",type='filepath')
|
| 134 |
go_btn_im=gr.Button()
|
| 135 |
with gr.Box(visible=False) as vid_box:
|
|
@@ -153,7 +154,10 @@ with gr.Blocks() as app:
|
|
| 153 |
if tog == "Image":
|
| 154 |
return gr.update(visible=True),gr.update(visible=False)
|
| 155 |
if tog == "Video":
|
| 156 |
-
return gr.update(visible=False),gr.update(visible=True)
|
|
|
|
|
|
|
|
|
|
| 157 |
next_btn.click(process_vid,[inp_vid,hid_box,every_n],[html_out,stat_box,hid_box])
|
| 158 |
vid_url_btn.click(dl,vid_url,[inp_vid,html_out,stat_box,hid_box])
|
| 159 |
source_tog.change(shuf,[source_tog],[im_box,vid_box])
|
|
|
|
| 130 |
source_tog=gr.Radio(choices=["Image","Video"],value="Image")
|
| 131 |
with gr.Box(visible=False) as im_box:
|
| 132 |
inp_url=gr.Textbox(label="Image URL")
|
| 133 |
+
load_im_btn=gr.Button("Load Image")
|
| 134 |
inp_im=gr.Image(label="Search Image",type='filepath')
|
| 135 |
go_btn_im=gr.Button()
|
| 136 |
with gr.Box(visible=False) as vid_box:
|
|
|
|
| 154 |
if tog == "Image":
|
| 155 |
return gr.update(visible=True),gr.update(visible=False)
|
| 156 |
if tog == "Video":
|
| 157 |
+
return gr.update(visible=False),gr.update(visible=True)
|
| 158 |
+
def load_image(url):
|
| 159 |
+
return url
|
| 160 |
+
load_im_btn.click(load_image,inp_url,inp_im)
|
| 161 |
next_btn.click(process_vid,[inp_vid,hid_box,every_n],[html_out,stat_box,hid_box])
|
| 162 |
vid_url_btn.click(dl,vid_url,[inp_vid,html_out,stat_box,hid_box])
|
| 163 |
source_tog.change(shuf,[source_tog],[im_box,vid_box])
|