wr92 commited on
Commit
6b1080e
·
verified ·
1 Parent(s): b11602c

Upload 14 files

Browse files
.gitattributes CHANGED
@@ -40,3 +40,10 @@ ai-powered-object-detection/examples/000000181666.jpg filter=lfs diff=lfs merge=
40
  ai-powered-object-detection/examples/000000252219.jpg filter=lfs diff=lfs merge=lfs -text
41
  ai-powered-object-detection/examples/000000376310.jpg filter=lfs diff=lfs merge=lfs -text
42
  ai-powered-object-detection/examples/000000397133.jpg filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
40
  ai-powered-object-detection/examples/000000252219.jpg filter=lfs diff=lfs merge=lfs -text
41
  ai-powered-object-detection/examples/000000376310.jpg filter=lfs diff=lfs merge=lfs -text
42
  ai-powered-object-detection/examples/000000397133.jpg filter=lfs diff=lfs merge=lfs -text
43
+ examples/000000039769.jpg filter=lfs diff=lfs merge=lfs -text
44
+ examples/000000087038.jpg filter=lfs diff=lfs merge=lfs -text
45
+ examples/000000174482.jpg filter=lfs diff=lfs merge=lfs -text
46
+ examples/000000181666.jpg filter=lfs diff=lfs merge=lfs -text
47
+ examples/000000252219.jpg filter=lfs diff=lfs merge=lfs -text
48
+ examples/000000376310.jpg filter=lfs diff=lfs merge=lfs -text
49
+ examples/000000397133.jpg filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,10 +1,96 @@
1
  ---
2
- title: Test
3
- emoji: 🚀
4
- colorFrom: green
5
- colorTo: blue
6
  sdk: static
 
7
  pinned: false
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: AI-Powered Object Detection
3
+ emoji: 🔎
4
+ colorFrom: blue
5
+ colorTo: indigo
6
  sdk: static
7
+ app_file: index.html
8
  pinned: false
9
  ---
10
 
11
+ # AI-Powered Object Detection
12
+
13
+ A small teaching mini-lab for a Creative Technology / introductory AI course.
14
+
15
+ The point of the project is not to make students rebuild an object detector from scratch. It shows how a pretrained AI model can turn a traditional computer-vision task into a capability that can be directly used inside an application.
16
+
17
+ ## The learning story
18
+
19
+ 1. Choose a real image from the COCO 2017 validation sample bank, or upload your own image.
20
+ 2. Choose a browser-compatible pretrained detector: RT-DETR R18, DETR ResNet-50, or YOLOS Tiny.
21
+ 3. Inspect bounding boxes, class labels, confidence scores, and object counts.
22
+ 4. Keep the image fixed and switch models to compare predictions.
23
+ 5. Change the confidence threshold and observe what changes.
24
+
25
+ ## Model and data
26
+
27
+ - Recommended browser default: `onnx-community/rtdetr_r18vd` (RT-DETR R18)
28
+ - Additional browser comparison models: `Xenova/detr-resnet-50`, `Xenova/yolos-tiny`
29
+ - Task: object detection
30
+ - Training dataset: COCO
31
+ - Example bank: selected images from COCO 2017 validation
32
+
33
+ All three browser models are already trained. This demo performs inference only; no model training or GPU server is required.
34
+
35
+ The bundled COCO examples are used to give the classroom demo reliable, varied starting inputs. COCO does not own the underlying images; each image retains its original license.
36
+
37
+ ## One project, one demo
38
+
39
+ The source code and the live demo are the same project:
40
+
41
+ - `index.html` — page structure and teaching flow
42
+ - `style.css` — presentation
43
+ - `app.js` — interaction, image handling, result rendering
44
+ - `detector.js` — the AI model call
45
+ - `examples/` — tested COCO validation images
46
+
47
+ ## Baseline assignment (about 70%)
48
+
49
+ A baseline submission should successfully use a pretrained AI model to complete a real object-detection task and present the result clearly. At minimum, students should be able to show the input image, detected objects, bounding boxes, labels, and confidence scores, and explain what the model is doing at a high level.
50
+
51
+ Students are not required to invent or train an object detector from scratch for the baseline.
52
+
53
+ ## Going beyond the baseline
54
+
55
+ Higher-scoring work should deepen **object detection** itself. Students should independently investigate a meaningful extension, for example:
56
+
57
+ - compare or replace pretrained object detectors;
58
+ - tune confidence, IoU/NMS, or image size and explain the trade-offs;
59
+ - test another dataset or domain and analyze failure cases;
60
+ - improve robustness, speed, evaluation, or the object-detection application.
61
+
62
+ The emphasis is on meaningful exploration, not simply adding more lines of code.
63
+
64
+ ## Runtime
65
+
66
+ The Space is static and runs the selected model in the browser with Transformers.js. The first run for each model downloads its model files; later runs can reuse the browser cache. RT-DETR remains the recommended classroom default.
67
+
68
+ ## Classroom check before use
69
+
70
+ Before presenting, verify:
71
+
72
+ - at least one COCO example detects correctly;
73
+ - Shuffle changes the visible example set;
74
+ - an uploaded image can be detected;
75
+ - the confidence slider changes filtering behavior;
76
+ - the first uncached run shows progress instead of appearing frozen;
77
+ - the page still works at a narrow/mobile width.
78
+
79
+ This repository is the baseline demo for the course. Once the v1.0 checks pass, the next deliverable is the presentation deck built around the same teaching story.
80
+
81
+ ## v1.0 verification
82
+
83
+ The v1.0 release was checked on 2026-09-08 with automated browser tests:
84
+
85
+ - all 8 bundled COCO examples produced at least one detection at threshold 0.50;
86
+ - Shuffle, COCO sample selection, and user upload all worked;
87
+ - raising the threshold from 0.50 to 0.95 reduced low-confidence detections as expected;
88
+ - the uncached first run displayed a loading/progress state;
89
+ - the network/model failure path displayed a readable error state;
90
+ - Chromium and WebKit both completed a real detection;
91
+ - a 390 px mobile viewport had no horizontal page overflow.
92
+
93
+
94
+ ## Interaction and Python
95
+
96
+ The hosted Static Space is the interactive visualization layer. The separate course package contains the Python reference scripts required by the teacher (Faster R-CNN, YOLO26n, RT-DETR, plus optional DETR). The hosted Space itself stays lightweight and browser-only.
app.js ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { MODEL_OPTIONS, detectObjects, getModelOption } from './detector.js';
2
+
3
+ const imageInput = document.querySelector('#image-input');
4
+ const modelSelect = document.querySelector('#model-select');
5
+ const modelNote = document.querySelector('#model-note');
6
+ const threshold = document.querySelector('#threshold');
7
+ const thresholdValue = document.querySelector('#threshold-value');
8
+ const runButton = document.querySelector('#run-button');
9
+ const statusEl = document.querySelector('#status');
10
+ const progressWrap = document.querySelector('#progress-wrap');
11
+ const progressBar = document.querySelector('#progress-bar');
12
+ const canvasWrap = document.querySelector('#canvas-wrap');
13
+ const canvas = document.querySelector('#result-canvas');
14
+ const ctx = canvas.getContext('2d');
15
+ const summary = document.querySelector('#summary');
16
+ const tbody = document.querySelector('#detections-body');
17
+ const runtimeBadge = document.querySelector('#runtime-badge');
18
+ const sampleGrid = document.querySelector('#sample-grid');
19
+ const shuffleButton = document.querySelector('#shuffle-examples');
20
+
21
+ const state = {
22
+ image: null,
23
+ dataUrl: null,
24
+ };
25
+
26
+ const EXAMPLES = [
27
+ { src: './examples/000000039769.jpg', label: 'Cats & remotes' },
28
+ { src: './examples/000000397133.jpg', label: 'Busy kitchen' },
29
+ { src: './examples/000000252219.jpg', label: 'Street scene' },
30
+ { src: './examples/000000037777.jpg', label: 'Kitchen objects' },
31
+ { src: './examples/000000087038.jpg', label: 'Skate park' },
32
+ { src: './examples/000000174482.jpg', label: 'Bike & traffic' },
33
+ { src: './examples/000000181666.jpg', label: 'Herd & person' },
34
+ { src: './examples/000000376310.jpg', label: 'Bathroom objects' },
35
+ ];
36
+
37
+ function chooseRandom(items, count) {
38
+ return [...items]
39
+ .map((item) => ({ item, sort: Math.random() }))
40
+ .sort((a, b) => a.sort - b.sort)
41
+ .slice(0, count)
42
+ .map(({ item }) => item);
43
+ }
44
+
45
+ function resetResults() {
46
+ summary.textContent = 'No detections yet.';
47
+ tbody.innerHTML = '<tr class="empty-row"><td colspan="3">Run the detector to see details.</td></tr>';
48
+ }
49
+
50
+ function setSelectedImage(dataUrl, readyMessage) {
51
+ const image = new Image();
52
+ image.onload = () => {
53
+ state.dataUrl = dataUrl;
54
+ state.image = image;
55
+ drawBaseImage();
56
+ runButton.disabled = false;
57
+ statusEl.textContent = readyMessage;
58
+ setBadge('Image ready');
59
+ resetResults();
60
+ };
61
+ image.onerror = () => {
62
+ statusEl.textContent = 'Could not read that image.';
63
+ setBadge('Image error', 'error');
64
+ };
65
+ image.src = dataUrl;
66
+ }
67
+
68
+ function blobToDataUrl(blob) {
69
+ return new Promise((resolve, reject) => {
70
+ const reader = new FileReader();
71
+ reader.onload = () => resolve(reader.result);
72
+ reader.onerror = reject;
73
+ reader.readAsDataURL(blob);
74
+ });
75
+ }
76
+
77
+ async function loadExample(example, button) {
78
+ try {
79
+ statusEl.textContent = `Loading COCO example: ${example.label}…`;
80
+ setBadge('Loading sample', 'running');
81
+ const response = await fetch(example.src);
82
+ if (!response.ok) throw new Error(`Could not load ${example.src}`);
83
+ const dataUrl = await blobToDataUrl(await response.blob());
84
+ imageInput.value = '';
85
+ document.querySelectorAll('.sample-card').forEach((card) => card.classList.remove('selected'));
86
+ button.classList.add('selected');
87
+ setSelectedImage(dataUrl, `COCO example ready: ${example.label}. Click Run AI Detection.`);
88
+ } catch (error) {
89
+ console.error(error);
90
+ statusEl.textContent = 'Could not load that COCO example. Try another one.';
91
+ setBadge('Sample error', 'error');
92
+ }
93
+ }
94
+
95
+ function renderModelChoices() {
96
+ for (const option of MODEL_OPTIONS) {
97
+ const item = document.createElement('option');
98
+ item.value = option.key;
99
+ item.textContent = option.label;
100
+ modelSelect.appendChild(item);
101
+ }
102
+ modelSelect.value = MODEL_OPTIONS[0].key;
103
+ modelNote.textContent = MODEL_OPTIONS[0].note;
104
+ }
105
+
106
+ function renderExampleChoices() {
107
+ sampleGrid.innerHTML = '';
108
+ for (const example of chooseRandom(EXAMPLES, 4)) {
109
+ const button = document.createElement('button');
110
+ button.type = 'button';
111
+ button.className = 'sample-card';
112
+ button.title = `Use sample: ${example.label}`;
113
+
114
+ const image = document.createElement('img');
115
+ image.src = example.src;
116
+ image.alt = example.label;
117
+ image.loading = 'lazy';
118
+
119
+ const label = document.createElement('span');
120
+ label.textContent = example.label;
121
+
122
+ const source = document.createElement('small');
123
+ const cocoId = example.src.match(/(\d{12})\.jpg$/)?.[1] || '';
124
+ source.textContent = cocoId ? `COCO val2017 · ${cocoId}` : 'COCO val2017';
125
+
126
+ button.append(image, label, source);
127
+ button.addEventListener('click', () => loadExample(example, button));
128
+ sampleGrid.appendChild(button);
129
+ }
130
+ }
131
+
132
+ function setBadge(text, mode = '') {
133
+ runtimeBadge.textContent = text;
134
+ runtimeBadge.className = `badge ${mode}`.trim();
135
+ }
136
+ function setProgress(data) {
137
+ let pct = null;
138
+
139
+ if (typeof data?.progress === 'number') {
140
+ pct = data.progress;
141
+ } else if (data?.total && typeof data?.loaded === 'number') {
142
+ pct = (data.loaded / data.total) * 100;
143
+ }
144
+
145
+ if (pct !== null && Number.isFinite(pct)) {
146
+ progressWrap.hidden = false;
147
+ progressBar.style.width = `${Math.max(0, Math.min(100, pct))}%`;
148
+ }
149
+
150
+ if (data?.status === 'progress' && data?.file) {
151
+ statusEl.textContent = `Downloading model: ${data.file}`;
152
+ }
153
+ }
154
+
155
+ function drawBaseImage() {
156
+ if (!state.image) return;
157
+
158
+ canvas.width = state.image.naturalWidth;
159
+ canvas.height = state.image.naturalHeight;
160
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
161
+ ctx.drawImage(state.image, 0, 0, canvas.width, canvas.height);
162
+ canvasWrap.classList.remove('empty');
163
+ }
164
+ function drawDetections(detections) {
165
+ drawBaseImage();
166
+ if (!state.image) return;
167
+
168
+ const scale = Math.max(1, Math.round(canvas.width / 900));
169
+ const fontSize = Math.max(14, Math.round(canvas.width / 55));
170
+ ctx.font = `700 ${fontSize}px system-ui, sans-serif`;
171
+ ctx.textBaseline = 'top';
172
+
173
+ for (const item of detections) {
174
+ const box = item.box;
175
+ const x1 = Math.max(0, Number(box.xmin));
176
+ const y1 = Math.max(0, Number(box.ymin));
177
+ const x2 = Math.min(canvas.width, Number(box.xmax));
178
+ const y2 = Math.min(canvas.height, Number(box.ymax));
179
+ const label = `${item.label} ${(Number(item.score) * 100).toFixed(0)}%`;
180
+
181
+ ctx.lineWidth = 3 * scale;
182
+ ctx.strokeStyle = '#ffffff';
183
+ ctx.strokeRect(x1, y1, Math.max(0, x2 - x1), Math.max(0, y2 - y1));
184
+
185
+ const pad = 5 * scale;
186
+ const metrics = ctx.measureText(label);
187
+ const textHeight = fontSize + 2 * pad;
188
+ const labelY = Math.max(0, y1 - textHeight);
189
+
190
+ ctx.fillStyle = '#111827';
191
+ ctx.fillRect(x1, labelY, metrics.width + 2 * pad, textHeight);
192
+ ctx.fillStyle = '#ffffff';
193
+ ctx.fillText(label, x1 + pad, labelY + pad);
194
+ }
195
+ }
196
+ function renderDetections(detections) {
197
+ tbody.innerHTML = '';
198
+ const option = getModelOption(modelSelect.value);
199
+
200
+ if (!detections.length) {
201
+ const row = document.createElement('tr');
202
+ row.className = 'empty-row';
203
+ const cell = document.createElement('td');
204
+ cell.colSpan = 3;
205
+ cell.textContent = 'No objects passed the current confidence threshold.';
206
+ row.appendChild(cell);
207
+ tbody.appendChild(row);
208
+ summary.textContent = `${option.label}: no detections. Try a lower threshold or another image.`;
209
+ return;
210
+ }
211
+
212
+ const counts = new Map();
213
+ for (const item of detections) {
214
+ counts.set(item.label, (counts.get(item.label) || 0) + 1);
215
+
216
+ const row = document.createElement('tr');
217
+ const box = item.box;
218
+ const values = [
219
+ item.label,
220
+ `${(Number(item.score) * 100).toFixed(1)}%`,
221
+ `(${Math.round(box.xmin)}, ${Math.round(box.ymin)}) → (${Math.round(box.xmax)}, ${Math.round(box.ymax)})`,
222
+ ];
223
+
224
+ for (const value of values) {
225
+ const cell = document.createElement('td');
226
+ cell.textContent = value;
227
+ row.appendChild(cell);
228
+ }
229
+ tbody.appendChild(row);
230
+ }
231
+ const pieces = [...counts.entries()]
232
+ .sort(([a], [b]) => a.localeCompare(b))
233
+ .map(([label, count]) => `${label}: ${count}`);
234
+
235
+ summary.textContent = `${option.label} found — ${pieces.join(', ')}`;
236
+ }
237
+
238
+ threshold.addEventListener('input', () => {
239
+ thresholdValue.value = Number(threshold.value).toFixed(2);
240
+ });
241
+
242
+ modelSelect.addEventListener('change', () => {
243
+ const option = getModelOption(modelSelect.value);
244
+ modelNote.textContent = option.note;
245
+ setBadge(`Model: ${option.label}`);
246
+ if (state.image) statusEl.textContent = `Model changed to ${option.label}. Run again to compare results.`;
247
+ });
248
+ imageInput.addEventListener('change', () => {
249
+ const file = imageInput.files?.[0];
250
+ if (!file) return;
251
+
252
+ if (!file.type.startsWith('image/')) {
253
+ statusEl.textContent = 'Please choose an image file.';
254
+ setBadge('Invalid file', 'error');
255
+ runButton.disabled = true;
256
+ return;
257
+ }
258
+
259
+ document.querySelectorAll('.sample-card').forEach((card) => card.classList.remove('selected'));
260
+ const reader = new FileReader();
261
+ reader.onload = () => setSelectedImage(reader.result, 'Your image is ready. Click Run AI Detection.');
262
+ reader.onerror = () => {
263
+ statusEl.textContent = 'Could not read that image.';
264
+ setBadge('Image error', 'error');
265
+ };
266
+ reader.readAsDataURL(file);
267
+ });
268
+
269
+ shuffleButton.addEventListener('click', () => {
270
+ renderExampleChoices();
271
+ statusEl.textContent = state.image
272
+ ? 'New COCO examples shown. Your current image is still selected.'
273
+ : 'Choose a COCO example, or upload your own image.';
274
+ });
275
+
276
+ renderModelChoices();
277
+ renderExampleChoices();
278
+ runButton.addEventListener('click', async () => {
279
+ if (!state.dataUrl || !state.image) return;
280
+
281
+ const option = getModelOption(modelSelect.value);
282
+ runButton.disabled = true;
283
+ setBadge(`Loading ${option.label}`, 'running');
284
+ progressWrap.hidden = false;
285
+ progressBar.style.width = '4%';
286
+ const started = performance.now();
287
+
288
+ try {
289
+ statusEl.textContent = `Preparing ${option.label}. The first run may download model files.`;
290
+ const detections = await detectObjects(state.dataUrl, {
291
+ modelKey: option.key,
292
+ threshold: Number(threshold.value),
293
+ progressCallback: setProgress,
294
+ });
295
+
296
+ drawDetections(detections);
297
+ renderDetections(detections);
298
+
299
+ const seconds = ((performance.now() - started) / 1000).toFixed(1);
300
+ statusEl.textContent = `Done in ${seconds}s with ${option.label}. Change model or threshold to compare.`;
301
+ setBadge(`${detections.length} detections`, 'ready');
302
+ } catch (error) {
303
+ console.error(error);
304
+ statusEl.textContent = `${option.label} failed to run. Check your connection or switch back to RT-DETR.`;
305
+ setBadge('Error', 'error');
306
+ } finally {
307
+ progressWrap.hidden = true;
308
+ runButton.disabled = false;
309
+ }
310
+ });
detector.js ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@4.2.0';
2
+
3
+ export const MODEL_OPTIONS = [
4
+ {
5
+ key: 'rtdetr',
6
+ label: 'RT-DETR R18',
7
+ modelId: 'onnx-community/rtdetr_r18vd',
8
+ note: 'Recommended classroom default: modern real-time transformer-style detector.',
9
+ dtype: 'q8',
10
+ },
11
+ {
12
+ key: 'detr',
13
+ label: 'DETR ResNet-50',
14
+ modelId: 'Xenova/detr-resnet-50',
15
+ note: 'Representative DETR-family detector. Larger download; useful for comparison.',
16
+ dtype: 'q8',
17
+ },
18
+ {
19
+ key: 'yolos',
20
+ label: 'YOLOS Tiny',
21
+ modelId: 'Xenova/yolos-tiny',
22
+ note: 'Small browser-friendly detector. Useful for showing that model choice changes results.',
23
+ dtype: 'q8',
24
+ },
25
+ ];
26
+
27
+ const detectorCache = new Map();
28
+ export function getModelOption(key) {
29
+ return MODEL_OPTIONS.find((model) => model.key === key) || MODEL_OPTIONS[0];
30
+ }
31
+
32
+ export async function loadDetector(modelKey, progressCallback) {
33
+ const option = getModelOption(modelKey);
34
+ if (detectorCache.has(option.key)) return detectorCache.get(option.key);
35
+
36
+ const detector = await pipeline('object-detection', option.modelId, {
37
+ dtype: option.dtype,
38
+ progress_callback: progressCallback,
39
+ });
40
+
41
+ detectorCache.set(option.key, detector);
42
+ return detector;
43
+ }
44
+
45
+ export async function detectObjects(imageDataUrl, options = {}) {
46
+ const modelKey = options.modelKey || MODEL_OPTIONS[0].key;
47
+ const threshold = Number.isFinite(options.threshold) ? options.threshold : 0.5;
48
+ const detector = await loadDetector(modelKey, options.progressCallback);
49
+ return detector(imageDataUrl, { threshold });
50
+ }
examples/000000037777.jpg ADDED
examples/000000039769.jpg ADDED

Git LFS Details

  • SHA256: dea9e7ef97386345f7cff32f9055da4982da5471c48d575146c796ab4563b04e
  • Pointer size: 131 Bytes
  • Size of remote file: 173 kB
examples/000000087038.jpg ADDED

Git LFS Details

  • SHA256: c6cfc7e454a432c31ac3c3a997d5f33ccebe120fc6b9465965609ce12995ede9
  • Pointer size: 131 Bytes
  • Size of remote file: 183 kB
examples/000000174482.jpg ADDED

Git LFS Details

  • SHA256: 41fab00aad97dad3eb7d035420b8cc61ed0ca8f4f0b66a4fbc1bd0bba6f8a5b3
  • Pointer size: 131 Bytes
  • Size of remote file: 208 kB
examples/000000181666.jpg ADDED

Git LFS Details

  • SHA256: dc4e568c1617d23f6b341f66e644c733e4849f943cb4ee9a1877f9c55e7b19e1
  • Pointer size: 131 Bytes
  • Size of remote file: 126 kB
examples/000000252219.jpg ADDED

Git LFS Details

  • SHA256: 1cf48bddb1bcab80d9f4d18514ae438c3e4f57d18e80c4fbea9d5d22396f514a
  • Pointer size: 131 Bytes
  • Size of remote file: 143 kB
examples/000000376310.jpg ADDED

Git LFS Details

  • SHA256: 5577025db66049f0b52bc7706eb29408d9823803808483e1631a6fa15372e913
  • Pointer size: 131 Bytes
  • Size of remote file: 238 kB
examples/000000397133.jpg ADDED

Git LFS Details

  • SHA256: 09e1d25c75f7879bdaa69c327fece5cabacd53939c8c2ef9e87f1c97a2e478c4
  • Pointer size: 131 Bytes
  • Size of remote file: 201 kB
examples/coco_val2017_subset.csv ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ image_id,classroom_label,source_url
2
+ 000000039769,Cats & remotes,http://images.cocodataset.org/val2017/000000039769.jpg
3
+ 000000397133,Busy kitchen,http://images.cocodataset.org/val2017/000000397133.jpg
4
+ 000000252219,Street scene,http://images.cocodataset.org/val2017/000000252219.jpg
5
+ 000000037777,Kitchen objects,http://images.cocodataset.org/val2017/000000037777.jpg
6
+ 000000087038,Skate park,http://images.cocodataset.org/val2017/000000087038.jpg
7
+ 000000174482,Bike & traffic,http://images.cocodataset.org/val2017/000000174482.jpg
8
+ 000000181666,Herd & person,http://images.cocodataset.org/val2017/000000181666.jpg
9
+ 000000376310,Bathroom objects,http://images.cocodataset.org/val2017/000000376310.jpg
index.html CHANGED
@@ -1,19 +1,130 @@
1
  <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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="AI-Powered Object Detection mini-lab using COCO examples and a pretrained model" />
7
+ <title>AI-Powered Object Detection</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 Object Detection</h1>
16
+ <p class="lede">Pick a COCO example or upload your own image. Then choose a pretrained detector and let AI answer: <strong>what objects are here, and where are they?</strong></p>
17
+ <div class="lesson-strip" aria-label="Mini-lab overview">
18
+ <span><b>Task</b> Object detection</span>
19
+ <span><b>Data</b> COCO validation examples</span>
20
+ <span><b>Models</b> RT-DETR · DETR · YOLOS Tiny</span>
21
+ </div>
22
+ </header>
23
+
24
+ <section class="workspace" aria-label="Object detection 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 COCO example, or try a photo of your own.</p>
31
+ </div>
32
+ </div>
33
+
34
+ <div class="sample-head coco-head">
35
+ <div>
36
+ <p class="input-kicker">Start here · COCO examples</p>
37
+ <p class="helper">Four images are drawn at random from our pre-tested COCO sample bank.</p>
38
+ </div>
39
+ <button id="shuffle-examples" class="shuffle-button" type="button">Shuffle</button>
40
+ </div>
41
+ <div id="sample-grid" class="sample-grid" aria-label="COCO example images"></div>
42
+ <div class="or-row"><span>or try your own</span></div>
43
+ <label class="control-label" for="image-input">Upload an image</label>
44
+ <p class="helper">Useful for seeing where the model generalizes well—and where it does not.</p>
45
+ <input id="image-input" class="file-input" type="file" accept="image/*" />
46
+
47
+ <div class="divider"></div>
48
+
49
+ <div class="step">
50
+ <span class="step-number">2</span>
51
+ <div class="grow">
52
+ <label class="control-label" for="model-select">Choose detector</label>
53
+ <select id="model-select" class="model-select"></select>
54
+ <p id="model-note" class="helper">RT-DETR is the recommended classroom default.</p>
55
+ </div>
56
+ </div>
57
+
58
+ <div class="divider"></div>
59
+
60
+ <div class="step">
61
+ <span class="step-number">3</span>
62
+ <div class="grow">
63
+ <div class="slider-row">
64
+ <label class="control-label" for="threshold">Confidence threshold</label>
65
+ <output id="threshold-value" for="threshold">0.50</output>
66
+ </div>
67
+ <input id="threshold" type="range" min="0.10" max="0.95" value="0.50" step="0.05" />
68
+ <p class="helper">Higher values only keep predictions the model is more confident about.</p>
69
+ </div>
70
+ </div>
71
+
72
+ <button id="run-button" class="run-button" type="button" disabled>Run AI Detection</button>
73
+ <p id="status" class="status" aria-live="polite">Choose a COCO example or upload your own image.</p>
74
+ <div id="progress-wrap" class="progress-wrap" hidden>
75
+ <div id="progress-bar" class="progress-bar"></div>
76
+ </div>
77
+ </div>
78
+
79
+ <div class="result card">
80
+ <div class="result-head">
81
+ <div>
82
+ <p class="section-kicker">AI prediction</p>
83
+ <h2>What did the detector find?</h2>
84
+ </div>
85
+ <span id="runtime-badge" class="badge">Waiting</span>
86
+ </div>
87
+ <div id="canvas-wrap" class="canvas-wrap empty">
88
+ <canvas id="result-canvas" aria-label="Detection result"></canvas>
89
+ <p id="canvas-placeholder">Choose an image first. The original image appears here before detection.</p>
90
+ </div>
91
+
92
+ <div id="summary" class="summary">No detections yet.</div>
93
+
94
+ <div class="table-wrap">
95
+ <table>
96
+ <thead>
97
+ <tr>
98
+ <th>Object</th>
99
+ <th>Confidence</th>
100
+ <th>Bounding box</th>
101
+ </tr>
102
+ </thead>
103
+ <tbody id="detections-body">
104
+ <tr class="empty-row"><td colspan="3">Run the detector to see details.</td></tr>
105
+ </tbody>
106
+ </table>
107
+ </div>
108
+ </div>
109
+ </section>
110
+
111
+ <section class="explain card">
112
+ <p class="section-kicker">What you are doing</p>
113
+ <h2 class="explain-title">Use a learned AI capability instead of rebuilding the traditional task from scratch.</h2>
114
+ <p class="explain-copy">COCO contains everyday-object images with annotations. The selected pretrained detector has already learned the object-detection task from labeled data. In this mini-lab, you can switch models and compare how their predictions differ on the same image.</p>
115
+ <div class="flow" aria-label="Object detection flow">
116
+ <span>COCO example or your image</span><span class="arrow">→</span>
117
+ <span>Selected pretrained detector</span><span class="arrow">→</span>
118
+ <span>Boxes + labels + confidence</span>
119
+ </div>
120
+ <p class="extension-note"><strong>Compare models:</strong> keep the image fixed, switch detector, and observe how predictions, confidence, and speed change.</p>
121
+ </section>
122
+
123
+ <footer>
124
+ Hosted as a Hugging Face Static Space · Powered by Transformers.js
125
+ </footer>
126
+ </main>
127
+
128
+ <script type="module" src="./app.js"></script>
129
+ </body>
130
  </html>
style.css CHANGED
@@ -1,28 +1,477 @@
 
 
 
 
 
 
 
 
 
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 {
2
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
3
+ color: #111827;
4
+ background: #f6f7fb;
5
+ font-synthesis: none;
6
+ }
7
+
8
+ * { box-sizing: border-box; }
9
+
10
  body {
11
+ margin: 0;
12
+ min-height: 100vh;
13
+ background: radial-gradient(circle at top, #ffffff 0%, #f6f7fb 45%, #eef1f7 100%);
14
  }
15
 
16
+ button, input, select { font: inherit; }
17
+
18
+ .page-shell {
19
+ width: min(1180px, calc(100% - 32px));
20
+ margin: 0 auto;
21
+ padding: 56px 0 40px;
22
+ }
23
+
24
+ .hero {
25
+ max-width: 820px;
26
+ margin-bottom: 28px;
27
+ }
28
+
29
+ .eyebrow, .section-kicker {
30
+ margin: 0 0 10px;
31
+ font-size: 0.78rem;
32
+ font-weight: 750;
33
+ letter-spacing: 0.08em;
34
+ text-transform: uppercase;
35
+ color: #52627a;
36
+ }
37
  h1 {
38
+ margin: 0;
39
+ font-size: clamp(2.4rem, 6vw, 5.1rem);
40
+ line-height: 0.98;
41
+ letter-spacing: -0.055em;
42
+ }
43
+
44
+ .lede {
45
+ max-width: 720px;
46
+ margin: 22px 0 0;
47
+ font-size: clamp(1.05rem, 2vw, 1.3rem);
48
+ line-height: 1.6;
49
+ color: #4b5563;
50
+ }
51
+
52
+ .runtime-note {
53
+ display: inline-flex;
54
+ margin-top: 18px;
55
+ padding: 8px 12px;
56
+ border: 1px solid #dbe1ea;
57
+ border-radius: 999px;
58
+ background: rgba(255,255,255,.72);
59
+ color: #48566c;
60
+ font-size: 0.9rem;
61
  }
62
 
63
+ .workspace {
64
+ display: grid;
65
+ grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.45fr);
66
+ gap: 20px;
67
+ align-items: start;
68
  }
69
 
70
  .card {
71
+ border: 1px solid #e0e5ed;
72
+ border-radius: 22px;
73
+ background: rgba(255,255,255,.93);
74
+ box-shadow: 0 18px 50px rgba(26, 39, 63, 0.08);
75
+ }
76
+ .controls { padding: 24px; }
77
+ .result { padding: 24px; }
78
+
79
+ .step {
80
+ display: flex;
81
+ gap: 13px;
82
+ align-items: flex-start;
83
+ }
84
+
85
+ .step-number {
86
+ display: grid;
87
+ place-items: center;
88
+ width: 28px;
89
+ height: 28px;
90
+ flex: 0 0 28px;
91
+ border-radius: 50%;
92
+ background: #111827;
93
+ color: white;
94
+ font-size: 0.82rem;
95
+ font-weight: 750;
96
+ }
97
+
98
+ .grow { flex: 1; }
99
+ .control-label { font-weight: 700; }
100
+ .helper {
101
+ margin: 6px 0 0;
102
+ color: #667085;
103
+ font-size: 0.92rem;
104
+ line-height: 1.5;
105
+ }
106
+
107
+ .file-input {
108
+ width: 100%;
109
+ margin-top: 16px;
110
+ padding: 11px;
111
+ border: 1px dashed #bac3d2;
112
+ border-radius: 14px;
113
+ background: #fafbfc;
114
+ }
115
+
116
+ .divider {
117
+ height: 1px;
118
+ margin: 22px 0;
119
+ background: #eceff4;
120
+ }
121
+ .slider-row {
122
+ display: flex;
123
+ justify-content: space-between;
124
+ gap: 12px;
125
+ }
126
+
127
+ #threshold-value {
128
+ min-width: 48px;
129
+ text-align: right;
130
+ color: #334155;
131
+ font-variant-numeric: tabular-nums;
132
+ }
133
+
134
+ #threshold {
135
+ width: 100%;
136
+ margin-top: 13px;
137
+ accent-color: #111827;
138
+ }
139
+
140
+ .run-button {
141
+ width: 100%;
142
+ margin-top: 24px;
143
+ padding: 13px 18px;
144
+ border: 0;
145
+ border-radius: 14px;
146
+ background: #111827;
147
+ color: white;
148
+ font-weight: 750;
149
+ cursor: pointer;
150
+ transition: transform .15s ease, opacity .15s ease;
151
+ }
152
+
153
+ .run-button:not(:disabled):hover { transform: translateY(-1px); }
154
+ .run-button:disabled { opacity: .38; cursor: not-allowed; }
155
+
156
+ .status {
157
+ min-height: 1.4em;
158
+ margin: 14px 0 0;
159
+ color: #52627a;
160
+ font-size: .9rem;
161
+ }
162
+
163
+ .progress-wrap {
164
+ height: 5px;
165
+ margin-top: 10px;
166
+ overflow: hidden;
167
+ border-radius: 999px;
168
+ background: #edf0f5;
169
+ }
170
+ .progress-bar {
171
+ width: 0%;
172
+ height: 100%;
173
+ border-radius: inherit;
174
+ background: #111827;
175
+ transition: width .2s ease;
176
+ }
177
+
178
+ .result-head {
179
+ display: flex;
180
+ justify-content: space-between;
181
+ gap: 16px;
182
+ align-items: flex-start;
183
+ margin-bottom: 16px;
184
+ }
185
+
186
+ .result h2 {
187
+ margin: 0;
188
+ font-size: 1.35rem;
189
+ letter-spacing: -0.02em;
190
+ }
191
+
192
+ .badge {
193
+ padding: 7px 10px;
194
+ border-radius: 999px;
195
+ background: #eef2f7;
196
+ color: #536176;
197
+ font-size: .82rem;
198
+ font-weight: 700;
199
+ white-space: nowrap;
200
+ }
201
+
202
+ .badge.ready { background: #e8f7ef; color: #17623c; }
203
+ .badge.running { background: #fff4df; color: #805600; }
204
+ .badge.error { background: #fdecec; color: #9b2c2c; }
205
+
206
+ .canvas-wrap {
207
+ position: relative;
208
+ display: grid;
209
+ place-items: center;
210
+ min-height: 360px;
211
+ overflow: hidden;
212
+ border-radius: 16px;
213
+ background: #101318;
214
+ }
215
+ #result-canvas {
216
+ display: block;
217
+ max-width: 100%;
218
+ height: auto;
219
+ }
220
+
221
+ .canvas-wrap.empty #result-canvas { display: none; }
222
+
223
+ #canvas-placeholder {
224
+ margin: 0;
225
+ padding: 32px;
226
+ color: #9aa4b2;
227
+ text-align: center;
228
+ }
229
+
230
+ .canvas-wrap:not(.empty) #canvas-placeholder { display: none; }
231
+
232
+ .summary {
233
+ margin: 16px 0;
234
+ padding: 13px 15px;
235
+ border-radius: 13px;
236
+ background: #f7f8fa;
237
+ color: #344054;
238
+ font-weight: 650;
239
  }
240
 
241
+ .table-wrap {
242
+ overflow-x: auto;
243
+ border: 1px solid #e8ebf0;
244
+ border-radius: 14px;
245
+ }
246
+
247
+ table {
248
+ width: 100%;
249
+ border-collapse: collapse;
250
+ font-size: .9rem;
251
+ }
252
+
253
+ th, td {
254
+ padding: 11px 13px;
255
+ border-bottom: 1px solid #edf0f4;
256
+ text-align: left;
257
+ vertical-align: top;
258
+ }
259
+
260
+ th {
261
+ background: #fafbfc;
262
+ color: #52627a;
263
+ font-size: .78rem;
264
+ text-transform: uppercase;
265
+ letter-spacing: .05em;
266
+ }
267
+ tbody tr:last-child td { border-bottom: 0; }
268
+ .empty-row td { color: #7d899a; text-align: center; }
269
+
270
+ .explain {
271
+ margin-top: 20px;
272
+ padding: 22px 24px;
273
+ }
274
+
275
+ .flow {
276
+ display: flex;
277
+ flex-wrap: wrap;
278
+ gap: 10px;
279
+ align-items: center;
280
+ font-weight: 700;
281
+ }
282
+
283
+ .flow span:not(.arrow) {
284
+ padding: 8px 11px;
285
+ border-radius: 10px;
286
+ background: #f2f4f7;
287
+ }
288
+
289
+ .arrow { color: #98a2b3; }
290
+
291
+ footer {
292
+ padding: 22px 2px 0;
293
+ color: #7a8595;
294
+ font-size: .84rem;
295
+ }
296
+ @media (max-width: 820px) {
297
+ .page-shell {
298
+ width: min(100% - 20px, 720px);
299
+ padding-top: 34px;
300
+ }
301
+
302
+ .workspace { grid-template-columns: 1fr; }
303
+ .canvas-wrap { min-height: 280px; }
304
+ }
305
+
306
+ @media (max-width: 520px) {
307
+ .card { border-radius: 17px; }
308
+ .controls, .result, .explain { padding: 18px; }
309
+ .result-head { align-items: center; }
310
+ th, td { padding: 9px 10px; }
311
+ }
312
+
313
+ .or-row {
314
+ display: flex;
315
+ align-items: center;
316
+ gap: 10px;
317
+ margin: 18px 0 14px;
318
+ color: #98a2b3;
319
+ font-size: .8rem;
320
+ text-transform: uppercase;
321
+ letter-spacing: .08em;
322
+ }
323
+ .or-row::before, .or-row::after {
324
+ content: '';
325
+ height: 1px;
326
+ flex: 1;
327
+ background: #eceff4;
328
+ }
329
+
330
+ .sample-head {
331
+ display: flex;
332
+ justify-content: space-between;
333
+ gap: 12px;
334
+ align-items: flex-start;
335
+ }
336
+ .sample-title { margin: 0; }
337
+ .shuffle-button {
338
+ flex: 0 0 auto;
339
+ padding: 7px 10px;
340
+ border: 1px solid #d8dee8;
341
+ border-radius: 10px;
342
+ background: #fff;
343
+ color: #344054;
344
+ cursor: pointer;
345
+ font-size: .82rem;
346
+ font-weight: 700;
347
+ }
348
+
349
+ .shuffle-button:hover { background: #f7f8fa; }
350
+ .sample-grid {
351
+ display: grid;
352
+ grid-template-columns: repeat(2, minmax(0, 1fr));
353
+ gap: 10px;
354
+ margin-top: 12px;
355
+ }
356
+ .sample-card {
357
+ min-width: 0;
358
+ padding: 0;
359
+ overflow: hidden;
360
+ border: 1px solid #e0e5ed;
361
+ border-radius: 12px;
362
+ background: #fff;
363
+ cursor: pointer;
364
+ text-align: left;
365
+ transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
366
+ }
367
+ .sample-card:hover {
368
+ transform: translateY(-1px);
369
+ border-color: #aeb8c6;
370
+ box-shadow: 0 8px 18px rgba(26,39,63,.08);
371
+ }
372
+ .sample-card.selected {
373
+ border-color: #111827;
374
+ box-shadow: 0 0 0 2px #111827;
375
+ }
376
+ .sample-card img {
377
+ display: block;
378
+ width: 100%;
379
+ aspect-ratio: 4 / 3;
380
+ object-fit: cover;
381
+ background: #eef1f5;
382
+ }
383
+
384
+ .sample-card span {
385
+ display: block;
386
+ padding: 8px 9px 9px;
387
+ overflow: hidden;
388
+ color: #475467;
389
+ font-size: .78rem;
390
+ font-weight: 700;
391
+ text-overflow: ellipsis;
392
+ white-space: nowrap;
393
+ }
394
+
395
+ @media (max-width: 420px) {
396
+ .sample-head { align-items: center; }
397
+ .sample-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
398
+ }
399
+
400
+ /* v1.0 teaching-flow refinements */
401
+ .lesson-strip {
402
+ display: flex;
403
+ flex-wrap: wrap;
404
+ gap: 10px;
405
+ margin-top: 18px;
406
+ }
407
+ .lesson-strip span {
408
+ padding: 8px 11px;
409
+ border: 1px solid #dfe4ec;
410
+ border-radius: 999px;
411
+ background: rgba(255, 255, 255, .76);
412
+ color: #52627a;
413
+ font-size: .86rem;
414
+ }
415
+ .lesson-strip b {
416
+ color: #111827;
417
+ margin-right: 4px;
418
+ }
419
+
420
+ .coco-head {
421
+ margin-top: 18px;
422
+ }
423
+ .input-kicker {
424
+ margin: 0 0 4px;
425
+ color: #344054;
426
+ font-size: .78rem;
427
+ font-weight: 800;
428
+ letter-spacing: .04em;
429
+ text-transform: uppercase;
430
+ }
431
+
432
+ .explain-title {
433
+ max-width: 820px;
434
+ margin: 0;
435
+ font-size: clamp(1.25rem, 2vw, 1.7rem);
436
+ line-height: 1.25;
437
+ letter-spacing: -.025em;
438
+ }
439
+ .explain-copy {
440
+ max-width: 900px;
441
+ margin: 12px 0 18px;
442
+ color: #536176;
443
+ line-height: 1.65;
444
+ }
445
+ .extension-note {
446
+ margin: 16px 0 0;
447
+ padding-top: 14px;
448
+ border-top: 1px solid #eceff4;
449
+ color: #5d6879;
450
+ font-size: .92rem;
451
+ line-height: 1.55;
452
+ }
453
+
454
+ .sample-card small {
455
+ display: block;
456
+ padding: 0 9px 9px;
457
+ color: #8a94a4;
458
+ font-size: .67rem;
459
+ line-height: 1.2;
460
+ letter-spacing: .01em;
461
+ }
462
+
463
+
464
+ /* v8 browser model selector */
465
+ .model-select {
466
+ width: 100%;
467
+ margin-top: 10px;
468
+ padding: 11px 12px;
469
+ border: 1px solid #cfd7e3;
470
+ border-radius: 12px;
471
+ background: #fff;
472
+ color: #111827;
473
+ }
474
+ .model-select:focus {
475
+ outline: 2px solid #111827;
476
+ outline-offset: 2px;
477
  }