cvpfus Codex commited on
Commit
a13e743
·
1 Parent(s): 916c180

Add fallback alt text for generated images

Browse files

Co-authored-by: Codex <codex@openai.com>

Files changed (6) hide show
  1. FIELD_NOTES.md +1 -1
  2. README.md +1 -1
  3. SUBMISSION.md +1 -1
  4. app.py +1 -1
  5. scripts/verify.py +5 -0
  6. static/index.html +12 -3
FIELD_NOTES.md CHANGED
@@ -65,7 +65,7 @@ Keyboard map:
65
 
66
  Live accessibility demos need dependable behavior. If llama.cpp is not available, the app uses deterministic local narration prefixes. If Kokoro is not installed or cannot load a voice, the app returns a short silent WAV while keeping the transcript visible. If the VLM integration is unavailable, image ids map to cached alt text.
67
 
68
- The app preloads image descriptions through `/api/image-descriptions`, caches them in the frontend, and writes the descriptions back into each image's `alt` attribute. That keeps the visible article, transcript, and spoken image narration aligned.
69
 
70
  The same payload carries image-generation receipts. In fallback mode, the app is explicit that bundled assets stand in for the FLUX.2 klein runtime instead of presenting static files as live model output.
71
 
 
65
 
66
  Live accessibility demos need dependable behavior. If llama.cpp is not available, the app uses deterministic local narration prefixes. If Kokoro is not installed or cannot load a voice, the app returns a short silent WAV while keeping the transcript visible. If the VLM integration is unavailable, image ids map to cached alt text.
67
 
68
+ The HTML starts with meaningful fallback `alt` text for each generated image. The app then preloads image descriptions through `/api/image-descriptions`, caches them in the frontend, and writes the descriptions back into each image's `alt` attribute. That keeps the visible article, transcript, and spoken image narration aligned even if the model path is unavailable.
69
 
70
  The same payload carries image-generation receipts. In fallback mode, the app is explicit that bundled assets stand in for the FLUX.2 klein runtime instead of presenting static files as live model output.
71
 
README.md CHANGED
@@ -111,7 +111,7 @@ Reader buttons expose `aria-keyshortcuts`, and the Repeat and Stop shortcuts are
111
 
112
  The session panel keeps a transcript of recent narration with copy and clear controls, making the spoken path inspectable during demos and useful for the Field Notes write-up. Copy actions report when browser clipboard access is unavailable, so the visible transcript and commands remain inspectable.
113
 
114
- Image descriptions are preloaded into a local cache and written into the page's real `img alt` attributes. When the planned MiniCPM-V runtime is unavailable, deterministic alt-text fallbacks keep the screen-reader path usable.
115
 
116
  The session panel also renders image receipts from `/api/image-descriptions`, so judges can inspect the prompt, seed, planned <=4B image model, and fallback status behind each bundled article illustration.
117
 
 
111
 
112
  The session panel keeps a transcript of recent narration with copy and clear controls, making the spoken path inspectable during demos and useful for the Field Notes write-up. Copy actions report when browser clipboard access is unavailable, so the visible transcript and commands remain inspectable.
113
 
114
+ Images start with meaningful fallback `alt` text in the HTML. Image descriptions are then preloaded into a local cache and written into the page's real `img alt` attributes. When the planned MiniCPM-V runtime is unavailable, deterministic alt-text fallbacks keep the screen-reader path usable.
115
 
116
  The session panel also renders image receipts from `/api/image-descriptions`, so judges can inspect the prompt, seed, planned <=4B image model, and fallback status behind each bundled article illustration.
117
 
SUBMISSION.md CHANGED
@@ -58,4 +58,4 @@ The Copy Evidence button pulls `/api/evidence-bundle` and writes the formatted J
58
 
59
  ## Reliability notes
60
 
61
- The demo remains navigable when local models are unavailable. The reader brain falls back to deterministic narration, image descriptions fall back to cached alt text, speech falls back to browser speech plus transcript, and generated images fall back to bundled article assets. Fallback states are labeled instead of hidden.
 
58
 
59
  ## Reliability notes
60
 
61
+ The demo remains navigable when local models are unavailable. The reader brain falls back to deterministic narration, generated images start with meaningful HTML alt text, image descriptions fall back to cached alt text, speech falls back to browser speech plus transcript, and generated images fall back to bundled article assets. Fallback states are labeled instead of hidden.
app.py CHANGED
@@ -445,7 +445,7 @@ def accessibility_audit_core() -> dict[str, Any]:
445
  "id": "image_alt_text",
446
  "label": "Image descriptions",
447
  "status": "pass",
448
- "evidence": "The app preloads article image descriptions and writes them into real img alt attributes.",
449
  },
450
  {
451
  "id": "inspectable_transcript",
 
445
  "id": "image_alt_text",
446
  "label": "Image descriptions",
447
  "status": "pass",
448
+ "evidence": "Article images start with meaningful fallback alt text, then model descriptions are written into real img alt attributes.",
449
  },
450
  {
451
  "id": "inspectable_transcript",
scripts/verify.py CHANGED
@@ -36,6 +36,11 @@ def verify_static_assets() -> None:
36
  index_html = (ROOT / "static" / "index.html").read_text(encoding="utf-8")
37
  assert_true('data-reader-type="heading"' in index_html, "Article should mark heading reader nodes")
38
  assert_true('data-reader-type="image"' in index_html, "Article should mark image reader nodes")
 
 
 
 
 
39
  assert_true('aria-live="polite"' in index_html, "Article should expose an aria-live narration region")
40
  for shortcut in ['aria-keyshortcuts="Space"', 'aria-keyshortcuts="N"', 'aria-keyshortcuts="R"', 'aria-keyshortcuts="S"']:
41
  assert_true(shortcut in index_html, f"Reader controls should expose {shortcut}")
 
36
  index_html = (ROOT / "static" / "index.html").read_text(encoding="utf-8")
37
  assert_true('data-reader-type="heading"' in index_html, "Article should mark heading reader nodes")
38
  assert_true('data-reader-type="image"' in index_html, "Article should mark image reader nodes")
39
+ assert_true('alt=""' not in index_html, "Article images should not start with empty alt text")
40
+ assert_true(
41
+ "reader brain, vision, speech, and image generation models" in index_html,
42
+ "Article should include meaningful fallback alt text for generated images",
43
+ )
44
  assert_true('aria-live="polite"' in index_html, "Article should expose an aria-live narration region")
45
  for shortcut in ['aria-keyshortcuts="Space"', 'aria-keyshortcuts="N"', 'aria-keyshortcuts="R"', 'aria-keyshortcuts="S"']:
46
  assert_true(shortcut in index_html, f"Reader controls should expose {shortcut}")
static/index.html CHANGED
@@ -35,7 +35,10 @@
35
  </p>
36
 
37
  <figure class="hero-figure speakable" data-reader-type="image" data-image-id="desk-reader">
38
- <img src="/static/generated/desk-reader.svg" alt="" />
 
 
 
39
  <figcaption>
40
  The article view doubles as the demo surface, so every feature has a real reading task.
41
  </figcaption>
@@ -59,7 +62,10 @@
59
  the final narration, and a four-billion-parameter image model creates article illustrations.
60
  </p>
61
  <figure class="inline-figure speakable" data-reader-type="image" data-image-id="model-map">
62
- <img src="/static/generated/model-map.svg" alt="" />
 
 
 
63
  <figcaption>Each model stays at or below four billion parameters for Tiny Titan eligibility.</figcaption>
64
  </figure>
65
  </section>
@@ -71,7 +77,10 @@
71
  uses deterministic fallbacks so the accessibility layer remains dependable during a live demo.
72
  </p>
73
  <figure class="inline-figure speakable" data-reader-type="image" data-image-id="field-notes">
74
- <img src="/static/generated/field-notes.svg" alt="" />
 
 
 
75
  <figcaption>Field notes document the choices behind the screen-reader behavior.</figcaption>
76
  </figure>
77
  </section>
 
35
  </p>
36
 
37
  <figure class="hero-figure speakable" data-reader-type="image" data-image-id="desk-reader">
38
+ <img
39
+ src="/static/generated/desk-reader.svg"
40
+ alt="Illustration of an article reader with narration controls and a highlighted reading path."
41
+ />
42
  <figcaption>
43
  The article view doubles as the demo surface, so every feature has a real reading task.
44
  </figcaption>
 
62
  the final narration, and a four-billion-parameter image model creates article illustrations.
63
  </p>
64
  <figure class="inline-figure speakable" data-reader-type="image" data-image-id="model-map">
65
+ <img
66
+ src="/static/generated/model-map.svg"
67
+ alt="Diagram showing the reader brain, vision, speech, and image generation models working together."
68
+ />
69
  <figcaption>Each model stays at or below four billion parameters for Tiny Titan eligibility.</figcaption>
70
  </figure>
71
  </section>
 
77
  uses deterministic fallbacks so the accessibility layer remains dependable during a live demo.
78
  </p>
79
  <figure class="inline-figure speakable" data-reader-type="image" data-image-id="field-notes">
80
+ <img
81
+ src="/static/generated/field-notes.svg"
82
+ alt="Notebook-style field notes about model sizes, keyboard controls, and accessibility checks."
83
+ />
84
  <figcaption>Field notes document the choices behind the screen-reader behavior.</figcaption>
85
  </figure>
86
  </section>