zhiweili
commited on
Commit
·
a362aff
1
Parent(s):
34afbba
resize limit size
Browse files- app_enhance.py +2 -0
app_enhance.py
CHANGED
@@ -78,6 +78,8 @@ def enhance_image(
|
|
78 |
if w > max_size:
|
79 |
h = int(h * max_size / w)
|
80 |
w = max_size
|
|
|
|
|
81 |
|
82 |
enhanced_image = Image.fromarray(cv2.cvtColor(output, cv2.COLOR_BGR2RGB))
|
83 |
tmpPrefix = "/tmp/gradio/"
|
|
|
78 |
if w > max_size:
|
79 |
h = int(h * max_size / w)
|
80 |
w = max_size
|
81 |
+
|
82 |
+
output = cv2.resize(output, (w, h), interpolation=cv2.INTER_LANCZOS4)
|
83 |
|
84 |
enhanced_image = Image.fromarray(cv2.cvtColor(output, cv2.COLOR_BGR2RGB))
|
85 |
tmpPrefix = "/tmp/gradio/"
|