Update app.py
Browse files
app.py
CHANGED
|
@@ -70,7 +70,7 @@ def generate_comparison_html(original_base64, transformed_base64):
|
|
| 70 |
|
| 71 |
<!-- ์ฌ๋ผ์ด๋ ์คํ์ผ๋ง -->
|
| 72 |
<style>
|
| 73 |
-
input[type=range] {
|
| 74 |
-webkit-appearance: none;
|
| 75 |
width: 100%;
|
| 76 |
height: 5px;
|
|
@@ -79,9 +79,9 @@ def generate_comparison_html(original_base64, transformed_base64):
|
|
| 79 |
opacity: 0.7;
|
| 80 |
-webkit-transition: .2s;
|
| 81 |
transition: opacity .2s;
|
| 82 |
-
}
|
| 83 |
|
| 84 |
-
input[type=range]::-webkit-slider-thumb {
|
| 85 |
-webkit-appearance: none;
|
| 86 |
appearance: none;
|
| 87 |
width: 15px;
|
|
@@ -89,15 +89,15 @@ def generate_comparison_html(original_base64, transformed_base64):
|
|
| 89 |
background: #4CAF50;
|
| 90 |
cursor: pointer;
|
| 91 |
border-radius: 50%;
|
| 92 |
-
}
|
| 93 |
|
| 94 |
-
input[type=range]::-moz-range-thumb {
|
| 95 |
width: 15px;
|
| 96 |
height: 15px;
|
| 97 |
background: #4CAF50;
|
| 98 |
cursor: pointer;
|
| 99 |
border-radius: 50%;
|
| 100 |
-
}
|
| 101 |
</style>
|
| 102 |
</div>
|
| 103 |
"""
|
|
@@ -121,7 +121,7 @@ def process_image(image, contrast, brightness, blur):
|
|
| 121 |
comparison_html = generate_comparison_html(original_base64, transformed_base64)
|
| 122 |
|
| 123 |
# ๋ณํ๋ ์ด๋ฏธ์ง๋ฅผ ์์ ํ์ผ๋ก ์ ์ฅ
|
| 124 |
-
with tempfile.NamedTemporaryFile(suffix=".jpg", delete=False) as tmp_file:
|
| 125 |
transformed.save(tmp_file, format="JPEG")
|
| 126 |
tmp_file_path = tmp_file.name
|
| 127 |
|
|
@@ -168,4 +168,4 @@ with gr.Blocks() as demo:
|
|
| 168 |
|
| 169 |
gr.Markdown("ยฉ๏ธ 2024 ๋ถ์๊ธฐ ์๋ ํ๋ฐฑ ์ฌ์ง ๋ณํ๊ธฐ by OpenAI")
|
| 170 |
|
| 171 |
-
demo.launch()
|
|
|
|
| 70 |
|
| 71 |
<!-- ์ฌ๋ผ์ด๋ ์คํ์ผ๋ง -->
|
| 72 |
<style>
|
| 73 |
+
input[type=range] {{
|
| 74 |
-webkit-appearance: none;
|
| 75 |
width: 100%;
|
| 76 |
height: 5px;
|
|
|
|
| 79 |
opacity: 0.7;
|
| 80 |
-webkit-transition: .2s;
|
| 81 |
transition: opacity .2s;
|
| 82 |
+
}}
|
| 83 |
|
| 84 |
+
input[type=range]::-webkit-slider-thumb {{
|
| 85 |
-webkit-appearance: none;
|
| 86 |
appearance: none;
|
| 87 |
width: 15px;
|
|
|
|
| 89 |
background: #4CAF50;
|
| 90 |
cursor: pointer;
|
| 91 |
border-radius: 50%;
|
| 92 |
+
}}
|
| 93 |
|
| 94 |
+
input[type=range]::-moz-range-thumb {{
|
| 95 |
width: 15px;
|
| 96 |
height: 15px;
|
| 97 |
background: #4CAF50;
|
| 98 |
cursor: pointer;
|
| 99 |
border-radius: 50%;
|
| 100 |
+
}}
|
| 101 |
</style>
|
| 102 |
</div>
|
| 103 |
"""
|
|
|
|
| 121 |
comparison_html = generate_comparison_html(original_base64, transformed_base64)
|
| 122 |
|
| 123 |
# ๋ณํ๋ ์ด๋ฏธ์ง๋ฅผ ์์ ํ์ผ๋ก ์ ์ฅ
|
| 124 |
+
with tempfile.NamedTemporaryFile(suffix=".jpg", delete=False, prefix="transformed_", dir="/tmp") as tmp_file:
|
| 125 |
transformed.save(tmp_file, format="JPEG")
|
| 126 |
tmp_file_path = tmp_file.name
|
| 127 |
|
|
|
|
| 168 |
|
| 169 |
gr.Markdown("ยฉ๏ธ 2024 ๋ถ์๊ธฐ ์๋ ํ๋ฐฑ ์ฌ์ง ๋ณํ๊ธฐ by OpenAI")
|
| 170 |
|
| 171 |
+
demo.launch()
|