Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,12 +12,12 @@ from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
|
|
12 |
import moviepy.video.io.ImageSequenceClip
|
13 |
from moviepy.editor import *
|
14 |
from PIL import Image
|
15 |
-
import esr
|
16 |
uid=uuid.uuid4()
|
17 |
if not os.path.exists(f'{uid}'): os.makedirs(f'{uid}')
|
18 |
if not os.path.exists(f'{uid}-frames'): os.makedirs(f'{uid}-frames')
|
19 |
if not os.path.exists(f'{uid}-rembg'): os.makedirs(f'{uid}-rembg')
|
20 |
-
|
21 |
|
22 |
load_js = """
|
23 |
function(text_input, url_params) {
|
@@ -248,7 +248,9 @@ def process_image_1(image):
|
|
248 |
#cv2.imwrite(f"{rand_im}-vid_tmp_proc.png", image)
|
249 |
#image = f"{rand_im}-vid_tmp_proc.png"
|
250 |
image=Image.fromarray(image)
|
251 |
-
out = esr
|
|
|
|
|
252 |
#out = os.path.abspath(f"{rand_im}-vid_tmp_proc.png")
|
253 |
#out_url = f'https://omnibus-vid-url-dl-mod.hf.space/file={out}'
|
254 |
#out = esr.realesrgan1(image, "realesr-general-x4v3", 0.5, False, 2)
|
|
|
12 |
import moviepy.video.io.ImageSequenceClip
|
13 |
from moviepy.editor import *
|
14 |
from PIL import Image
|
15 |
+
#import esr
|
16 |
uid=uuid.uuid4()
|
17 |
if not os.path.exists(f'{uid}'): os.makedirs(f'{uid}')
|
18 |
if not os.path.exists(f'{uid}-frames'): os.makedirs(f'{uid}-frames')
|
19 |
if not os.path.exists(f'{uid}-rembg'): os.makedirs(f'{uid}-rembg')
|
20 |
+
esr = gr.Interface.load("spaces/Omnibus/Real_ESRGAN_mod")
|
21 |
|
22 |
load_js = """
|
23 |
function(text_input, url_params) {
|
|
|
248 |
#cv2.imwrite(f"{rand_im}-vid_tmp_proc.png", image)
|
249 |
#image = f"{rand_im}-vid_tmp_proc.png"
|
250 |
image=Image.fromarray(image)
|
251 |
+
out = esr(img=image, model_name="realesr-general-x4v3", denoise_strength=0.5, face_enhance=True, outscale=1)
|
252 |
+
|
253 |
+
#out = esr.realesrgan1(img=image, model_name="realesr-general-x4v3", denoise_strength=0.5, face_enhance=True, outscale=1)
|
254 |
#out = os.path.abspath(f"{rand_im}-vid_tmp_proc.png")
|
255 |
#out_url = f'https://omnibus-vid-url-dl-mod.hf.space/file={out}'
|
256 |
#out = esr.realesrgan1(image, "realesr-general-x4v3", 0.5, False, 2)
|