Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -17,12 +17,12 @@ def get_duration(
|
|
17 |
image, model_selection
|
18 |
):
|
19 |
width, height = image.size
|
20 |
-
|
21 |
|
22 |
if model_selection in ["4xNomosWebPhotoRealPLKSR", "4xRealESRGAN"]:
|
23 |
-
return
|
24 |
else:
|
25 |
-
return
|
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):
|