simayhosmeyve commited on
Commit
e8da5f2
1 Parent(s): f0d28c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -12
app.py CHANGED
@@ -177,18 +177,19 @@ def result(Input,Choice,Step):
177
  return Input,Psnr
178
 
179
  if Choice =="Enhancement":
180
- pre_trained2 = tf.keras.models.load_model("generatorLR-HR_300.h5")
181
- size0 = Input.shape[0]
182
- size1 = Input.shape[1]
183
- Input = cv2.resize(Input, (256,256), interpolation = cv2.INTER_AREA)
184
- Input = np.array(Input).reshape(1,256,256,3)
185
- prediction = pre_trained2(Input,training=True)
186
- Input = prediction[0]
187
- Input = (Input+1)*127.5
188
- Input = np.uint8(Input)
189
- Input = cv2.resize(Input, (size1,size0), interpolation = cv2.INTER_AREA)
190
- Psnr = 50
191
- return Input, Psnr
 
192
 
193
 
194
 
 
177
  return Input,Psnr
178
 
179
  if Choice =="Enhancement":
180
+ if Step == 1.0 or Step == 2.0 or Step == 3.0:
181
+ pre_trained2 = tf.keras.models.load_model("generatorLR-HR_300.h5")
182
+ size0 = Input.shape[0]
183
+ size1 = Input.shape[1]
184
+ Input = cv2.resize(Input, (256,256), interpolation = cv2.INTER_AREA)
185
+ Input = np.array(Input).reshape(1,256,256,3)
186
+ prediction = pre_trained2(Input,training=True)
187
+ Input = prediction[0]
188
+ Input = (Input+1)*127.5
189
+ Input = np.uint8(Input)
190
+ #Input = cv2.resize(Input, (size1,size0))
191
+ Psnr = 50
192
+ return Input, Psnr
193
 
194
 
195