Spaces:
Running
Running
Delete index.html
Browse files- index.html +0 -125
index.html
DELETED
|
@@ -1,125 +0,0 @@
|
|
| 1 |
-
<!doctype html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="utf-8">
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
-
<meta name="description" content="AI-Powered Image Classification mini-lab using pretrained Hugging Face models">
|
| 7 |
-
<title>AI-Powered Image Classification</title>
|
| 8 |
-
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🖼️</text></svg>">
|
| 9 |
-
<link rel="stylesheet" href="./style.css">
|
| 10 |
-
</head>
|
| 11 |
-
<body>
|
| 12 |
-
<main class="page-shell">
|
| 13 |
-
<header class="hero">
|
| 14 |
-
<p class="eyebrow">Creative Technology · Computer Vision</p>
|
| 15 |
-
<h1>AI-Powered Image Classification</h1>
|
| 16 |
-
<p class="lede">Pick a tested example or upload your own image. Then choose a pretrained classifier and let AI answer: <strong>what is this image mainly about?</strong></p>
|
| 17 |
-
<div class="lesson-strip" aria-label="Mini-lab overview">
|
| 18 |
-
<span><b>Task</b> Image classification</span>
|
| 19 |
-
<span><b>Data</b> ImageNet labels or custom candidates</span>
|
| 20 |
-
<span><b>Models</b> ResNet · ViT · CLIP</span>
|
| 21 |
-
</div>
|
| 22 |
-
</header>
|
| 23 |
-
|
| 24 |
-
<section class="workspace" aria-label="Image classification mini-lab">
|
| 25 |
-
<div class="controls card">
|
| 26 |
-
<div class="step">
|
| 27 |
-
<span class="step-number">1</span>
|
| 28 |
-
<div>
|
| 29 |
-
<p class="control-label sample-title">Choose an image</p>
|
| 30 |
-
<p class="helper">Start with a tested example, or try a photo of your own.</p>
|
| 31 |
-
</div>
|
| 32 |
-
</div>
|
| 33 |
-
|
| 34 |
-
<div class="sample-head example-head">
|
| 35 |
-
<div>
|
| 36 |
-
<p class="input-kicker">Start here · Example images</p>
|
| 37 |
-
<p class="helper">Use one image across several models for a fair comparison.</p>
|
| 38 |
-
</div>
|
| 39 |
-
</div>
|
| 40 |
-
<div id="sample-grid" class="sample-grid" aria-label="Example images"></div>
|
| 41 |
-
<div class="or-row"><span>or try your own</span></div>
|
| 42 |
-
<label class="control-label" for="image-input">Upload an image</label>
|
| 43 |
-
<p class="helper">PNG, JPEG, or WebP works best.</p>
|
| 44 |
-
<input id="image-input" class="file-input" type="file" accept="image/png,image/jpeg,image/webp">
|
| 45 |
-
|
| 46 |
-
<div class="divider"></div>
|
| 47 |
-
|
| 48 |
-
<div class="step">
|
| 49 |
-
<span class="step-number">2</span>
|
| 50 |
-
<div class="grow">
|
| 51 |
-
<label class="control-label" for="model-select">Choose classifier</label>
|
| 52 |
-
<select id="model-select" class="model-select"></select>
|
| 53 |
-
<p id="model-note" class="helper"></p>
|
| 54 |
-
<div id="clip-controls" class="clip-controls" hidden>
|
| 55 |
-
<label class="control-label" for="candidate-labels">CLIP candidate labels</label>
|
| 56 |
-
<textarea id="candidate-labels" rows="3" spellcheck="false">a cat, a cup of coffee, a rocket, an astronaut, a dog, a car</textarea>
|
| 57 |
-
<p class="helper">Use 2–20 short descriptions, separated by commas or new lines.</p>
|
| 58 |
-
</div>
|
| 59 |
-
</div>
|
| 60 |
-
</div>
|
| 61 |
-
|
| 62 |
-
<div class="divider"></div>
|
| 63 |
-
|
| 64 |
-
<div class="step">
|
| 65 |
-
<span class="step-number">3</span>
|
| 66 |
-
<div class="grow">
|
| 67 |
-
<div class="slider-row">
|
| 68 |
-
<label class="control-label" for="top-k">Predictions to display</label>
|
| 69 |
-
<output id="top-k-value" for="top-k">5</output>
|
| 70 |
-
</div>
|
| 71 |
-
<input id="top-k" type="range" min="1" max="10" value="5" step="1">
|
| 72 |
-
<p class="helper">Top-k changes how many high-scoring labels are shown.</p>
|
| 73 |
-
</div>
|
| 74 |
-
</div>
|
| 75 |
-
|
| 76 |
-
<button id="run-button" class="run-button" type="button" disabled>Run AI Classification</button>
|
| 77 |
-
<p id="status" class="status" aria-live="polite">Choose an example or upload your own image.</p>
|
| 78 |
-
<div id="progress-wrap" class="progress-wrap" hidden>
|
| 79 |
-
<div id="progress-bar" class="progress-bar"></div>
|
| 80 |
-
</div>
|
| 81 |
-
</div>
|
| 82 |
-
|
| 83 |
-
<div class="result card">
|
| 84 |
-
<div class="result-head">
|
| 85 |
-
<div>
|
| 86 |
-
<p class="section-kicker">AI prediction</p>
|
| 87 |
-
<h2>What did the classifier predict?</h2>
|
| 88 |
-
</div>
|
| 89 |
-
<span id="runtime-badge" class="badge">Waiting</span>
|
| 90 |
-
</div>
|
| 91 |
-
<div id="preview-wrap" class="preview-wrap empty">
|
| 92 |
-
<img id="preview-image" alt="Selected image">
|
| 93 |
-
<p id="preview-placeholder">Choose an image first. It will appear here before classification.</p>
|
| 94 |
-
</div>
|
| 95 |
-
|
| 96 |
-
<div id="summary" class="summary">No predictions yet.</div>
|
| 97 |
-
|
| 98 |
-
<div class="table-wrap">
|
| 99 |
-
<table>
|
| 100 |
-
<thead><tr><th>Rank</th><th>Label</th><th>Score</th></tr></thead>
|
| 101 |
-
<tbody id="predictions-body">
|
| 102 |
-
<tr class="empty-row"><td colspan="3">Run the classifier to see details.</td></tr>
|
| 103 |
-
</tbody>
|
| 104 |
-
</table>
|
| 105 |
-
</div>
|
| 106 |
-
</div>
|
| 107 |
-
</section>
|
| 108 |
-
|
| 109 |
-
<section class="explain card">
|
| 110 |
-
<p class="section-kicker">What you are doing</p>
|
| 111 |
-
<h2 class="explain-title">Use a learned AI capability instead of rebuilding the traditional task from scratch.</h2>
|
| 112 |
-
<p class="explain-copy">ResNet and ViT choose from 1,000 fixed ImageNet classes. CLIP compares the image with descriptions that you provide. Keep the image fixed, change one setting, and explain why the output changes.</p>
|
| 113 |
-
<div class="flow" aria-label="Image classification flow">
|
| 114 |
-
<span>Example or your image</span><span class="arrow">→</span>
|
| 115 |
-
<span>Selected pretrained classifier</span><span class="arrow">→</span>
|
| 116 |
-
<span>Labels + scores</span>
|
| 117 |
-
</div>
|
| 118 |
-
<p class="extension-note"><strong>Compare models:</strong> keep the image fixed, switch classifier, and observe how labels, scores, and speed change.</p>
|
| 119 |
-
</section>
|
| 120 |
-
|
| 121 |
-
<footer>Hosted as a Hugging Face Static Space · Powered by Transformers.js</footer>
|
| 122 |
-
</main>
|
| 123 |
-
<script type="module" src="./app.js"></script>
|
| 124 |
-
</body>
|
| 125 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|