Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -184,8 +184,8 @@ def improve_img(inp,model_name,denoise_strength,face_enhance,outscale):
|
|
184 |
yield _,"Reading image"
|
185 |
|
186 |
img=cv2.imread(inp)
|
187 |
-
cv2.imwrite(f'{uid}-frames/
|
188 |
-
out = os.path.abspath(f'{uid}-frames/
|
189 |
out_url = f'{main_url}/file={out}'
|
190 |
yield _,"Improving image"
|
191 |
out = esr(out_url, model_name, float(denoise_strength), face_enhance, int(outscale))
|
@@ -356,8 +356,11 @@ with gr.Blocks(css=css) as app:
|
|
356 |
text_output=gr.Textbox()
|
357 |
url_params=gr.JSON()
|
358 |
|
359 |
-
|
360 |
-
|
|
|
|
|
|
|
361 |
choose_media.change(new_media,choose_media,[im_box,vid_box,gif_row,vid_row])
|
362 |
samp_btn.click(run_samp,[choose_prog,fps,qual,model_name,denoise_strength,face_enhance,outscale,frame_targ],[samp_im,gif_stat,vid_stat])
|
363 |
speed_btn.click(update_speed,[hid_box,clip_speed,hid_fps],[outp_vid,hid_box,outp_file])
|
|
|
184 |
yield _,"Reading image"
|
185 |
|
186 |
img=cv2.imread(inp)
|
187 |
+
cv2.imwrite(f'{uid}-frames/tmp_im.png',inp)
|
188 |
+
out = os.path.abspath(f'{uid}-frames/tmp_im.png')
|
189 |
out_url = f'{main_url}/file={out}'
|
190 |
yield _,"Improving image"
|
191 |
out = esr(out_url, model_name, float(denoise_strength), face_enhance, int(outscale))
|
|
|
356 |
text_output=gr.Textbox()
|
357 |
url_params=gr.JSON()
|
358 |
|
359 |
+
def load_im_fn(inp):
|
360 |
+
return inp
|
361 |
+
|
362 |
+
load_im_btn.click(load_im_fn,inp_img_url,inp_im)
|
363 |
+
proc_im_btn.click(improve_img,[inp_img,model_name,denoise_strength,face_enhance,outscale],[outp_img,im_stat])
|
364 |
choose_media.change(new_media,choose_media,[im_box,vid_box,gif_row,vid_row])
|
365 |
samp_btn.click(run_samp,[choose_prog,fps,qual,model_name,denoise_strength,face_enhance,outscale,frame_targ],[samp_im,gif_stat,vid_stat])
|
366 |
speed_btn.click(update_speed,[hid_box,clip_speed,hid_fps],[outp_vid,hid_box,outp_file])
|