Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +16 -16
templates/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;800&display=swap" rel="stylesheet" />
|
| 9 |
|
| 10 |
<style>
|
| 11 |
-
/*
|
| 12 |
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
| 13 |
|
| 14 |
:root {
|
|
@@ -36,7 +36,7 @@
|
|
| 36 |
padding: 40px 20px 80px;
|
| 37 |
}
|
| 38 |
|
| 39 |
-
/*
|
| 40 |
body::before {
|
| 41 |
content: "";
|
| 42 |
position: fixed;
|
|
@@ -49,7 +49,7 @@
|
|
| 49 |
z-index: 0;
|
| 50 |
}
|
| 51 |
|
| 52 |
-
/*
|
| 53 |
header {
|
| 54 |
text-align: center;
|
| 55 |
margin-bottom: 48px;
|
|
@@ -103,7 +103,7 @@
|
|
| 103 |
letter-spacing: 0.05em;
|
| 104 |
}
|
| 105 |
|
| 106 |
-
/*
|
| 107 |
.card {
|
| 108 |
width: 100%;
|
| 109 |
max-width: 640px;
|
|
@@ -118,7 +118,7 @@
|
|
| 118 |
|
| 119 |
.card + .card { margin-top: 24px; }
|
| 120 |
|
| 121 |
-
/*
|
| 122 |
.field-label {
|
| 123 |
font-size: 11px;
|
| 124 |
letter-spacing: 0.12em;
|
|
@@ -268,7 +268,7 @@
|
|
| 268 |
opacity: 0.7;
|
| 269 |
}
|
| 270 |
|
| 271 |
-
/*
|
| 272 |
.error-banner {
|
| 273 |
background: rgba(255, 80, 80, 0.1);
|
| 274 |
border: 1px solid rgba(255, 80, 80, 0.3);
|
|
@@ -280,7 +280,7 @@
|
|
| 280 |
margin-bottom: 24px;
|
| 281 |
}
|
| 282 |
|
| 283 |
-
/*
|
| 284 |
.result-header {
|
| 285 |
display: flex;
|
| 286 |
align-items: center;
|
|
@@ -342,7 +342,7 @@
|
|
| 342 |
margin-top: 8px;
|
| 343 |
}
|
| 344 |
|
| 345 |
-
/*
|
| 346 |
.prob-list { display: flex; flex-direction: column; gap: 10px; }
|
| 347 |
|
| 348 |
.prob-row {
|
|
@@ -383,7 +383,7 @@
|
|
| 383 |
.prob-row.top .prob-name { color: var(--text); font-weight: bold; }
|
| 384 |
.prob-row.top .prob-val { color: var(--success); }
|
| 385 |
|
| 386 |
-
/*
|
| 387 |
.btn-reset {
|
| 388 |
margin-top: 24px;
|
| 389 |
display: block;
|
|
@@ -403,7 +403,7 @@
|
|
| 403 |
color: var(--accent);
|
| 404 |
}
|
| 405 |
|
| 406 |
-
/*
|
| 407 |
footer {
|
| 408 |
margin-top: 48px;
|
| 409 |
font-size: 11px;
|
|
@@ -416,7 +416,7 @@
|
|
| 416 |
|
| 417 |
footer span { color: var(--accent); }
|
| 418 |
|
| 419 |
-
/*
|
| 420 |
@media (max-width: 480px) {
|
| 421 |
.card { padding: 24px 18px; }
|
| 422 |
.model-btn .icon { font-size: 22px; }
|
|
@@ -425,21 +425,21 @@
|
|
| 425 |
</head>
|
| 426 |
<body>
|
| 427 |
|
| 428 |
-
|
| 429 |
<header>
|
| 430 |
<div class="logo-badge">NEURAL SCENE CLASSIFIER</div>
|
| 431 |
<h1>Intel Image<br/>Classification</h1>
|
| 432 |
<p class="subtitle">// 6 classes Β· PyTorch & TensorFlow Β· Custom CNN</p>
|
| 433 |
</header>
|
| 434 |
|
| 435 |
-
|
| 436 |
{% if error %}
|
| 437 |
<div class="card" style="max-width:640px;width:100%;position:relative;z-index:1;">
|
| 438 |
<div class="error-banner">β {{ error }}</div>
|
| 439 |
</div>
|
| 440 |
{% endif %}
|
| 441 |
|
| 442 |
-
|
| 443 |
{% if result %}
|
| 444 |
<div class="card">
|
| 445 |
|
|
@@ -481,7 +481,7 @@
|
|
| 481 |
<a href="/" class="btn-reset">β© Classify another image</a>
|
| 482 |
</div>
|
| 483 |
|
| 484 |
-
<!--
|
| 485 |
{% else %}
|
| 486 |
<div class="card">
|
| 487 |
<form method="POST" action="/predict" enctype="multipart/form-data" id="upload-form">
|
|
@@ -538,7 +538,7 @@
|
|
| 538 |
Custom CNN β no pretrained weights
|
| 539 |
</footer>
|
| 540 |
|
| 541 |
-
<!--
|
| 542 |
<script>
|
| 543 |
const dropZone = document.getElementById('drop-zone');
|
| 544 |
const fileInput = document.getElementById('file-input');
|
|
|
|
| 8 |
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;800&display=swap" rel="stylesheet" />
|
| 9 |
|
| 10 |
<style>
|
| 11 |
+
/* Reset & CSS vars */
|
| 12 |
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
| 13 |
|
| 14 |
:root {
|
|
|
|
| 36 |
padding: 40px 20px 80px;
|
| 37 |
}
|
| 38 |
|
| 39 |
+
/* Animated grid background */
|
| 40 |
body::before {
|
| 41 |
content: "";
|
| 42 |
position: fixed;
|
|
|
|
| 49 |
z-index: 0;
|
| 50 |
}
|
| 51 |
|
| 52 |
+
/* Header */
|
| 53 |
header {
|
| 54 |
text-align: center;
|
| 55 |
margin-bottom: 48px;
|
|
|
|
| 103 |
letter-spacing: 0.05em;
|
| 104 |
}
|
| 105 |
|
| 106 |
+
/* Main card */
|
| 107 |
.card {
|
| 108 |
width: 100%;
|
| 109 |
max-width: 640px;
|
|
|
|
| 118 |
|
| 119 |
.card + .card { margin-top: 24px; }
|
| 120 |
|
| 121 |
+
/* Form */
|
| 122 |
.field-label {
|
| 123 |
font-size: 11px;
|
| 124 |
letter-spacing: 0.12em;
|
|
|
|
| 268 |
opacity: 0.7;
|
| 269 |
}
|
| 270 |
|
| 271 |
+
/* Error banner */
|
| 272 |
.error-banner {
|
| 273 |
background: rgba(255, 80, 80, 0.1);
|
| 274 |
border: 1px solid rgba(255, 80, 80, 0.3);
|
|
|
|
| 280 |
margin-bottom: 24px;
|
| 281 |
}
|
| 282 |
|
| 283 |
+
/* Result section */
|
| 284 |
.result-header {
|
| 285 |
display: flex;
|
| 286 |
align-items: center;
|
|
|
|
| 342 |
margin-top: 8px;
|
| 343 |
}
|
| 344 |
|
| 345 |
+
/* Probability bars */
|
| 346 |
.prob-list { display: flex; flex-direction: column; gap: 10px; }
|
| 347 |
|
| 348 |
.prob-row {
|
|
|
|
| 383 |
.prob-row.top .prob-name { color: var(--text); font-weight: bold; }
|
| 384 |
.prob-row.top .prob-val { color: var(--success); }
|
| 385 |
|
| 386 |
+
/* Try again button */
|
| 387 |
.btn-reset {
|
| 388 |
margin-top: 24px;
|
| 389 |
display: block;
|
|
|
|
| 403 |
color: var(--accent);
|
| 404 |
}
|
| 405 |
|
| 406 |
+
/* Footer */
|
| 407 |
footer {
|
| 408 |
margin-top: 48px;
|
| 409 |
font-size: 11px;
|
|
|
|
| 416 |
|
| 417 |
footer span { color: var(--accent); }
|
| 418 |
|
| 419 |
+
/* Responsive */
|
| 420 |
@media (max-width: 480px) {
|
| 421 |
.card { padding: 24px 18px; }
|
| 422 |
.model-btn .icon { font-size: 22px; }
|
|
|
|
| 425 |
</head>
|
| 426 |
<body>
|
| 427 |
|
| 428 |
+
|
| 429 |
<header>
|
| 430 |
<div class="logo-badge">NEURAL SCENE CLASSIFIER</div>
|
| 431 |
<h1>Intel Image<br/>Classification</h1>
|
| 432 |
<p class="subtitle">// 6 classes Β· PyTorch & TensorFlow Β· Custom CNN</p>
|
| 433 |
</header>
|
| 434 |
|
| 435 |
+
|
| 436 |
{% if error %}
|
| 437 |
<div class="card" style="max-width:640px;width:100%;position:relative;z-index:1;">
|
| 438 |
<div class="error-banner">β {{ error }}</div>
|
| 439 |
</div>
|
| 440 |
{% endif %}
|
| 441 |
|
| 442 |
+
|
| 443 |
{% if result %}
|
| 444 |
<div class="card">
|
| 445 |
|
|
|
|
| 481 |
<a href="/" class="btn-reset">β© Classify another image</a>
|
| 482 |
</div>
|
| 483 |
|
| 484 |
+
<!-- UPLOAD FORM -->
|
| 485 |
{% else %}
|
| 486 |
<div class="card">
|
| 487 |
<form method="POST" action="/predict" enctype="multipart/form-data" id="upload-form">
|
|
|
|
| 538 |
Custom CNN β no pretrained weights
|
| 539 |
</footer>
|
| 540 |
|
| 541 |
+
<!-- JS: drag-drop, preview, loading state -->
|
| 542 |
<script>
|
| 543 |
const dropZone = document.getElementById('drop-zone');
|
| 544 |
const fileInput = document.getElementById('file-input');
|