Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,16 +13,12 @@ model8.load_weights('weights/RealESRGAN_x8.pth', download=True)
|
|
13 |
|
14 |
|
15 |
def inference(image: Image, size: str) -> Image:
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
result = model8.predict(image.convert('RGB'))
|
23 |
-
except Exception as e:
|
24 |
-
print(e)
|
25 |
-
raise gr.Error(str(e))
|
26 |
return result
|
27 |
|
28 |
|
|
|
13 |
|
14 |
|
15 |
def inference(image: Image, size: str) -> Image:
|
16 |
+
if size == '2x':
|
17 |
+
result = model2.predict(image.convert('RGB'))
|
18 |
+
elif size == '4x':
|
19 |
+
result = model4.predict(image.convert('RGB'))
|
20 |
+
else:
|
21 |
+
result = model8.predict(image.convert('RGB'))
|
|
|
|
|
|
|
|
|
22 |
return result
|
23 |
|
24 |
|