miyuki17's picture
fix: align WR92 course navigation and verified public guidance
ea77a04 verified
|
Raw History Blame Contribute Delete
9.15 kB
metadata
title: AI-Powered Object Detection
emoji: 🔎
colorFrom: blue
colorTo: indigo
sdk: static
app_file: index.html
pinned: false

AI-Powered Object Detection

中文说明

本仓库是正式的目标检测独立实验室,适合给教师和学生分享;旧 test 地址继续作为历史兼容入口。

这是一个面向 Creative Technology / 入门 AI 课程的小型目标检测教学实验。

这个项目的重点不是让学生从零重建目标检测器,而是展示:一个已经训练好的 AI 模型,如何把传统计算机视觉任务变成可以直接调用、比较和扩展的能力。

学习路径

  1. 从 COCO 2017 validation 示例库中选择一张真实图片,或者上传自己的图片。
  2. 选择一个浏览器可运行的预训练目标检测模型:RT-DETR R18、DETR ResNet-50 或 YOLOS Tiny。
  3. 查看 bounding boxes、类别标签、confidence scores 和目标数量。
  4. 固定同一张图片,只切换模型,比较三个模型的预测差异。
  5. 调整 confidence threshold,观察结果如何变化。

模型与数据

  • 推荐的浏览器默认模型:onnx-community/rtdetr_r18vd(RT-DETR R18)
  • 浏览器对比模型:Xenova/detr-resnet-50、Xenova/yolos-tiny
  • 任务:Object Detection
  • 模型训练数据:COCO
  • 示例库:从 COCO 2017 validation 中选出的 100 张图片

三个浏览器模型都已经训练完成。这个 Demo 只做 inference,不需要训练模型,也不需要学生购买或维护 GPU 服务器。

内置 COCO 示例用于给课堂提供可靠、丰富的起始输入。COCO 本身不拥有这些底层图片;每张图片仍保留其原始许可信息。

一个项目,一个 Demo

这个仓库的源代码和线上 Demo 是同一个项目:

  • index.html — 页面结构与教学流程
  • style.css — 页面视觉样式
  • app.js — 交互、图片处理与结果绘制
  • detector.js — AI 模型调用
  • examples/ — 100 张 COCO validation 示例图片

当前产品意图记录在 docs/wish/LATEST.md,Space 专属设计解释记录在 docs/wish/DESIGN.md。

学生作业

学生可以复制这个 Space 作为可运行的起点,然后继续改进 Object Detection,或者改造成另一个 AI 任务。提交结果应让读者快速看懂:应用是做什么的、输入是什么、输出是什么、用了什么模型或服务、学生自己修改了什么,并至少展示一个真实测试结果和一个诚实的局限。

App 页面中的 How to Start 提供浏览器操作步骤;PDF guide 提供同样内容的可分享版本。

学生不需要从零发明或训练一个 AI 模型。

超越基础要求

更高质量的作业应深入所选 AI 任务本身,例如:

  • 比较或替换预训练模型;
  • 调整一个相关参数并解释 trade-off;
  • 测试另一个数据集或 domain,并分析失败案例;
  • 改进 robustness、speed、evaluation 或 AI application;
  • 在有数据、算力和公平评估的前提下,把 training / fine-tuning 作为加分方向。

重点是有意义的探索,而不是单纯增加代码行数。

Runtime

这个 Space 是 Static Space,在浏览器内通过 Transformers.js 运行所选模型。每个模型第一次运行时需要下载模型文件,之后可以复用浏览器缓存。RT-DETR 仍是推荐的课堂默认模型。

课堂使用前检查

上课前建议确认:

  • 至少一个 COCO 示例可以正常检测;
  • Shuffle 会从 100 张示例库中重新随机显示 4 张图片;
  • 上传自己的图片后可以运行检测;
  • confidence slider 会改变过滤结果;
  • 第一次未缓存运行时能显示加载进度,而不是看起来卡住;
  • 窄屏 / 手机宽度下页面没有横向溢出。

历史 v1.0 验证

2026-09-08 的 v1.0 自动化浏览器测试验证过当时的 8 张内置 COCO 示例、Shuffle、上传图片、threshold、首次加载状态、错误处理,以及 Chromium / WebKit 的真实检测和 390 px 移动端布局。

之后示例库已经扩充到 100 张。不要把历史 v1.0 的 8 张逐图测试误读为对当前 100 张示例全部重新完成了同等回归测试。

浏览器 Demo 与 Python 教学代码

线上 Static Space 是交互演示层。单独的课程材料包还包含教师要求的 Python 参考脚本,例如 Faster R-CNN、YOLO、RT-DETR,以及可选 DETR。浏览器 Demo 和 Python 教学路径用途不同,不应把两套模型组合混为一谈。


English

This is the canonical standalone Object Detection Lab for teaching and sharing; the older test address remains available for legacy links.

This is a small teaching mini-lab for a Creative Technology / introductory AI course.

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, compared, and extended inside an application.

Learning path

  1. Choose a real image from the COCO 2017 validation sample bank, or upload your own image.
  2. Choose a browser-compatible pretrained detector: RT-DETR R18, DETR ResNet-50, or YOLOS Tiny.
  3. Inspect bounding boxes, class labels, confidence scores, and object counts.
  4. Keep the image fixed and switch models to compare predictions.
  5. Change the confidence threshold and observe what changes.

Model and data

  • Recommended browser default: onnx-community/rtdetr_r18vd (RT-DETR R18)
  • Additional browser comparison models: Xenova/detr-resnet-50, Xenova/yolos-tiny
  • Task: object detection
  • Training dataset: COCO
  • Example bank: 100 selected images from COCO 2017 validation

All three browser models are already trained. This demo performs inference only; no model training or GPU server is required.

The bundled COCO examples give the classroom demo reliable, varied starting inputs. COCO does not own the underlying images; each image retains its original license.

One project, one demo

The source code and the live demo are the same project:

  • index.html — page structure and teaching flow
  • style.css — presentation
  • app.js — interaction, image handling, and result rendering
  • detector.js — the AI model call
  • examples/ — 100 COCO validation examples

The maintainer's current product intent is in docs/wish/LATEST.md, with the Space-specific design interpretation in docs/wish/DESIGN.md.

Student assignment

Students can duplicate this Space as a working starting point, then improve object detection or adapt the project to a different AI task. A submission should make the app's purpose, input, output, model or service, and the student's own changes easy to understand, and should show at least one real result and one honest limitation.

In the App tab, select How to Start for the browser-based steps. The PDF guide provides the same content in a shareable format.

Students are not required to invent or train an AI model from scratch.

Going beyond the baseline

Higher-scoring work should deepen the chosen AI task itself. Students can, for example:

  • compare or replace pretrained models;
  • tune a relevant setting and explain the trade-offs;
  • test another dataset or domain and analyze failure cases;
  • improve robustness, speed, evaluation, or the AI application;
  • use training or fine-tuning as optional bonus work when data, compute, and fair evaluation are available.

The emphasis is on meaningful exploration, not simply adding more lines of code.

Runtime

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.

Classroom check before use

Before presenting, verify:

  • at least one COCO example detects correctly;
  • Shuffle redraws four images from the 100-image sample bank;
  • an uploaded image can be detected;
  • the confidence slider changes filtering behavior;
  • the first uncached run shows progress instead of appearing frozen;
  • the page still works at a narrow/mobile width.

Historical v1.0 verification

The v1.0 release was checked on 2026-09-08 with automated browser tests against the then-current eight bundled COCO examples, plus Shuffle, upload, threshold behavior, first-load progress, the error path, real detection in Chromium and WebKit, and a 390 px mobile viewport.

The sample bank has since expanded to 100 images. Do not interpret the historical eight-image verification as a complete equivalent regression over all 100 current examples.

Browser demo and Python teaching path

The hosted Static Space is the interactive visualization layer. The separate course package contains Python reference scripts such as Faster R-CNN, YOLO, RT-DETR, and optional DETR. The browser demo and the Python teaching path serve different purposes and should not be treated as the same model set.