doevent commited on
Commit
e198db2
1 Parent(s): b2c3b8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
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
- try:
17
- if size == '2x':
18
- result = model2.predict(image.convert('RGB'))
19
- elif size == '4x':
20
- result = model4.predict(image.convert('RGB'))
21
- else:
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