Omnibus commited on
Commit
2b78b46
·
1 Parent(s): 2e7f022

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -9,11 +9,12 @@ import moviepy
9
  from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
10
  import moviepy.video.io.ImageSequenceClip
11
  from moviepy.editor import *
 
12
  uid=uuid.uuid4()
13
  if not os.path.exists(f'{uid}'): os.makedirs(f'{uid}')
14
  if not os.path.exists(f'{uid}-frames'): os.makedirs(f'{uid}-frames')
15
  if not os.path.exists(f'{uid}-rembg'): os.makedirs(f'{uid}-rembg')
16
- esr = gr.Interface.load("spaces/Omnibus/Real-ESRGAN-mod")
17
 
18
  load_js = """
19
  function(text_input, url_params) {
@@ -240,7 +241,7 @@ def check_load(inp_url,outp_vid,hid_box,start_f,end_f):
240
  #outp_vid.change(echo_fn,outp_vid,[out_trim])
241
  def process_image_1(image):
242
  #out = esr(img=image, model_name="realesr-general-x4v3", denoise_strength=0.5, face_enhance=False, outscale=2)
243
- out = esr(image, "realesr-general-x4v3", 0.5, False, 2)
244
  print (out)
245
  out = Image.open(out)
246
  return out
 
9
  from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
10
  import moviepy.video.io.ImageSequenceClip
11
  from moviepy.editor import *
12
+ import Real_ESRGAN_mod as ers_mod
13
  uid=uuid.uuid4()
14
  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) {
 
241
  #outp_vid.change(echo_fn,outp_vid,[out_trim])
242
  def process_image_1(image):
243
  #out = esr(img=image, model_name="realesr-general-x4v3", denoise_strength=0.5, face_enhance=False, outscale=2)
244
+ out = ers_mod.realesrgan(image, "realesr-general-x4v3", 0.5, False, 2)
245
  print (out)
246
  out = Image.open(out)
247
  return out