syedusama5556 commited on
Commit
f378d6b
1 Parent(s): 88b79b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -8,11 +8,19 @@ from basicsr.utils.download_util import load_file_from_url
8
 
9
  from realesrgan import RealESRGANer
10
  from realesrgan.archs.srvgg_arch import SRVGGNetCompact
 
11
 
 
 
 
12
 
13
  last_file = None
14
  img_mode = "RGBA"
15
 
 
 
 
 
16
 
17
  def realesrgan(img, model_name, denoise_strength, face_enhance, outscale):
18
  """Real-ESRGAN function to restore (and upscale) images.
@@ -220,6 +228,8 @@ def main():
220
  )
221
 
222
  demo.launch()
 
 
223
 
224
 
225
  if __name__ == "__main__":
 
8
 
9
  from realesrgan import RealESRGANer
10
  from realesrgan.archs.srvgg_arch import SRVGGNetCompact
11
+ from fastapi import FastAPI
12
 
13
+ CUSTOM_PATH = "/gradio"
14
+
15
+ app = FastAPI()
16
 
17
  last_file = None
18
  img_mode = "RGBA"
19
 
20
+ @app.get("/")
21
+ def read_main():
22
+ return {"message": "This is your main app"}
23
+
24
 
25
  def realesrgan(img, model_name, denoise_strength, face_enhance, outscale):
26
  """Real-ESRGAN function to restore (and upscale) images.
 
228
  )
229
 
230
  demo.launch()
231
+ app = gr.mount_gradio_app(app, gr, path=CUSTOM_PATH)
232
+
233
 
234
 
235
  if __name__ == "__main__":