luca115 commited on
Commit
a06d38b
·
verified ·
1 Parent(s): 7b74cf4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -17,12 +17,12 @@ def get_duration(
17
  image, model_selection
18
  ):
19
  width, height = image.size
20
- megapixel = math.ceil((width * height) / 1_000_000)
21
 
22
  if model_selection in ["4xNomosWebPhotoRealPLKSR", "4xRealESRGAN"]:
23
- return int(megapixel * 10)
24
  else:
25
- return int(megapixel * 30)
26
 
27
  @spaces.GPU(duration = get_duration)
28
  def upscale_image(image, model_selection):
 
17
  image, model_selection
18
  ):
19
  width, height = image.size
20
+ pixel = width * height
21
 
22
  if model_selection in ["4xNomosWebPhotoRealPLKSR", "4xRealESRGAN"]:
23
+ return math.ceil((pixel * 10) / 1_000_000) + 3
24
  else:
25
+ return math.ceil((pixel * 30) / 1_000_000) + 3
26
 
27
  @spaces.GPU(duration = get_duration)
28
  def upscale_image(image, model_selection):