Spaces:
Build error
Build error
simayhosmeyve
commited on
Commit
•
e8da5f2
1
Parent(s):
f0d28c5
Update app.py
Browse files
app.py
CHANGED
@@ -177,18 +177,19 @@ def result(Input,Choice,Step):
|
|
177 |
return Input,Psnr
|
178 |
|
179 |
if Choice =="Enhancement":
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
|
|
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 |
|