Kims12 commited on
Commit
1f18b3b
ยท
verified ยท
1 Parent(s): 8483342

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -3,6 +3,8 @@ import sys
3
  from torchvision.transforms import functional
4
  sys.modules["torchvision.transforms.functional_tensor"] = functional
5
 
 
 
6
  from basicsr.archs.srvgg_arch import SRVGGNetCompact
7
  from gfpgan.utils import GFPGANer
8
  from realesrgan.utils import RealESRGANer
@@ -33,6 +35,7 @@ upsampler = RealESRGANer(scale=4, model_path=model_path, model=model, tile=0, ti
33
  # ์ด๋ฏธ์ง€ ์ €์žฅ ๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑ (ํ•„์š”์‹œ ์ฃผ์„ ํ•ด์ œ)
34
  # os.makedirs('output', exist_ok=True)
35
 
 
36
  def upscaler(img, version, scale):
37
  try:
38
  # ์ž…๋ ฅ๋œ img๋Š” ํŒŒ์ผ ๊ฒฝ๋กœ์ž„
 
3
  from torchvision.transforms import functional
4
  sys.modules["torchvision.transforms.functional_tensor"] = functional
5
 
6
+ import spaces
7
+
8
  from basicsr.archs.srvgg_arch import SRVGGNetCompact
9
  from gfpgan.utils import GFPGANer
10
  from realesrgan.utils import RealESRGANer
 
35
  # ์ด๋ฏธ์ง€ ์ €์žฅ ๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑ (ํ•„์š”์‹œ ์ฃผ์„ ํ•ด์ œ)
36
  # os.makedirs('output', exist_ok=True)
37
 
38
+ @spaces.GPU(duration=120)
39
  def upscaler(img, version, scale):
40
  try:
41
  # ์ž…๋ ฅ๋œ img๋Š” ํŒŒ์ผ ๊ฒฝ๋กœ์ž„