Spaces:
Running on Zero
Running on Zero
Commit Β·
db9d3a5
1
Parent(s): 1e2257c
Fix layout: restore banner CSS, use gr.Group for cards, improve footer contrast
Browse files
app.py
CHANGED
|
@@ -78,114 +78,57 @@ footer { display: none !important; }
|
|
| 78 |
.gradio-container { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
|
| 79 |
.main { padding: 0 !important; }
|
| 80 |
|
| 81 |
-
/* ββ TOP NAVBAR ββ */
|
| 82 |
-
.top-nav {
|
| 83 |
-
background: linear-gradient(135deg, #0a2540 0%, #0e4a6e 40%, #1a6b5a 100%);
|
| 84 |
-
background-size: cover;
|
| 85 |
-
padding: 18px 40px;
|
| 86 |
-
display: flex;
|
| 87 |
-
justify-content: space-between;
|
| 88 |
-
align-items: center;
|
| 89 |
position: relative;
|
|
|
|
| 90 |
overflow: hidden;
|
| 91 |
-
|
| 92 |
-
border-bottom: 2px solid rgba(32, 201, 151, 0.3);
|
| 93 |
-
}
|
| 94 |
-
.top-nav::before {
|
| 95 |
-
content: '';
|
| 96 |
-
position: absolute;
|
| 97 |
-
inset: 0;
|
| 98 |
-
background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2320c997' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
|
| 99 |
-
opacity: 0.5;
|
| 100 |
-
}
|
| 101 |
-
.nav-left {
|
| 102 |
-
display: flex;
|
| 103 |
-
align-items: center;
|
| 104 |
-
gap: 14px;
|
| 105 |
-
z-index: 1;
|
| 106 |
-
}
|
| 107 |
-
.nav-logo-wrap {
|
| 108 |
-
background: rgba(32, 201, 151, 0.15);
|
| 109 |
-
border: 1px solid rgba(32, 201, 151, 0.3);
|
| 110 |
-
border-radius: 12px;
|
| 111 |
-
padding: 8px 10px;
|
| 112 |
-
display: flex;
|
| 113 |
-
align-items: center;
|
| 114 |
-
justify-content: center;
|
| 115 |
-
}
|
| 116 |
-
.nav-logo-wrap svg { width: 38px; height: 38px; }
|
| 117 |
-
.nav-brand { display: flex; flex-direction: column; }
|
| 118 |
-
.nav-brand-name {
|
| 119 |
-
font-size: 1.75rem;
|
| 120 |
-
font-weight: 800;
|
| 121 |
-
color: #20c997;
|
| 122 |
-
line-height: 1;
|
| 123 |
-
letter-spacing: -0.5px;
|
| 124 |
-
margin: 0;
|
| 125 |
}
|
| 126 |
-
.nav-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
letter-spacing: 0.2px;
|
| 133 |
-
}
|
| 134 |
-
.nav-brand-tagline {
|
| 135 |
-
font-size: 0.72rem;
|
| 136 |
-
color: rgba(255,255,255,0.45);
|
| 137 |
-
margin: 1px 0 0;
|
| 138 |
-
font-style: italic;
|
| 139 |
}
|
| 140 |
-
.nav-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
display: flex;
|
|
|
|
|
|
|
| 142 |
gap: 28px;
|
| 143 |
-
|
| 144 |
-
z-index: 1;
|
| 145 |
}
|
| 146 |
-
.nav-
|
| 147 |
-
color: rgba(255,255,255,0.
|
| 148 |
text-decoration: none;
|
| 149 |
font-size: 0.9rem;
|
| 150 |
font-weight: 500;
|
| 151 |
padding-bottom: 2px;
|
| 152 |
-
transition: color 0.2s;
|
| 153 |
border-bottom: 2px solid transparent;
|
|
|
|
|
|
|
| 154 |
}
|
| 155 |
-
.nav-
|
| 156 |
-
.nav-
|
| 157 |
-
|
| 158 |
-
border-bottom-color: #20c997;
|
| 159 |
-
padding-bottom: 2px;
|
| 160 |
-
}
|
| 161 |
-
.nav-right {
|
| 162 |
-
display: flex;
|
| 163 |
-
align-items: center;
|
| 164 |
-
gap: 20px;
|
| 165 |
-
z-index: 1;
|
| 166 |
-
}
|
| 167 |
-
.nav-quote {
|
| 168 |
-
text-align: right;
|
| 169 |
-
color: rgba(255,255,255,0.65);
|
| 170 |
-
font-size: 0.78rem;
|
| 171 |
-
font-style: italic;
|
| 172 |
-
line-height: 1.5;
|
| 173 |
-
}
|
| 174 |
-
.nav-quote strong { color: rgba(255,255,255,0.85); font-style: normal; }
|
| 175 |
-
.nav-cta {
|
| 176 |
background: #20c997;
|
| 177 |
color: #0a2540 !important;
|
| 178 |
-
padding:
|
| 179 |
-
border-radius:
|
| 180 |
font-weight: 700;
|
| 181 |
-
font-size: 0.
|
| 182 |
text-decoration: none;
|
| 183 |
white-space: nowrap;
|
| 184 |
transition: background 0.2s, transform 0.15s;
|
| 185 |
-
|
| 186 |
-
|
| 187 |
}
|
| 188 |
-
.nav-cta:hover { background: #12b886; transform: translateY(-1px); }
|
| 189 |
|
| 190 |
/* ββ BODY LAYOUT ββ */
|
| 191 |
.body-layout {
|
|
@@ -346,12 +289,12 @@ footer { display: none !important; }
|
|
| 346 |
/* Model Panel */
|
| 347 |
.model-panel {
|
| 348 |
background: white;
|
| 349 |
-
border-radius: 16px;
|
| 350 |
-
border: 1px solid #e2e8f0;
|
| 351 |
-
padding:
|
| 352 |
display: flex;
|
| 353 |
flex-direction: column;
|
| 354 |
-
gap:
|
| 355 |
box-shadow: 0 1px 8px rgba(0,0,0,0.04);
|
| 356 |
}
|
| 357 |
.model-label {
|
|
@@ -462,9 +405,9 @@ footer { display: none !important; }
|
|
| 462 |
}
|
| 463 |
|
| 464 |
.img-card {
|
| 465 |
-
background: white;
|
| 466 |
-
border: 1px solid #e2e8f0;
|
| 467 |
-
border-radius: 16px;
|
| 468 |
overflow: hidden;
|
| 469 |
box-shadow: 0 2px 12px rgba(0,0,0,0.05);
|
| 470 |
}
|
|
@@ -559,13 +502,13 @@ footer { display: none !important; }
|
|
| 559 |
.footer-brand { color: rgba(255,255,255,0.85); font-weight: 600; }
|
| 560 |
.footer-links { display: flex; gap: 20px; align-items: center; }
|
| 561 |
.footer-links a {
|
| 562 |
-
color: rgba(255,255,255,0.
|
| 563 |
text-decoration: none;
|
| 564 |
transition: color 0.2s;
|
| 565 |
}
|
| 566 |
.footer-links a:hover { color: white; }
|
| 567 |
.footer-socials { display: flex; gap: 14px; align-items: center; }
|
| 568 |
-
.footer-socials a { color: rgba(255,255,255,0.
|
| 569 |
.footer-socials a:hover { color: white; }
|
| 570 |
"""
|
| 571 |
|
|
@@ -839,26 +782,27 @@ with gr.Blocks(css=CSS, title="SentiEnhance β AI Satellite Super-Resolution")
|
|
| 839 |
|
| 840 |
# Model + Enhance
|
| 841 |
with gr.Column(scale=3):
|
| 842 |
-
gr.
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
|
| 847 |
-
|
| 848 |
-
|
| 849 |
-
|
| 850 |
-
|
| 851 |
-
|
| 852 |
-
|
| 853 |
-
|
| 854 |
-
|
| 855 |
-
|
| 856 |
-
|
| 857 |
-
|
| 858 |
-
|
| 859 |
-
|
| 860 |
-
|
| 861 |
-
|
|
|
|
| 862 |
enhance_btn = gr.Button("β¨ Enhance Image", elem_id="enhance-btn")
|
| 863 |
gr.HTML('<div class="processing-hint">Processing may take a few moments...</div>')
|
| 864 |
|
|
@@ -870,52 +814,55 @@ with gr.Blocks(css=CSS, title="SentiEnhance β AI Satellite Super-Resolution")
|
|
| 870 |
gr.HTML('<div class="results-title">Results</div>')
|
| 871 |
|
| 872 |
with gr.Row():
|
| 873 |
-
with gr.Column(scale=5
|
| 874 |
-
gr.
|
| 875 |
-
|
| 876 |
-
|
| 877 |
-
|
| 878 |
-
|
| 879 |
-
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
| 883 |
-
|
| 884 |
-
|
| 885 |
-
|
| 886 |
-
|
| 887 |
-
|
| 888 |
-
|
|
|
|
| 889 |
|
| 890 |
-
with gr.Column(scale=5
|
| 891 |
-
gr.
|
| 892 |
-
|
| 893 |
-
|
| 894 |
-
|
| 895 |
-
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
|
| 899 |
-
|
| 900 |
-
|
| 901 |
-
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
|
|
|
| 906 |
|
| 907 |
with gr.Column(scale=3):
|
| 908 |
-
gr.
|
| 909 |
-
|
| 910 |
-
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
|
|
|
| 919 |
|
| 920 |
gr.HTML(FOOTER_HTML)
|
| 921 |
|
|
|
|
| 78 |
.gradio-container { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
|
| 79 |
.main { padding: 0 !important; }
|
| 80 |
|
| 81 |
+
/* ββ TOP NAVBAR BANNER ββ */
|
| 82 |
+
.top-nav-banner {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
position: relative;
|
| 84 |
+
width: 100%;
|
| 85 |
overflow: hidden;
|
| 86 |
+
border-bottom: 2px solid rgba(32, 201, 151, 0.4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
}
|
| 88 |
+
.top-nav-banner img {
|
| 89 |
+
width: 100%;
|
| 90 |
+
height: 160px;
|
| 91 |
+
object-fit: cover;
|
| 92 |
+
object-position: center 30%;
|
| 93 |
+
display: block;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
}
|
| 95 |
+
.top-nav-links-bar {
|
| 96 |
+
position: absolute;
|
| 97 |
+
top: 0;
|
| 98 |
+
right: 0;
|
| 99 |
+
height: 100%;
|
| 100 |
display: flex;
|
| 101 |
+
align-items: flex-start;
|
| 102 |
+
padding: 18px 36px 0;
|
| 103 |
gap: 28px;
|
| 104 |
+
z-index: 10;
|
|
|
|
| 105 |
}
|
| 106 |
+
.nav-link-item {
|
| 107 |
+
color: rgba(255,255,255,0.88);
|
| 108 |
text-decoration: none;
|
| 109 |
font-size: 0.9rem;
|
| 110 |
font-weight: 500;
|
| 111 |
padding-bottom: 2px;
|
|
|
|
| 112 |
border-bottom: 2px solid transparent;
|
| 113 |
+
transition: color 0.2s, border-color 0.2s;
|
| 114 |
+
text-shadow: 0 1px 4px rgba(0,0,0,0.5);
|
| 115 |
}
|
| 116 |
+
.nav-link-item:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.5); }
|
| 117 |
+
.nav-link-item.active { color: #fff; border-bottom-color: #20c997; }
|
| 118 |
+
.nav-cta-top {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
background: #20c997;
|
| 120 |
color: #0a2540 !important;
|
| 121 |
+
padding: 8px 20px;
|
| 122 |
+
border-radius: 7px;
|
| 123 |
font-weight: 700;
|
| 124 |
+
font-size: 0.88rem;
|
| 125 |
text-decoration: none;
|
| 126 |
white-space: nowrap;
|
| 127 |
transition: background 0.2s, transform 0.15s;
|
| 128 |
+
box-shadow: 0 2px 10px rgba(0,0,0,0.25);
|
| 129 |
+
text-shadow: none;
|
| 130 |
}
|
| 131 |
+
.nav-cta-top:hover { background: #12b886; transform: translateY(-1px); }
|
| 132 |
|
| 133 |
/* ββ BODY LAYOUT ββ */
|
| 134 |
.body-layout {
|
|
|
|
| 289 |
/* Model Panel */
|
| 290 |
.model-panel {
|
| 291 |
background: white;
|
| 292 |
+
border-radius: 16px !important;
|
| 293 |
+
border: 1px solid #e2e8f0 !important;
|
| 294 |
+
padding: 16px !important;
|
| 295 |
display: flex;
|
| 296 |
flex-direction: column;
|
| 297 |
+
gap: 10px;
|
| 298 |
box-shadow: 0 1px 8px rgba(0,0,0,0.04);
|
| 299 |
}
|
| 300 |
.model-label {
|
|
|
|
| 405 |
}
|
| 406 |
|
| 407 |
.img-card {
|
| 408 |
+
background: white !important;
|
| 409 |
+
border: 1px solid #e2e8f0 !important;
|
| 410 |
+
border-radius: 16px !important;
|
| 411 |
overflow: hidden;
|
| 412 |
box-shadow: 0 2px 12px rgba(0,0,0,0.05);
|
| 413 |
}
|
|
|
|
| 502 |
.footer-brand { color: rgba(255,255,255,0.85); font-weight: 600; }
|
| 503 |
.footer-links { display: flex; gap: 20px; align-items: center; }
|
| 504 |
.footer-links a {
|
| 505 |
+
color: rgba(255,255,255,0.75);
|
| 506 |
text-decoration: none;
|
| 507 |
transition: color 0.2s;
|
| 508 |
}
|
| 509 |
.footer-links a:hover { color: white; }
|
| 510 |
.footer-socials { display: flex; gap: 14px; align-items: center; }
|
| 511 |
+
.footer-socials a { color: rgba(255,255,255,0.75); transition: color 0.2s; }
|
| 512 |
.footer-socials a:hover { color: white; }
|
| 513 |
"""
|
| 514 |
|
|
|
|
| 782 |
|
| 783 |
# Model + Enhance
|
| 784 |
with gr.Column(scale=3):
|
| 785 |
+
with gr.Group(elem_classes="model-panel"):
|
| 786 |
+
gr.HTML("""
|
| 787 |
+
<div class="model-label">Model Selection</div>
|
| 788 |
+
""")
|
| 789 |
+
model_selector = gr.Dropdown(
|
| 790 |
+
choices=["HAT-SAT (Recommended)", "ESRGAN (Baseline)"],
|
| 791 |
+
value="HAT-SAT (Recommended)",
|
| 792 |
+
show_label=False,
|
| 793 |
+
container=False
|
| 794 |
+
)
|
| 795 |
+
gr.HTML("""
|
| 796 |
+
<div style="display:flex;align-items:center;gap:8px;margin:6px 0 2px;">
|
| 797 |
+
<span style="font-size:0.78rem;color:#64748b;">Selected Model:</span>
|
| 798 |
+
<span class="model-best-badge">Best Quality</span>
|
| 799 |
+
</div>
|
| 800 |
+
<div class="model-info">
|
| 801 |
+
<strong>HAT-SAT:</strong> State-of-the-art model for satellite image super-resolution with high detail and spectral consistency.
|
| 802 |
+
</div>
|
| 803 |
+
""")
|
| 804 |
+
|
| 805 |
+
gr.HTML("<br>")
|
| 806 |
enhance_btn = gr.Button("β¨ Enhance Image", elem_id="enhance-btn")
|
| 807 |
gr.HTML('<div class="processing-hint">Processing may take a few moments...</div>')
|
| 808 |
|
|
|
|
| 814 |
gr.HTML('<div class="results-title">Results</div>')
|
| 815 |
|
| 816 |
with gr.Row():
|
| 817 |
+
with gr.Column(scale=5):
|
| 818 |
+
with gr.Group(elem_classes="img-card"):
|
| 819 |
+
gr.HTML("""
|
| 820 |
+
<div class="img-card-header">
|
| 821 |
+
<div class="img-card-label">
|
| 822 |
+
<span class="img-label-dot original"></span>
|
| 823 |
+
Original (Sentinel-2, 10m)
|
| 824 |
+
</div>
|
| 825 |
+
</div>
|
| 826 |
+
""")
|
| 827 |
+
original_image = gr.Image(
|
| 828 |
+
label="",
|
| 829 |
+
type="pil",
|
| 830 |
+
interactive=False,
|
| 831 |
+
show_label=False,
|
| 832 |
+
elem_classes="result-img-wrap"
|
| 833 |
+
)
|
| 834 |
|
| 835 |
+
with gr.Column(scale=5):
|
| 836 |
+
with gr.Group(elem_classes="img-card"):
|
| 837 |
+
gr.HTML("""
|
| 838 |
+
<div class="img-card-header">
|
| 839 |
+
<div class="img-card-label">
|
| 840 |
+
<span class="img-label-dot enhanced"></span>
|
| 841 |
+
Enhanced (HAT-SAT, 4x)
|
| 842 |
+
</div>
|
| 843 |
+
</div>
|
| 844 |
+
""")
|
| 845 |
+
enhanced_image = gr.Image(
|
| 846 |
+
label="",
|
| 847 |
+
type="pil",
|
| 848 |
+
interactive=False,
|
| 849 |
+
show_label=False,
|
| 850 |
+
elem_classes="result-img-wrap"
|
| 851 |
+
)
|
| 852 |
|
| 853 |
with gr.Column(scale=3):
|
| 854 |
+
with gr.Group(elem_classes="dl-panel"):
|
| 855 |
+
gr.HTML('<div class="dl-title">Download & Share</div>')
|
| 856 |
+
download_png = gr.DownloadButton(
|
| 857 |
+
"π₯ Download Enhanced Image",
|
| 858 |
+
elem_id="dl-png-btn"
|
| 859 |
+
)
|
| 860 |
+
download_tiff = gr.DownloadButton(
|
| 861 |
+
"π Download as GeoTIFF",
|
| 862 |
+
elem_classes="btn-outline-custom"
|
| 863 |
+
)
|
| 864 |
+
compare_btn = gr.Button("π Compare Images", elem_classes="btn-outline-custom")
|
| 865 |
+
share_btn = gr.Button("π Share Result", elem_classes="btn-outline-custom")
|
| 866 |
|
| 867 |
gr.HTML(FOOTER_HTML)
|
| 868 |
|