Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -84,11 +84,9 @@ def process_vid(file,cur_frame,every_n):
|
|
84 |
return (gr.HTML(f'{e}'),"","")
|
85 |
return (gr.HTML('No frame matches found.'),"","")
|
86 |
|
87 |
-
def process_im(file):
|
88 |
-
if
|
89 |
-
return
|
90 |
-
if file.startswith("http://"):
|
91 |
-
return file
|
92 |
else:
|
93 |
read_file = Image.open(file)
|
94 |
read_file.save(f"{uid}-tmp.png")
|
@@ -166,7 +164,7 @@ with gr.Blocks() as app:
|
|
166 |
next_btn.click(process_vid,[inp_vid,hid_box,every_n],[html_out,stat_box,hid_box])
|
167 |
vid_url_btn.click(dl,vid_url,[inp_vid,html_out,stat_box,hid_box])
|
168 |
source_tog.change(shuf,[source_tog],[im_box,vid_box])
|
169 |
-
inp_im.change(process_im,inp_im,[inp_url])
|
170 |
go_btn_vid.click(process_vid,[inp_vid,hid_box,every_n],[html_out,stat_box,hid_box])
|
171 |
go_btn_im.click(rev_im,inp_url,[html_out])
|
172 |
#go_btn_url.click(rev_im,inp_url,[html_out])
|
|
|
84 |
return (gr.HTML(f'{e}'),"","")
|
85 |
return (gr.HTML('No frame matches found.'),"","")
|
86 |
|
87 |
+
def process_im(file,url):
|
88 |
+
if not url.startswith("https://omnibus"):
|
89 |
+
return url
|
|
|
|
|
90 |
else:
|
91 |
read_file = Image.open(file)
|
92 |
read_file.save(f"{uid}-tmp.png")
|
|
|
164 |
next_btn.click(process_vid,[inp_vid,hid_box,every_n],[html_out,stat_box,hid_box])
|
165 |
vid_url_btn.click(dl,vid_url,[inp_vid,html_out,stat_box,hid_box])
|
166 |
source_tog.change(shuf,[source_tog],[im_box,vid_box])
|
167 |
+
inp_im.change(process_im,[inp_im,inp_url],[inp_url])
|
168 |
go_btn_vid.click(process_vid,[inp_vid,hid_box,every_n],[html_out,stat_box,hid_box])
|
169 |
go_btn_im.click(rev_im,inp_url,[html_out])
|
170 |
#go_btn_url.click(rev_im,inp_url,[html_out])
|