Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ if not os.path.exists(f'{uid}'): os.makedirs(f'{uid}')
|
|
15 |
if not os.path.exists(f'{uid}-frames'): os.makedirs(f'{uid}-frames')
|
16 |
if not os.path.exists(f'{uid}-rembg'): os.makedirs(f'{uid}-rembg')
|
17 |
esr = gr.Interface.load("spaces/Omnibus/Real-ESRGAN-mod")
|
18 |
-
|
19 |
load_js = """
|
20 |
function(text_input, url_params) {
|
21 |
console.log(text_input, url_params);
|
@@ -118,14 +118,14 @@ def video_clip(program,fps,qual,model_name,denoise_strength,face_enhance,outscal
|
|
118 |
for i,img in enumerate(fbox):
|
119 |
#print (img)
|
120 |
out = os.path.abspath(img)
|
121 |
-
out_url = f'
|
122 |
mes=f'Improving frame {i+1} of {frame_count}'
|
123 |
yield _,_,mes
|
124 |
out = esr(out_url, model_name, float(denoise_strength), face_enhance, int(outscale))
|
125 |
#yield _,_,mes
|
126 |
#cv2.imwrite(f'{img}',out)
|
127 |
out_box.append(f'{out}')
|
128 |
-
print (f'
|
129 |
#print (f'out::{out}')
|
130 |
print (f'out_box::{out_box}')
|
131 |
clip = ImageSequenceClip(out_box, fps = fps)
|
@@ -176,14 +176,14 @@ def gif_clip(program,fps,qual,model_name,denoise_strength,face_enhance,outscale)
|
|
176 |
for i,img in enumerate(fbox):
|
177 |
#print (img)
|
178 |
out = os.path.abspath(img)
|
179 |
-
out_url = f'
|
180 |
mes=f'Improving frame {i+1} of {frame_count}'
|
181 |
yield _,_,mes
|
182 |
out = esr(out_url, model_name, float(denoise_strength), face_enhance, int(outscale))
|
183 |
#yield _,_,mes
|
184 |
#cv2.imwrite(f'{img}',out)
|
185 |
out_box.append(f'{out}')
|
186 |
-
print (f'
|
187 |
#print (f'out::{out}')
|
188 |
print (f'out_box::{out_box}')
|
189 |
clip = ImageSequenceClip(out_box, fps = fps)
|
@@ -332,7 +332,7 @@ with gr.Blocks(css=css) as app:
|
|
332 |
#frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
|
333 |
cv2.imwrite(f'{uid}-frames/{i}.png',frame_f)
|
334 |
out = os.path.abspath(f'{uid}-frames/{i}.png')
|
335 |
-
out_url = f'
|
336 |
yield _,"Creating Sample Frame"
|
337 |
out = esr(out_url, model_name, float(denoise_strength), face_enhance, int(outscale))
|
338 |
yield out,"Sample Frame Complete"
|
|
|
15 |
if not os.path.exists(f'{uid}-frames'): os.makedirs(f'{uid}-frames')
|
16 |
if not os.path.exists(f'{uid}-rembg'): os.makedirs(f'{uid}-rembg')
|
17 |
esr = gr.Interface.load("spaces/Omnibus/Real-ESRGAN-mod")
|
18 |
+
main_url= "https://omnibus-Deblur-Media.hf.space"
|
19 |
load_js = """
|
20 |
function(text_input, url_params) {
|
21 |
console.log(text_input, url_params);
|
|
|
118 |
for i,img in enumerate(fbox):
|
119 |
#print (img)
|
120 |
out = os.path.abspath(img)
|
121 |
+
out_url = f'{main_url}/file={out}'
|
122 |
mes=f'Improving frame {i+1} of {frame_count}'
|
123 |
yield _,_,mes
|
124 |
out = esr(out_url, model_name, float(denoise_strength), face_enhance, int(outscale))
|
125 |
#yield _,_,mes
|
126 |
#cv2.imwrite(f'{img}',out)
|
127 |
out_box.append(f'{out}')
|
128 |
+
print (f'{main_url}/file={out}')
|
129 |
#print (f'out::{out}')
|
130 |
print (f'out_box::{out_box}')
|
131 |
clip = ImageSequenceClip(out_box, fps = fps)
|
|
|
176 |
for i,img in enumerate(fbox):
|
177 |
#print (img)
|
178 |
out = os.path.abspath(img)
|
179 |
+
out_url = f'{main_url}/file={out}'
|
180 |
mes=f'Improving frame {i+1} of {frame_count}'
|
181 |
yield _,_,mes
|
182 |
out = esr(out_url, model_name, float(denoise_strength), face_enhance, int(outscale))
|
183 |
#yield _,_,mes
|
184 |
#cv2.imwrite(f'{img}',out)
|
185 |
out_box.append(f'{out}')
|
186 |
+
print (f'{main_url}/file={out}')
|
187 |
#print (f'out::{out}')
|
188 |
print (f'out_box::{out_box}')
|
189 |
clip = ImageSequenceClip(out_box, fps = fps)
|
|
|
332 |
#frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
|
333 |
cv2.imwrite(f'{uid}-frames/{i}.png',frame_f)
|
334 |
out = os.path.abspath(f'{uid}-frames/{i}.png')
|
335 |
+
out_url = f'{main_url}/file={out}'
|
336 |
yield _,"Creating Sample Frame"
|
337 |
out = esr(out_url, model_name, float(denoise_strength), face_enhance, int(outscale))
|
338 |
yield out,"Sample Frame Complete"
|