Spaces:
Running
Running
Delete index.html
Browse files- index.html +0 -68
index.html
DELETED
|
@@ -1,68 +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="Explore image classification with ResNet, ViT and CLIP. Real pretrained models run in your browser.">
|
| 7 |
-
<title>AI-Powered Image Classification</title>
|
| 8 |
-
<link rel="stylesheet" href="style.css">
|
| 9 |
-
<script type="module" src="app.js"></script>
|
| 10 |
-
</head>
|
| 11 |
-
<body>
|
| 12 |
-
<main>
|
| 13 |
-
<header class="hero">
|
| 14 |
-
<div class="eyebrow">CREATIVE TECHNOLOGY · AI-POWERED COMPUTER VISION</div>
|
| 15 |
-
<div class="hero-line"><h1>AI-Powered<br>Image Classification</h1><span class="local-badge"><span></span> Runs in your browser</span></div>
|
| 16 |
-
<p>Give a pretrained model an image. Inspect its labels,<br class="desktop-break"> compare its decisions, and explain what changes.</p>
|
| 17 |
-
<div class="tags"><span class="blue">ResNet-18</span><span class="purple">ViT-B/16</span><span class="green">CLIP</span><span class="neutral">No training required</span></div>
|
| 18 |
-
</header>
|
| 19 |
-
<p class="start-note"><strong>Start here:</strong> keep the cat sample and ResNet-18 selected, then click <strong>Classify image</strong>. The first run downloads a model; later runs can use the browser cache.</p>
|
| 20 |
-
<div class="workspace">
|
| 21 |
-
<section class="panel image-panel" aria-labelledby="image-heading">
|
| 22 |
-
<h2 id="image-heading"><span class="step">1</span> Choose an image</h2>
|
| 23 |
-
<div class="preview"><img id="preview" crossorigin="anonymous" src="chelsea.png" alt="Cat sample selected for classification"></div>
|
| 24 |
-
<div class="image-meta"><span id="image-name">Cat sample</span><label class="upload-button" for="upload">Upload image<input id="upload" type="file" accept="image/png,image/jpeg,image/webp"></label></div>
|
| 25 |
-
<div class="samples" aria-label="Teaching samples">
|
| 26 |
-
<button class="sample selected" data-file="chelsea.png" data-label="Cat" aria-pressed="true"><img src="chelsea.png" alt=""><span>Cat</span></button>
|
| 27 |
-
<button class="sample" data-file="coffee.png" data-label="Coffee" aria-pressed="false"><img src="coffee.png" alt=""><span>Coffee</span></button>
|
| 28 |
-
<button class="sample" data-file="rocket.jpg" data-label="Rocket" aria-pressed="false"><img src="rocket.jpg" alt=""><span>Rocket</span></button>
|
| 29 |
-
<button class="sample" data-file="astronaut.png" data-label="Astronaut" aria-pressed="false"><img src="astronaut.png" alt=""><span>Astronaut</span></button>
|
| 30 |
-
</div>
|
| 31 |
-
<p class="hint">Four teaching photographs for exploration. This is not an accuracy benchmark.</p>
|
| 32 |
-
</section>
|
| 33 |
-
<section class="panel controls" aria-labelledby="model-heading">
|
| 34 |
-
<h2 id="model-heading"><span class="step">2</span> Choose a model</h2>
|
| 35 |
-
<label for="model">Pretrained model</label>
|
| 36 |
-
<select id="model"><option value="resnet18">ResNet-18 · CNN</option><option value="vit">ViT-B/16 · Vision Transformer</option><option value="clip">CLIP · Custom candidate labels</option></select>
|
| 37 |
-
<p class="model-description" id="model-description">A convolutional network with 1,000 fixed ImageNet labels. A small model to start with.</p>
|
| 38 |
-
<div class="range-label"><label for="topk">Number of labels to display</label><output id="topk-value" for="topk">5</output></div>
|
| 39 |
-
<input id="topk" type="range" min="1" max="10" step="1" value="5">
|
| 40 |
-
<div id="clip-controls" hidden>
|
| 41 |
-
<label for="labels">CLIP candidate labels</label>
|
| 42 |
-
<textarea id="labels" rows="3" spellcheck="false">a cat, a cup of coffee, a rocket, an astronaut, a dog, a car</textarea>
|
| 43 |
-
<p class="hint">Use 2–50 unique descriptions, separated by commas or newlines.</p>
|
| 44 |
-
<label for="template">Prompt template</label>
|
| 45 |
-
<select id="template"><option>a photo of {}</option><option>{}</option><option>an image showing {}</option></select>
|
| 46 |
-
</div>
|
| 47 |
-
<details class="review-setting"><summary>Review setting</summary><div class="range-label"><label for="threshold">Review threshold</label><output id="threshold-value" for="threshold">0.50</output></div><input id="threshold" type="range" min="0" max="1" step="0.05" value="0.5"><p class="hint">Flags a low top score for inspection. It does not filter labels or change the model.</p></details>
|
| 48 |
-
<button id="run" class="primary">Classify image <span aria-hidden="true">→</span></button>
|
| 49 |
-
<div class="status-wrap" aria-live="polite"><div id="status">Ready. Your selected image stays in this browser.</div><progress id="progress" max="100" value="0" hidden></progress></div>
|
| 50 |
-
<button id="cancel" class="text-button" hidden>Cancel model loading or inference</button>
|
| 51 |
-
</section>
|
| 52 |
-
</div>
|
| 53 |
-
<section class="panel results" aria-labelledby="results-heading">
|
| 54 |
-
<div class="section-heading"><h2 id="results-heading"><span class="step">3</span> Inspect the result</h2><span id="result-model" class="result-model">PREDICTION</span></div>
|
| 55 |
-
<div id="empty-state"><strong>Ready to explore</strong><p>Run a model to see the top prediction, ranked scores and an explanation.</p></div>
|
| 56 |
-
<div id="result-content" hidden>
|
| 57 |
-
<div class="result-headline"><div><div class="eyebrow">TOP PREDICTION</div><h3 id="top-label"></h3><p id="result-context"></p></div><div class="score-number"><strong id="top-score"></strong><span>model score</span></div></div>
|
| 58 |
-
<div class="result-grid"><div id="bars" aria-label="Ranked model scores"></div><div class="table-wrap"><table><thead><tr><th scope="col">Rank</th><th scope="col">Label</th><th scope="col">Score</th></tr></thead><tbody id="rows"></tbody></table></div></div>
|
| 59 |
-
<div class="result-note"><strong id="review-note"></strong><p id="score-note"></p><p id="timing-note" class="hint"></p></div>
|
| 60 |
-
<div class="downloads"><button id="json-download" class="secondary">Download JSON</button><button id="csv-download" class="secondary">Download CSV</button></div>
|
| 61 |
-
<details><summary>Structured result and model details</summary><pre id="json-output"></pre></details>
|
| 62 |
-
</div>
|
| 63 |
-
</section>
|
| 64 |
-
<section class="experiment"><h2>One change. One observation.</h2><div class="experiment-grid"><article><span class="mini-number">01</span><h3>Compare models</h3><p>Keep the image fixed. Switch ResNet to ViT and explain which labels changed.</p></article><article><span class="mini-number">02</span><h3>Change the candidates</h3><p>Use CLIP on the cat. Remove “a cat” from the candidates, then inspect the new result.</p></article><article><span class="mini-number">03</span><h3>Explain a failure</h3><p>Save the settings and output. Describe a missed concept, an unsuitable label, or an image crop.</p></article></div></section>
|
| 65 |
-
<footer><p><strong>Classification describes the whole image.</strong> It does not locate or count objects. Scores from different label spaces are not directly comparable as accuracy measures.</p><p>Models download from Hugging Face and run locally with Transformers.js. Selected images are not uploaded for inference. Browser checkpoints use quantized ONNX weights, so results may differ from the Python course examples.</p><details><summary>Models and sample sources</summary><p><a href="https://huggingface.co/Xenova/resnet-18" target="_blank" rel="noopener noreferrer">ResNet-18</a> · <a href="https://huggingface.co/Xenova/vit-base-patch16-224" target="_blank" rel="noopener noreferrer">ViT-B/16</a> · <a href="https://huggingface.co/Xenova/clip-vit-base-patch32" target="_blank" rel="noopener noreferrer">CLIP ViT-B/32</a></p><p>Samples: <a href="https://scikit-image.org/docs/stable/api/skimage.data.html" target="_blank" rel="noopener noreferrer">scikit-image collection</a>, CC0 or public domain. Source URLs and hashes: <a href="sample-manifest.json">sample manifest</a>.</p></details></footer>
|
| 66 |
-
</main>
|
| 67 |
-
</body>
|
| 68 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|