File size: 12,849 Bytes
29d301f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e2a0f8b
29d301f
 
 
 
e2a0f8b
 
 
29d301f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e2a0f8b
29d301f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!doctype html>
<html lang="en" data-wr92-course="project">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="WR92 connected image AI studio: detect objects locally, edit the resulting concepts, then optionally generate a new image with SDXL Turbo or SANA-Sprint.">
  <title>Detect → Create | WR92 Course</title>
  <link rel="stylesheet" href="./style.css">
  <link rel="stylesheet" href="./wr92-language.css">
  <link rel="stylesheet" href="./wr92-theme.css">
  <script defer src="./wr92-language.js"></script>
</head>
<body class="wr92-capstone-page">
  <header class="wr92-shell">
    <div class="wr92-shell-inner">
      <a class="wr92-brand" href="https://wr92-course-readme.static.hf.space/"><span class="wr92-brand-mark" aria-hidden="true">W·</span><span>WR92 <span class="wr92-brand-light">COURSE</span></span></a>
      <nav class="wr92-site-links" aria-label="Course navigation">
        <div class="wr92-nav-group">
          <span class="wr92-nav-label"><span class="wr92-en">01 / LEARN</span><span class="wr92-zh">01 / 学习</span></span>
          <div class="wr92-nav-items">
            <a href="https://wr92-course-readme.static.hf.space/"><span class="wr92-en">Home</span><span class="wr92-zh">首页</span></a>
            <a href="https://wr92-course-object-detection-lab.static.hf.space/"><span class="wr92-en">Object detection</span><span class="wr92-zh">目标检测</span></a>
            <a href="https://wr92-course-image-generation-lab.static.hf.space/"><span class="wr92-en">Image generation</span><span class="wr92-zh">图像生成</span></a>
          </div>
        </div>
        <div class="wr92-nav-group">
          <span class="wr92-nav-label"><span class="wr92-en">02 / LIVE TOOLS</span><span class="wr92-zh">02 / 在线工具</span></span>
          <div class="wr92-nav-items">
            <a href="https://huggingface.co/spaces/miyuki17/creative-technology-image-generation">SDXL Turbo</a>
            <a href="https://huggingface.co/spaces/miyuki17/creative-technology-sana-sprint">SANA-Sprint</a>
          </div>
        </div>
        <div class="wr92-nav-group wr92-nav-project">
          <span class="wr92-nav-label"><span class="wr92-en">03 / APPLY</span><span class="wr92-zh">03 / 综合实践</span></span>
          <div class="wr92-nav-items">
            <a class="wr92-feature-link" href="./detect-create.html" aria-current="page"><span class="wr92-en">Detect → Create</span><span class="wr92-zh">检测 → 生成</span></a>
          </div>
        </div>
      </nav>
      <div class="wr92-language-toolbar" role="group" aria-label="Language / 语言">
        <button type="button" data-wr92-lang="en" aria-pressed="true" disabled>EN</button>
        <button type="button" data-wr92-lang="zh" aria-pressed="false" disabled>中文</button>
      </div>
    </div>
  </header>

  <main class="page-shell" id="top">
    <nav class="wr92-learning-path" aria-label="Learning pathway">
      <span><span class="wr92-en">LEARNING PATH</span><span class="wr92-zh">学习路径</span></span>
      <a href="./index.html"><span class="wr92-en">01 · Detect</span><span class="wr92-zh">01 · 识别</span></a>
      <a href="https://wr92-course-image-generation-lab.static.hf.space/"><span class="wr92-en">02 · Generate</span><span class="wr92-zh">02 · 生成</span></a>
      <strong aria-current="step"><span class="wr92-en">03 · Connect</span><span class="wr92-zh">03 · 串联</span></strong>
    </nav>
    <header class="wr92-capstone-intro">
      <div>
        <p class="eyebrow"><span class="wr92-en">03 / CONNECTED STUDIO · THE FINAL PROJECT</span><span class="wr92-zh">03 / 综合实验 · 课程项目</span></p>
        <h1><span class="wr92-en">See it. Name it.<br>Reimagine it.</span><span class="wr92-zh">先识别,再理解,<br>然后重新创作。</span></h1>
      </div>
      <div>
        <p class="wr92-capstone-lede"><span class="wr92-en">Use two real AI capabilities in one place: detect everyday objects in a photo, turn the labels into a prompt you can edit, then optionally create a new image.</span><span class="wr92-zh">在同一个工作台中使用两项真实 AI 能力:识别照片中的物体、把类别变成可修改的提示词,再按需生成新图片。</span></p>
        <p class="wr92-capstone-privacy"><span class="wr92-en">Detection runs locally in your browser. Only your edited text, seed and steps go to the optional ZeroGPU image generator—not the source photo. Free quota and queue limits apply.</span><span class="wr92-zh">检测在浏览器本地运行。可选 ZeroGPU 生成只发送文字、随机种子和步数,不上传原照片;仍受免费额度与排队限制。</span></p>
      </div>
    </header>

    <div class="wr92-capstone-steps" aria-label="Three-step activity">
      <span><strong>01</strong><span class="wr92-en">Choose &amp; detect</span><span class="wr92-zh">选图并识别</span></span>
      <span><strong>02</strong><span class="wr92-en">Review results</span><span class="wr92-zh">查看检测结果</span></span>
      <span><strong>03</strong><span class="wr92-en">Edit &amp; generate</span><span class="wr92-zh">修改并生成</span></span>
    </div>

    <section class="workspace" aria-label="Detect-to-create connected AI workbench">
      <div class="controls card">
        <p class="section-kicker"><span class="wr92-en">STEP 01 / START HERE</span><span class="wr92-zh">第一步 / 从这里开始</span></p>
        <h2 class="wr92-panel-title"><span class="wr92-en">Choose a photo</span><span class="wr92-zh">选择一张照片</span></h2>
        <p class="helper"><span class="wr92-en">Use a tested COCO example or upload your own. The images are processed locally.</span><span class="wr92-zh">选择一张 COCO 示例,或上传自己的照片;检测在浏览器本地运行。</span></p>

        <div class="sample-head coco-head">
          <p class="input-kicker"><span class="wr92-en">COCO validation examples</span><span class="wr92-zh">COCO 验证集示例</span></p>
          <button id="shuffle-examples" class="shuffle-button" type="button"><span class="wr92-en">Shuffle</span><span class="wr92-zh">换一组</span></button>
        </div>
        <div id="sample-grid" class="sample-grid" aria-label="COCO example images"></div>
        <div class="or-row"><span><span class="wr92-en">or use your own</span><span class="wr92-zh">或者自己上传</span></span></div>
        <label class="control-label" for="image-input"><span class="wr92-en">Upload an image</span><span class="wr92-zh">上传图片</span></label>
        <input id="image-input" class="file-input" type="file" accept="image/*">
        <div class="divider"></div>
        <label class="control-label" for="model-select"><span class="wr92-en">Detector</span><span class="wr92-zh">检测模型</span></label>
        <select id="model-select" class="model-select"></select>
        <p id="model-note" class="helper">RT-DETR is the recommended classroom default.</p>
        <div class="slider-row">
          <label class="control-label" for="threshold"><span class="wr92-en">Confidence threshold</span><span class="wr92-zh">置信度阈值</span></label>
          <output id="threshold-value" for="threshold">0.50</output>
        </div>
        <input id="threshold" type="range" min="0.10" max="0.95" value="0.50" step="0.05">
        <button id="run-button" class="run-button" type="button" disabled><span class="wr92-en">Run AI detection</span><span class="wr92-zh">开始识别</span></button>
        <p id="status" class="status" aria-live="polite">Choose an example or upload an image.</p>
        <div id="progress-wrap" class="progress-wrap" hidden><div id="progress-bar" class="progress-bar"></div></div>
      </div>

      <div class="result card">
        <div class="result-head">
          <div>
            <p class="section-kicker"><span class="wr92-en">STEP 02 / LOOK CLOSELY</span><span class="wr92-zh">第二步 / 观察结果</span></p>
            <h2 class="wr92-panel-title"><span class="wr92-en">What did AI find?</span><span class="wr92-zh">AI 识别出了什么?</span></h2>
          </div>
          <span id="runtime-badge" class="badge">Waiting</span>
        </div>
        <div id="canvas-wrap" class="canvas-wrap empty">
          <canvas id="result-canvas" aria-label="Detection result"></canvas>
          <p id="canvas-placeholder"><span class="wr92-en">Your photo and the real detection boxes will appear here.</span><span class="wr92-zh">原始照片与真实检测框将在此处显示。</span></p>
        </div>
        <div id="summary" class="summary">No detections yet.</div>
        <div class="table-wrap">
          <table>
            <thead><tr><th>Object</th><th>Confidence</th><th>Bounding box</th></tr></thead>
            <tbody id="detections-body"><tr class="empty-row"><td colspan="3">Run the detector to see details.</td></tr></tbody>
          </table>
        </div>
        <p class="wr92-workbench-hint"><span class="wr92-en">Only recognized object categories are passed to the third step. Detection cannot tell you the full story or artistic style.</span><span class="wr92-zh">下一步只接收识别出的物体类别;检测模型无法理解完整故事或艺术风格。</span></p>
      </div>

      <section class="wr92-flow-section" id="detect-create" aria-labelledby="flow-heading">
        <div class="wr92-flow-panel">
          <p class="section-kicker"><span class="wr92-en">STEP 03 / MAKE SOMETHING NEW</span><span class="wr92-zh">第三步 / 重新创作</span></p>
          <h2 class="wr92-panel-title" id="flow-heading"><span class="wr92-en">From labels to image</span><span class="wr92-zh">从物体概念到新图片</span></h2>
          <p class="flow-help"><span class="wr92-en">Detected concepts appear here after Step 1. Review and correct the prompt before generating.</span><span class="wr92-zh">第一步完成后,识别出的概念会自动出现。生成前可检查和修改提示词。</span></p>
          <div id="flow-concepts" class="flow-chips" aria-live="polite"></div>
          <label for="flow-prompt"><span class="wr92-en">Editable English prompt</span><span class="wr92-zh">可编辑的英文提示词</span></label>
          <textarea id="flow-prompt" lang="en" maxlength="350" placeholder="Run detection first to build a prompt" spellcheck="true"></textarea>
          <label for="flow-model"><span class="wr92-en">Choose generator</span><span class="wr92-zh">选择生成模型</span></label>
          <select id="flow-model">
            <option value="sdxl">SDXL Turbo · 2 steps</option>
            <option value="sana">SANA-Sprint · 1 step</option>
          </select>
          <button id="flow-generate" type="button" disabled><span class="wr92-en">Generate new image</span><span class="wr92-zh">生成新图片</span></button>
          <div class="wr92-output-block">
            <p class="wr92-output-label"><span class="wr92-en">NEW IMAGE / RESULT</span><span class="wr92-zh">新生成的图片 / 结果</span></p>
            <img id="flow-image" class="flow-output" alt="Generated image preview" hidden>
            <p class="wr92-output-empty"><span class="wr92-en">Your new image will appear here after you choose Generate.</span><span class="wr92-zh">点击生成后,新图片会显示在这里。</span></p>
            <p id="flow-status" class="flow-status" role="status" aria-live="polite"></p>
            <pre id="flow-receipt" class="flow-receipt" hidden></pre>
          </div>
          <p class="flow-help"><span class="wr92-en">This creates a fresh concept-based image—not a copy or edit of your photo. Live inference is optional and uses visitor ZeroGPU quota.</span><span class="wr92-zh">这里会根据概念生成新图,而不是复制或修改原图。实时生成属可选操作,会消耗访客 ZeroGPU 额度。</span></p>
          <a id="flow-open" class="flow-open-link" href="https://huggingface.co/spaces/miyuki17/creative-technology-image-generation" target="_blank" rel="noopener noreferrer"><span class="wr92-en">Open the generator separately</span><span class="wr92-zh">单独打开生成工具</span></a>
        </div>
      </section>
    </section>

    <footer class="wr92-capstone-footer">
      <span><span class="wr92-en">Two lessons. Two optional generators. One connected project.</span><span class="wr92-zh">两门课程、两个可选生成工具、一个完整的综合实验。</span></span>
      <a href="./index.html"><span class="wr92-en">Return to Object Detection</span><span class="wr92-zh">返回目标检测课</span></a>
    </footer>
  </main>
  <script type="module" src="./app.js"></script>
</body>
</html>