simayhosmeyve commited on
Commit
78b7608
1 Parent(s): 92dbeaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -179,6 +179,9 @@ def result(Input,Choice,Step):
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)
@@ -186,7 +189,7 @@ def result(Input,Choice,Step):
186
  Input = np.array(Input).reshape(1,256,256,3)
187
  prediction = pre_trained2(Input,training=True)
188
  Input = prediction[0]
189
- #Input = (Input+1)*127.5
190
  Input = np.uint8(Input)
191
  Input = cv2.resize(Input, (size1,size0), interpolation = cv2.INTER_AREA)
192
  Psnr = 50
 
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
+ Input = cv2.cvtColor(Input , cv2.COLOR_BGR2RGB)
183
+ Input = (Input/127.5) - 1
184
+ Input = Input.astype(np.float32)
185
  size0 = Input.shape[0]
186
  size1 = Input.shape[1]
187
  Input = cv2.resize(Input, (256,256), interpolation = cv2.INTER_AREA)
 
189
  Input = np.array(Input).reshape(1,256,256,3)
190
  prediction = pre_trained2(Input,training=True)
191
  Input = prediction[0]
192
+ Input = (Input+1)*127.5
193
  Input = np.uint8(Input)
194
  Input = cv2.resize(Input, (size1,size0), interpolation = cv2.INTER_AREA)
195
  Psnr = 50