Upload 10 files
Browse files- .gitattributes +4 -0
- README.md +63 -5
- app.js +96 -0
- astronaut.png +3 -0
- chelsea.png +3 -0
- coffee.png +3 -0
- index.html +66 -17
- inference-worker.js +58 -0
- rocket.jpg +3 -0
- sample-manifest.json +58 -0
- style.css +1 -28
.gitattributes
CHANGED
|
@@ -33,3 +33,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
astronaut.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
chelsea.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
coffee.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
rocket.jpg filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,10 +1,68 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: gray
|
| 6 |
sdk: static
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: AI-Powered Image Classification
|
| 3 |
+
emoji: 🖼️
|
| 4 |
+
colorFrom: blue
|
| 5 |
colorTo: gray
|
| 6 |
sdk: static
|
| 7 |
+
app_file: index.html
|
| 8 |
+
fullWidth: true
|
| 9 |
+
short_description: Run ResNet, ViT and CLIP in your browser
|
| 10 |
+
models:
|
| 11 |
+
- Xenova/resnet-18
|
| 12 |
+
- Xenova/vit-base-patch16-224
|
| 13 |
+
- Xenova/clip-vit-base-patch32
|
| 14 |
+
tags:
|
| 15 |
+
- image-classification
|
| 16 |
+
- education
|
| 17 |
+
- transformers.js
|
| 18 |
---
|
| 19 |
|
| 20 |
+
# AI-Powered Image Classification
|
| 21 |
+
|
| 22 |
+
An English classroom demonstration with a pale background, blue accents and a clear sequence: choose an image, run a pretrained model, inspect evidence. No Python installation, model training or backend compute service is required to use this Space.
|
| 23 |
+
|
| 24 |
+
## Try it
|
| 25 |
+
|
| 26 |
+
1. Keep the cat sample and ResNet-18 selected, then click **Classify image**.
|
| 27 |
+
2. Wait for the real model download and browser inference. Progress is displayed. Cached files can be reused on later visits, subject to browser storage limits.
|
| 28 |
+
3. Compare ViT-B/16 on the same image.
|
| 29 |
+
4. Select CLIP and edit its candidate labels or prompt template.
|
| 30 |
+
5. Download JSON with settings and results, or a CSV prediction table.
|
| 31 |
+
|
| 32 |
+
## Models
|
| 33 |
+
|
| 34 |
+
| Model | Browser checkpoint | Label space |
|
| 35 |
+
|---|---|---|
|
| 36 |
+
| ResNet-18 | [Xenova/resnet-18](https://huggingface.co/Xenova/resnet-18) | 1,000 ImageNet classes |
|
| 37 |
+
| ViT-B/16 | [Xenova/vit-base-patch16-224](https://huggingface.co/Xenova/vit-base-patch16-224) | 1,000 ImageNet classes |
|
| 38 |
+
| CLIP ViT-B/32 | [Xenova/clip-vit-base-patch32](https://huggingface.co/Xenova/clip-vit-base-patch32) | User-supplied candidate descriptions |
|
| 39 |
+
|
| 40 |
+
The application uses Transformers.js 3.8.1 and quantized ONNX models (`q8`) on browser CPU through WebAssembly. A Web Worker keeps model computation separate from the interface. Only one selected model is kept in worker memory. Switching models releases the previous pipeline; downloaded files may remain in browser cache.
|
| 41 |
+
|
| 42 |
+
These are browser-compatible checkpoints from the same model families used in the Python course. They are not guaranteed to match the Python TorchVision checkpoints numerically. Compare browser results within this demo and record the exact model ID included in the JSON export.
|
| 43 |
+
|
| 44 |
+
## Read scores carefully
|
| 45 |
+
|
| 46 |
+
Top-k changes how many labels are displayed; it does not renormalize their scores. ResNet and ViT scores use the 1,000-class label space. CLIP scores are relative to the supplied candidates. Raw scores from different models are not accuracy comparisons.
|
| 47 |
+
|
| 48 |
+
The review threshold flags the top score only. It does not filter predictions, update weights, calibrate confidence or reliably identify unknown images. Inference time covers preprocessing, model computation and postprocessing; it excludes model loading and interface time. Timings depend on the user's device.
|
| 49 |
+
|
| 50 |
+
The four photographs form a small qualitative teaching set, not an accuracy benchmark. Classification describes the whole image and does not draw boxes or count objects.
|
| 51 |
+
|
| 52 |
+
## Data and images
|
| 53 |
+
|
| 54 |
+
Inference happens in the browser. The application does not upload the selected image, candidate labels or predictions to an inference server. Models and runtime libraries download from Hugging Face and jsDelivr. Export files are generated locally. Images larger than 1,536 pixels on their longest side are resized for browser processing. Uploads are limited to 12 MB and 25 megapixels.
|
| 55 |
+
|
| 56 |
+
Sample photographs come from the [scikit-image sample collection](https://scikit-image.org/docs/stable/api/skimage.data.html). Cat and coffee samples are CC0; astronaut and rocket samples are public domain. `sample-manifest.json` records source URLs, reuse status and hashes without personal names.
|
| 57 |
+
|
| 58 |
+
## Troubleshooting
|
| 59 |
+
|
| 60 |
+
- On first use, leave the page open while the model downloads. Large models take longer than ResNet-18.
|
| 61 |
+
- The network must allow Hugging Face model downloads and the pinned runtime on jsDelivr.
|
| 62 |
+
- If a download or inference fails, retry or use the Cancel control, then start with ResNet-18.
|
| 63 |
+
- Use a current desktop browser with WebAssembly and Web Worker support. Heavy models may exceed memory limits on some mobile devices.
|
| 64 |
+
- For CLIP, use 2–50 unique short candidate labels. A confident prediction can still be wrong when the relevant concept is absent.
|
| 65 |
+
|
| 66 |
+
## Local preview
|
| 67 |
+
|
| 68 |
+
Serve this folder using a local HTTP server, for example `python -m http.server 7862`, and open the localhost address. Opening `index.html` directly through `file://` does not provide a valid module-worker environment.
|
app.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const $ = (id) => document.getElementById(id);
|
| 2 |
+
const titles = {resnet18:"ResNet-18",vit:"ViT-B/16",clip:"CLIP ViT-B/32"};
|
| 3 |
+
const descriptions = {
|
| 4 |
+
resnet18:"A convolutional network with 1,000 fixed ImageNet labels. A small model to start with.",
|
| 5 |
+
vit:"A vision transformer with 1,000 fixed ImageNet labels. It compares patterns across image patches.",
|
| 6 |
+
clip:"A vision-language model. It ranks your candidate descriptions against the image.",
|
| 7 |
+
};
|
| 8 |
+
let worker, activeUrl, result, busy=false, sourceName="Cat sample", runSettings;
|
| 9 |
+
function setStatus(text,error=false){$("status").textContent=text;$("status").classList.toggle("error",error);}
|
| 10 |
+
function setBusy(value){busy=value;$("run").disabled=value;$("run").firstChild.textContent=value?"Classifying… ":"Classify image ";$("cancel").hidden=!value;$("progress").hidden=!value;for(const el of document.querySelectorAll("select,textarea,input,button.sample"))el.disabled=value;}
|
| 11 |
+
function resetResult(){result=null;$("empty-state").hidden=false;$("result-content").hidden=true;$("result-model").textContent="PREDICTION";}
|
| 12 |
+
function getWorker(){
|
| 13 |
+
if(worker)return worker;
|
| 14 |
+
worker=new Worker(new URL("inference-worker.js",import.meta.url),{type:"module"});
|
| 15 |
+
worker.onmessage=({data})=>{
|
| 16 |
+
if(data.type==="status"){setStatus(data.text);$("progress").removeAttribute("value");}
|
| 17 |
+
if(data.type==="progress"){
|
| 18 |
+
const percent=Math.max(0,Math.min(100,data.progress||0));$("progress").value=percent;
|
| 19 |
+
const mb=data.total?` (${(data.loaded/1048576).toFixed(1)} / ${(data.total/1048576).toFixed(1)} MB)`:"";
|
| 20 |
+
setStatus(`Loading ${data.file}: ${percent.toFixed(0)}%${mb}. Keep this tab open.`);
|
| 21 |
+
}
|
| 22 |
+
if(data.type==="result"){
|
| 23 |
+
result={...data.result,source:sourceName,top_k:runSettings.topk,review:{threshold:runSettings.threshold,flagged:data.result.predictions[0].score<runSettings.threshold}};
|
| 24 |
+
renderResult();setBusy(false);setStatus("Complete. Inspect the prediction, then try one controlled change.");
|
| 25 |
+
}
|
| 26 |
+
if(data.type==="error"){
|
| 27 |
+
setBusy(false);setStatus("Could not complete inference. Check access to Hugging Face and the model download, then retry. Details: "+data.message,true);
|
| 28 |
+
worker.terminate();worker=null;
|
| 29 |
+
}
|
| 30 |
+
};
|
| 31 |
+
worker.onerror=()=>{setBusy(false);setStatus("The browser AI runtime could not load. Check your network connection and try again.",true);worker.terminate();worker=null;};
|
| 32 |
+
return worker;
|
| 33 |
+
}
|
| 34 |
+
async function chooseImage(url,label){
|
| 35 |
+
const img=new Image();img.src=url;await img.decode();
|
| 36 |
+
if(img.width*img.height>25_000_000)throw new Error("Please use an image under 25 megapixels.");
|
| 37 |
+
if(activeUrl&&activeUrl!==url){URL.revokeObjectURL(activeUrl);activeUrl=null;}
|
| 38 |
+
$("preview").src=url;$("preview").alt=label+" selected for classification";$("image-name").textContent=label;sourceName=label;resetResult();setStatus("Image ready. Click Classify image.");
|
| 39 |
+
}
|
| 40 |
+
for(const button of document.querySelectorAll(".sample"))button.addEventListener("click",async()=>{
|
| 41 |
+
if(busy)return;
|
| 42 |
+
try{await chooseImage(button.dataset.file,button.dataset.label+" sample");
|
| 43 |
+
for(const el of document.querySelectorAll(".sample")){el.classList.toggle("selected",el===button);el.setAttribute("aria-pressed",String(el===button));}
|
| 44 |
+
}catch(err){setStatus(err.message,true);}
|
| 45 |
+
});
|
| 46 |
+
$("upload").addEventListener("change",async(event)=>{
|
| 47 |
+
const file=event.target.files[0];if(!file||busy)return;
|
| 48 |
+
if(file.size>12*1024*1024){setStatus("Please choose an image smaller than 12 MB.",true);return;}
|
| 49 |
+
const url=URL.createObjectURL(file);
|
| 50 |
+
try{await chooseImage(url,"Uploaded image");activeUrl=url;for(const el of document.querySelectorAll(".sample")){el.classList.remove("selected");el.setAttribute("aria-pressed","false");}}
|
| 51 |
+
catch(err){URL.revokeObjectURL(url);setStatus("Could not read that image. Choose a PNG, JPEG or WebP under 25 megapixels.",true);}
|
| 52 |
+
});
|
| 53 |
+
$("model").addEventListener("change",()=>{$("clip-controls").hidden=$("model").value!=="clip";$("model-description").textContent=descriptions[$("model").value];setStatus("Model selected. Run again to compare its prediction.");});
|
| 54 |
+
$("topk").addEventListener("input",()=>$("topk-value").value=$("topk").value);
|
| 55 |
+
$("threshold").addEventListener("input",()=>$("threshold-value").value=Number($("threshold").value).toFixed(2));
|
| 56 |
+
$("run").addEventListener("click",async()=>{
|
| 57 |
+
if(busy)return;
|
| 58 |
+
const model=$("model").value, labels=$("labels").value.split(/[,\n]/).map(s=>s.trim()).filter(Boolean);
|
| 59 |
+
if(model==="clip"){
|
| 60 |
+
if(labels.length<2||labels.length>50){setStatus("CLIP needs 2–50 candidate labels.",true);return;}
|
| 61 |
+
if(new Set(labels.map(x=>x.toLowerCase())).size!==labels.length){setStatus("Candidate labels must be unique.",true);return;}
|
| 62 |
+
if(labels.some(x=>x.length>100)){setStatus("Keep each candidate label within 100 characters.",true);return;}
|
| 63 |
+
}
|
| 64 |
+
try{
|
| 65 |
+
const img=$("preview");await img.decode();const scale=Math.min(1,1536/Math.max(img.naturalWidth,img.naturalHeight));
|
| 66 |
+
const canvas=document.createElement("canvas");canvas.width=Math.max(1,Math.round(img.naturalWidth*scale));canvas.height=Math.max(1,Math.round(img.naturalHeight*scale));
|
| 67 |
+
const ctx=canvas.getContext("2d");ctx.drawImage(img,0,0,canvas.width,canvas.height);const pixels=ctx.getImageData(0,0,canvas.width,canvas.height).data;
|
| 68 |
+
runSettings={topk:Number($("topk").value),threshold:Number($("threshold").value)};
|
| 69 |
+
setBusy(true);resetResult();setStatus("Preparing classification…");$("progress").removeAttribute("value");
|
| 70 |
+
getWorker().postMessage({model,labels,template:$("template").value,topk:runSettings.topk,width:canvas.width,height:canvas.height,pixels:pixels.buffer},[pixels.buffer]);
|
| 71 |
+
}catch(err){setBusy(false);setStatus(err.message,true);}
|
| 72 |
+
});
|
| 73 |
+
$("cancel").addEventListener("click",()=>{if(worker)worker.terminate();worker=null;setBusy(false);setStatus("Cancelled. You can choose another model and retry.");});
|
| 74 |
+
function renderResult(){
|
| 75 |
+
const top=result.predictions[0];$("empty-state").hidden=true;$("result-content").hidden=false;
|
| 76 |
+
$("result-model").textContent=titles[result.model];$("top-label").textContent=top.label;$("top-score").textContent=(top.score*100).toFixed(1)+"%";
|
| 77 |
+
$("result-context").textContent=`${result.candidate_count.toLocaleString()} labels in ${result.label_space} · ${result.source}`;
|
| 78 |
+
$("bars").replaceChildren();$("rows").replaceChildren();
|
| 79 |
+
for(const p of result.predictions){
|
| 80 |
+
const row=document.createElement("div");row.className="score-row";const caption=document.createElement("div");caption.className="bar-label";
|
| 81 |
+
const label=document.createElement("span"),score=document.createElement("span");label.textContent=p.label;score.textContent=(p.score*100).toFixed(2)+"%";caption.append(label,score);
|
| 82 |
+
const track=document.createElement("div");track.className="bar-track";const fill=document.createElement("div");fill.className="bar-fill";fill.style.width=(p.score*100)+"%";track.append(fill);row.append(caption,track);$("bars").append(row);
|
| 83 |
+
const tr=document.createElement("tr");for(const value of [p.rank,p.label,p.score.toFixed(6)]){const td=document.createElement("td");td.textContent=value;tr.append(td);}$("rows").append(tr);
|
| 84 |
+
}
|
| 85 |
+
$("review-note").textContent=result.review.flagged?"Review suggested: the top score is below your threshold.":"The top score meets your review threshold. Inspect the image and label before accepting it.";
|
| 86 |
+
$("score-note").textContent=result.score_note;
|
| 87 |
+
$("timing-note").textContent=`Inference: ${result.inference_ms.toLocaleString()} ms on this device, excluding model loading and interface time. Review threshold: ${result.review.threshold.toFixed(2)} (a display flag only).`;
|
| 88 |
+
$("json-output").textContent=JSON.stringify(result,null,2);
|
| 89 |
+
}
|
| 90 |
+
function download(content,name,type){const url=URL.createObjectURL(new Blob([content],{type}));const a=document.createElement("a");a.href=url;a.download=name;a.click();setTimeout(()=>URL.revokeObjectURL(url),1000);}
|
| 91 |
+
$("json-download").addEventListener("click",()=>{if(result)download(JSON.stringify(result,null,2),"classification_result.json","application/json");});
|
| 92 |
+
$("csv-download").addEventListener("click",()=>{
|
| 93 |
+
if(!result)return;const quote=s=>'"'+String(s).replaceAll('"','""')+'"';
|
| 94 |
+
const rows=result.predictions.map(p=>{let label=p.label;if(/^[\s]*[=+@-]/.test(label))label="'"+label;return[p.rank,quote(label),p.score].join(",");});
|
| 95 |
+
download("\uFEFFrank,label,score\r\n"+rows.join("\r\n"),"classification_predictions.csv","text/csv;charset=utf-8");
|
| 96 |
+
});
|
astronaut.png
ADDED
|
Git LFS Details
|
chelsea.png
ADDED
|
Git LFS Details
|
coffee.png
ADDED
|
Git LFS Details
|
index.html
CHANGED
|
@@ -1,19 +1,68 @@
|
|
| 1 |
<!doctype html>
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 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" 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>
|
inference-worker.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
let runtime;
|
| 2 |
+
let current;
|
| 3 |
+
let currentName;
|
| 4 |
+
const modelInfo = {
|
| 5 |
+
resnet18: {id: "Xenova/resnet-18", task: "image-classification"},
|
| 6 |
+
vit: {id: "Xenova/vit-base-patch16-224", task: "image-classification"},
|
| 7 |
+
clip: {id: "Xenova/clip-vit-base-patch32", task: "zero-shot-image-classification"},
|
| 8 |
+
};
|
| 9 |
+
let busy = false;
|
| 10 |
+
self.onmessage = async ({data}) => {
|
| 11 |
+
if (busy) return;
|
| 12 |
+
busy = true;
|
| 13 |
+
try {
|
| 14 |
+
const spec = modelInfo[data.model];
|
| 15 |
+
if (!spec) throw new Error("Choose a supported model.");
|
| 16 |
+
if (!runtime) {
|
| 17 |
+
self.postMessage({type: "status", text: "Loading the browser AI runtime…"});
|
| 18 |
+
runtime = await import("https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.8.1/dist/transformers.min.js");
|
| 19 |
+
runtime.env.allowLocalModels = false;
|
| 20 |
+
runtime.env.backends.onnx.wasm.numThreads = 1;
|
| 21 |
+
runtime.env.backends.onnx.wasm.proxy = false;
|
| 22 |
+
}
|
| 23 |
+
const cold = currentName !== data.model;
|
| 24 |
+
if (cold) {
|
| 25 |
+
if (current) { await current.dispose(); current = null; currentName = null; }
|
| 26 |
+
self.postMessage({type: "status", text: "Downloading or loading " + spec.id + "…"});
|
| 27 |
+
current = await runtime.pipeline(spec.task, spec.id, {
|
| 28 |
+
device: "wasm", dtype: "q8",
|
| 29 |
+
progress_callback: (p) => {
|
| 30 |
+
if (p.status === "progress") self.postMessage({type: "progress", file: p.file, progress: p.progress, loaded: p.loaded, total: p.total});
|
| 31 |
+
if (p.status === "done") self.postMessage({type: "status", text: "Model file ready. Initializing inference…"});
|
| 32 |
+
},
|
| 33 |
+
});
|
| 34 |
+
currentName = data.model;
|
| 35 |
+
}
|
| 36 |
+
self.postMessage({type: "status", text: "Classifying the image on your device…"});
|
| 37 |
+
const image = new runtime.RawImage(new Uint8ClampedArray(data.pixels), data.width, data.height, 4);
|
| 38 |
+
const start = performance.now();
|
| 39 |
+
let predictions = data.model === "clip"
|
| 40 |
+
? await current(image, data.labels, {hypothesis_template: data.template})
|
| 41 |
+
: await current(image, {top_k: data.topk});
|
| 42 |
+
const ms = performance.now() - start;
|
| 43 |
+
predictions = predictions.sort((a,b) => b.score - a.score).slice(0, data.topk);
|
| 44 |
+
self.postMessage({type: "result", result: {
|
| 45 |
+
model: data.model, model_id: spec.id, runtime: "Transformers.js 3.8.1 / ONNX Runtime Web",
|
| 46 |
+
device: "browser CPU (WebAssembly)", dtype: "q8", first_run_for_selected_model: cold,
|
| 47 |
+
input_size: [data.width, data.height], label_space: data.model === "clip" ? "candidate descriptions" : "ImageNet-1K",
|
| 48 |
+
candidate_count: data.model === "clip" ? data.labels.length : 1000,
|
| 49 |
+
candidates: data.model === "clip" ? data.labels : null,
|
| 50 |
+
prompt_template: data.model === "clip" ? data.template : null,
|
| 51 |
+
inference_ms: Math.round(ms), timing_scope: "preprocessing + model inference + postprocessing; excludes model loading and interface time",
|
| 52 |
+
predictions: predictions.map((p,i) => ({rank:i+1,label:p.label,score:p.score})),
|
| 53 |
+
score_note: data.model === "clip" ? "Scores are relative to the candidate descriptions. Changing candidates changes scores." : "Softmax scores over 1,000 fixed classes; not calibrated correctness probabilities.",
|
| 54 |
+
}});
|
| 55 |
+
} catch (error) {
|
| 56 |
+
self.postMessage({type: "error", message: String(error.message || error)});
|
| 57 |
+
} finally { busy = false; }
|
| 58 |
+
};
|
rocket.jpg
ADDED
|
Git LFS Details
|
sample-manifest.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dataset_name": "Four-image teaching set",
|
| 3 |
+
"not_a_benchmark": true,
|
| 4 |
+
"samples": [
|
| 5 |
+
{
|
| 6 |
+
"file": "chelsea.png",
|
| 7 |
+
"human_concept": "cat",
|
| 8 |
+
"purpose": "qualitative teaching example, not an ImageNet ground-truth annotation",
|
| 9 |
+
"source_url": "https://raw.githubusercontent.com/scikit-image/scikit-image/v0.25.2/skimage/data/chelsea.png",
|
| 10 |
+
"license_source": "https://scikit-image.org/docs/stable/api/skimage.data.html",
|
| 11 |
+
"license": "CC0",
|
| 12 |
+
"size": [
|
| 13 |
+
451,
|
| 14 |
+
300
|
| 15 |
+
],
|
| 16 |
+
"sha256": "596aa1e7cb875eb79f437e310381d26b338a81c2da23439704a73c4651e8c4bb"
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"file": "coffee.png",
|
| 20 |
+
"human_concept": "cup of coffee",
|
| 21 |
+
"purpose": "qualitative teaching example, not an ImageNet ground-truth annotation",
|
| 22 |
+
"source_url": "https://raw.githubusercontent.com/scikit-image/scikit-image/v0.25.2/skimage/data/coffee.png",
|
| 23 |
+
"license_source": "https://scikit-image.org/docs/stable/api/skimage.data.html",
|
| 24 |
+
"license": "CC0",
|
| 25 |
+
"size": [
|
| 26 |
+
600,
|
| 27 |
+
400
|
| 28 |
+
],
|
| 29 |
+
"sha256": "cc02f8ca188b167c775a7101b5d767d1e71792cf762c33d6fa15a4599b5a8de7"
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
"file": "astronaut.png",
|
| 33 |
+
"human_concept": "astronaut",
|
| 34 |
+
"purpose": "qualitative teaching example, not an ImageNet ground-truth annotation",
|
| 35 |
+
"source_url": "https://raw.githubusercontent.com/scikit-image/scikit-image/v0.25.2/skimage/data/astronaut.png",
|
| 36 |
+
"license_source": "https://scikit-image.org/docs/stable/api/skimage.data.html",
|
| 37 |
+
"license": "Public Domain",
|
| 38 |
+
"size": [
|
| 39 |
+
512,
|
| 40 |
+
512
|
| 41 |
+
],
|
| 42 |
+
"sha256": "88431cd9653ccd539741b555fb0a46b61558b301d4110412b5bc28b5e3ea6cb5"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"file": "rocket.jpg",
|
| 46 |
+
"human_concept": "rocket",
|
| 47 |
+
"purpose": "qualitative teaching example, not an ImageNet ground-truth annotation",
|
| 48 |
+
"source_url": "https://raw.githubusercontent.com/scikit-image/scikit-image/v0.25.2/skimage/data/rocket.jpg",
|
| 49 |
+
"license_source": "https://scikit-image.org/docs/stable/api/skimage.data.html",
|
| 50 |
+
"license": "Public Domain",
|
| 51 |
+
"size": [
|
| 52 |
+
640,
|
| 53 |
+
427
|
| 54 |
+
],
|
| 55 |
+
"sha256": "c2dd0de7c538df8d111e479619b129464d0269d0ae5fd18ca91d33a7fdfea95c"
|
| 56 |
+
}
|
| 57 |
+
]
|
| 58 |
+
}
|
style.css
CHANGED
|
@@ -1,28 +1 @@
|
|
| 1 |
-
body {
|
| 2 |
-
padding: 2rem;
|
| 3 |
-
font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
|
| 4 |
-
}
|
| 5 |
-
|
| 6 |
-
h1 {
|
| 7 |
-
font-size: 16px;
|
| 8 |
-
margin-top: 0;
|
| 9 |
-
}
|
| 10 |
-
|
| 11 |
-
p {
|
| 12 |
-
color: rgb(107, 114, 128);
|
| 13 |
-
font-size: 15px;
|
| 14 |
-
margin-bottom: 10px;
|
| 15 |
-
margin-top: 5px;
|
| 16 |
-
}
|
| 17 |
-
|
| 18 |
-
.card {
|
| 19 |
-
max-width: 620px;
|
| 20 |
-
margin: 0 auto;
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
-
}
|
| 25 |
-
|
| 26 |
-
.card p:last-child {
|
| 27 |
-
margin-bottom: 0;
|
| 28 |
-
}
|
|
|
|
| 1 |
+
:root{color-scheme:light;--bg:#f5f7fb;--ink:#0b1220;--muted:#475569;--line:#d9e2ef;--blue:#2563eb;--green:#16a34a}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.5}main{max-width:1180px;margin:0 auto;padding:30px 24px 16px}.hero{background:white;border-left:5px solid var(--blue);border-radius:4px 22px 22px 4px;padding:30px 34px}.eyebrow{font-size:11px;font-weight:700;letter-spacing:.12em;color:var(--blue)}.hero-line{display:flex;justify-content:space-between;align-items:center;gap:16px}h1{font-size:clamp(30px,4vw,44px);line-height:1.12;letter-spacing:-.035em;margin:14px 0 16px}.hero p{font-size:16px;color:var(--muted);margin:0}.local-badge{align-self:flex-start;margin-top:24px;white-space:nowrap;color:#166534;background:#f0fdf4;border:1px solid #dcfce7;border-radius:30px;padding:8px 13px;font-size:12px}.local-badge span{display:inline-block;width:6px;height:6px;background:#16a34a;border-radius:50%;margin-right:6px}.tags{display:flex;gap:8px;flex-wrap:wrap;margin-top:21px}.tags span{font-size:11px;font-weight:700;border-radius:4px;padding:5px 11px}.blue{color:#1d4ed8;background:#dbeafe}.purple{color:#7e22ce;background:#f3e8ff}.green{color:#15803d;background:#dcfce7}.neutral{color:#475569;background:#f1f5f9}.start-note{color:var(--muted);font-size:13px;margin:20px 2px}.workspace{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start}.panel{background:#fff;border:1px solid var(--line);border-radius:16px;padding:24px}h2{font-size:18px;margin:0 0 20px;display:flex;align-items:center;gap:10px}.step{display:inline-grid;place-items:center;background:#eff6ff;color:var(--blue);border-radius:50%;height:27px;width:27px;font-size:13px}.preview{height:285px;border-radius:10px;background:#f1f5f9;overflow:hidden;display:flex;justify-content:center;align-items:center}.preview img{width:100%;height:100%;object-fit:contain}.image-meta{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:#64748b;margin:10px 0 16px;gap:12px}.upload-button{font-size:12px!important;color:var(--blue);font-weight:700;cursor:pointer;padding:5px 0;margin:0!important}.upload-button input{position:absolute;width:1px;height:1px;opacity:0}.upload-button:focus-within{outline:2px solid var(--blue);outline-offset:3px}.samples{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.sample{padding:4px;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:pointer;color:#475569}.sample img{height:51px;width:100%;object-fit:cover;border-radius:4px;display:block}.sample span{font-size:11px;display:block;padding-top:4px}.sample.selected{border:2px solid var(--blue);padding:3px;background:#eff6ff;color:#1d4ed8}.hint{font-size:11px;color:#64748b;line-height:1.5}.image-panel>.hint{margin:13px 0 0}label{display:block;font-size:12px;font-weight:700;margin-bottom:7px}select,textarea{font:inherit;width:100%;border:1px solid #cbd5e1;border-radius:7px;padding:11px 12px;background:#f8fafc;color:#0b1220}select{cursor:pointer}textarea{resize:vertical;min-height:82px;font-size:13px}.model-description{font-size:12px;color:var(--muted);min-height:39px;margin:12px 0 20px}.range-label{display:flex;justify-content:space-between;align-items:center;gap:12px}.range-label label{margin:0}.range-label output{font-size:12px;font-weight:700;background:#eff6ff;color:var(--blue);padding:3px 9px;border-radius:5px}input[type=range]{width:100%;accent-color:var(--blue);margin:13px 0 17px;cursor:pointer}details{border-top:1px solid #e2e8f0;margin-top:16px;padding:12px 0 0}summary{cursor:pointer;font-size:12px;font-weight:700;color:var(--muted)}.review-setting{margin:8px 0 18px;padding-top:12px}.review-setting[open] summary{margin-bottom:14px}#clip-controls{margin:6px 0 14px}#clip-controls label{margin-top:10px}button{font-family:inherit}button:disabled{cursor:wait;opacity:.6}.primary{display:flex;justify-content:space-between;align-items:center;background:var(--blue);color:white;border:0;border-radius:8px;width:100%;padding:13px 17px;font-size:14px;font-weight:700;cursor:pointer;min-height:47px}.primary:hover{background:#1d4ed8}.primary span{font-size:20px}.status-wrap{font-size:11px;color:#64748b;margin-top:12px;min-height:37px;overflow-wrap:anywhere}progress{width:100%;height:7px;accent-color:var(--blue);margin-top:10px}.text-button{color:#64748b;background:none;border:0;padding:8px 0;cursor:pointer;font-size:11px}.results{margin-top:20px}.section-heading{display:flex;justify-content:space-between;gap:12px;align-items:start}.result-model{font-size:10px;letter-spacing:.06em;font-weight:700;color:var(--blue);padding:5px 8px;background:#eff6ff;border-radius:4px}#empty-state{background:#f8fafc;border-radius:10px;padding:26px;border-left:4px solid #cbd5e1}#empty-state strong{font-size:20px}#empty-state p{font-size:13px;color:#64748b;margin:6px 0 0}.result-headline{background:#f0fdf4;border-left:4px solid var(--green);border-radius:4px 10px 10px 4px;padding:19px 22px;display:flex;justify-content:space-between;gap:20px;align-items:center}.result-headline .eyebrow{color:#15803d;font-size:10px}.result-headline h3{font-size:26px;letter-spacing:-.02em;line-height:1.2;margin:6px 0;overflow-wrap:anywhere}.result-headline p{font-size:12px;color:#475569;margin:0}.score-number{text-align:right;flex-shrink:0}.score-number strong{display:block;font-size:30px;font-weight:700;color:#166534}.score-number span{font-size:10px;color:#64748b}.result-grid{display:grid;grid-template-columns:1fr 1fr;gap:32px;margin-top:25px}.score-row{margin-bottom:14px}.bar-label{display:flex;justify-content:space-between;gap:14px;font-size:12px;margin-bottom:5px}.bar-label span:first-child{overflow-wrap:anywhere}.bar-track{height:6px;border-radius:4px;background:#eaf0fa;overflow:hidden}.bar-fill{height:100%;background:var(--blue);border-radius:4px;min-width:1px}.table-wrap{overflow:auto;max-height:350px}table{width:100%;border-collapse:collapse;font-size:12px;text-align:left}th{background:#f8fafc;color:#64748b;font-size:10px;text-transform:uppercase;letter-spacing:.05em}td,th{padding:9px 10px;border-bottom:1px solid #e2e8f0}td:nth-child(2){overflow-wrap:anywhere}td:last-child,th:last-child{text-align:right}.result-note{padding:15px 0;font-size:12px;color:#475569}.result-note p{margin:7px 0 0}.downloads{display:flex;gap:10px;flex-wrap:wrap}.secondary{border:1px solid #cbd5e1;background:white;border-radius:7px;padding:9px 15px;font-size:12px;font-weight:700;color:#334155;cursor:pointer}.secondary:hover{background:#f8fafc}pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:320px;overflow:auto;background:#0b1220;color:#e2e8f0;border-radius:8px;padding:18px;font:11px/1.6 Consolas,monospace}.experiment{padding:28px 3px 10px}.experiment h2{font-size:20px;margin-bottom:15px}.experiment-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:24px}.experiment article{border-top:2px solid #d9e2ef;padding-top:13px}.mini-number{font-size:11px;color:var(--blue);font-weight:700}.experiment h3{font-size:14px;margin:7px 0}.experiment p{font-size:12px;color:#475569;margin:0}footer{margin-top:24px;padding:20px 2px 10px;border-top:1px solid var(--line);color:#64748b;font-size:11px}footer a{color:#2563eb}footer details{border:0;padding:0}.error{color:#b91c1c!important}button:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,a:focus-visible{outline:3px solid #93c5fd;outline-offset:3px}[hidden]{display:none!important}@media(max-width:760px){main{padding:14px 12px}.hero{padding:24px 20px}.hero-line{display:block}.local-badge{display:inline-block;margin-top:0;margin-bottom:14px}.desktop-break{display:none}.workspace,.result-grid{grid-template-columns:1fr}.panel{padding:19px}.preview{height:260px}.experiment-grid{grid-template-columns:1fr;gap:16px}.hero p{font-size:14px}.result-headline{padding:16px;gap:10px}.result-headline h3{font-size:22px}.score-number strong{font-size:25px}.section-heading{flex-wrap:wrap}.result-model{margin-bottom:12px}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|