Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions vision-models/beginner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Beginner vision deck — "How machines learn to see"

Materials for presenting the IOAI Section 3 (computer vision) syllabus to a
zero-background 14–18 audience.

```
beginner/
├── presentation/
│ ├── how_machines_learn_to_see.pdf ← present this (fullscreen in any PDF viewer)
│ └── how_machines_learn_to_see.pptx ← same deck, Google Slides–ready (upload to Drive)
├── teacher/
│ ├── teacher_guide.pdf ← READ THIS FIRST — every slide explained in simple English
│ └── PRESENTER_SCRIPT.md ← compact per-slide talking points + Q&A cards
├── build/ ← scripts that generate everything
│ ├── build_beginner_deck.py ← deck PDF (uv run --with weasyprint python build_beginner_deck.py)
│ ├── build_pptx.py ← PPTX (uv run --with pymupdf --with python-pptx python build_pptx.py)
│ ├── build_teacher_guide.py ← teacher guide (uv run --with weasyprint --with pymupdf python build_teacher_guide.py)
│ ├── guide_content.py ← the teacher guide text lives here
│ └── CONTENT_DRAFT.md ← original content outline
└── assets/ ← real outputs from the repo notebooks used in the deck
```

Suggested prep order: teacher_guide.pdf once (≈45 min) → skim PRESENTER_SCRIPT.md →
practice slide 6 (the hand convolution) → present from presentation/.
Binary file added vision-models/beginner/assets/astronaut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/aug_crop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/aug_flip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/aug_jitter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/aug_noise.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/aug_original.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/chelsea.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/chelsea_400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/chelsea_gray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/chelsea_marked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/chelsea_zoom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/clip_demo_raw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions vision-models/beginner/assets/clip_results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"prompts": ["a photo of a cat", "a photo of a dog", "a photo of a tiger", "a photo of a pizza"], "probs": [0.9793983697891235, 0.0047552092000842094, 0.015624566935002804, 0.00022184147383086383]}
Binary file added vision-models/beginner/assets/det_astronaut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/det_chelsea.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions vision-models/beginner/assets/det_results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"chelsea": [["cat", 97]], "astronaut": [["person", 91]]}
Binary file added vision-models/beginner/assets/diff_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/diff_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/diff_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/diff_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/diff_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/fmap_vertical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions vision-models/beginner/assets/pixel_grid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"x": 167, "y": 93, "values": [[67, 59, 53, 51, 48, 38, 21, 7, 10, 14], [64, 68, 61, 58, 49, 28, 16, 9, 9, 6], [73, 70, 70, 63, 46, 20, 12, 9, 10, 7], [86, 91, 84, 67, 48, 25, 17, 16, 11, 8], [95, 91, 89, 65, 53, 50, 42, 36, 25, 18], [72, 64, 58, 58, 62, 75, 80, 72, 61, 50], [52, 52, 87, 44, 52, 63, 72, 79, 84, 77], [45, 95, 153, 50, 30, 30, 39, 49, 58, 62], [44, 114, 172, 68, 40, 32, 29, 26, 30, 29], [46, 130, 185, 79, 50, 46, 43, 36, 29, 19]]}
Binary file added vision-models/beginner/assets/resnet_filters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/seg_cutout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/seg_mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision-models/beginner/assets/seg_photo.png
1 change: 1 addition & 0 deletions vision-models/beginner/build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_thumbs/
257 changes: 257 additions & 0 deletions vision-models/beginner/build/CONTENT_DRAFT.md

Large diffs are not rendered by default.

1,290 changes: 1,290 additions & 0 deletions vision-models/beginner/build/build_beginner_deck.py

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions vision-models/beginner/build/build_pptx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Builds the Google Slides-ready PPTX from the rendered deck PDF.
# Each slide is a full-bleed image, so the design survives any import.
# Run: uv run --with pymupdf --with python-pptx python build_pptx.py
import os, tempfile
import fitz
from pptx import Presentation
from pptx.util import Inches

HERE = os.path.dirname(os.path.abspath(__file__))
DECK = os.path.join(HERE, "..", "presentation", "how_machines_learn_to_see.pdf")
OUT = os.path.join(HERE, "..", "presentation", "how_machines_learn_to_see.pptx")

def main():
doc = fitz.open(DECK)
prs = Presentation()
prs.slide_width, prs.slide_height = Inches(13.333), Inches(7.5)
blank = prs.slide_layouts[6]
with tempfile.TemporaryDirectory() as td:
for i, page in enumerate(doc):
png = os.path.join(td, f"{i}.png")
page.get_pixmap(dpi=96).save(png) # 1920x1080
s = prs.slides.add_slide(blank)
s.shapes.add_picture(png, 0, 0, width=prs.slide_width, height=prs.slide_height)
prs.save(OUT)
print("wrote", OUT, f"({len(doc)} slides)")

if __name__ == "__main__":
main()
104 changes: 104 additions & 0 deletions vision-models/beginner/build/build_teacher_guide.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Builds teacher_guide.pdf — a slide-by-slide companion in simple English.
# Run from this folder: uv run --with weasyprint --with pymupdf python build_teacher_guide.py
import html as H
import os
import fitz
from weasyprint import HTML
from guide_content import GUIDE

HERE = os.path.dirname(os.path.abspath(__file__))
DECK_PDF = os.path.join(HERE, "..", "presentation", "how_machines_learn_to_see.pdf")
THUMB_DIR = os.path.join(HERE, "_thumbs")
OUT = os.path.join(HERE, "..", "teacher", "teacher_guide.pdf")

CSS = """
@page { size: 210mm 297mm; margin: 16mm 16mm 18mm 16mm;
@bottom-right { content: counter(page); font-family: 'Roboto Mono', monospace;
font-size: 8pt; color: #999; } }
* { box-sizing: border-box; }
body { font-family: 'Satoshi', 'Helvetica Neue', Arial, sans-serif; color: #000;
font-size: 10.5pt; line-height: 1.5; margin: 0; }
.cover { page-break-after: always; padding-top: 60mm; }
.cover .kicker { font-family: 'Roboto Mono', monospace; font-size: 9pt; letter-spacing: 0.2em;
text-transform: uppercase; color: #666; }
.cover h1 { font-size: 34pt; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1;
margin: 8mm 0 6mm 0; }
.cover p { font-size: 12pt; color: #333; max-width: 150mm; }
.howto { background: #f4f4f4; padding: 6mm 7mm; margin-top: 10mm; max-width: 160mm; }
.howto p { font-size: 10.5pt; margin: 0 0 2.5mm 0; }
.entry { page-break-inside: avoid; margin-bottom: 9mm; border-top: 1.2pt solid #000;
padding-top: 4mm; }
.entry .num { font-family: 'Roboto Mono', monospace; font-size: 8.5pt; letter-spacing: 0.18em;
color: #666; text-transform: uppercase; }
.entry h2 { font-size: 15pt; font-weight: 600; letter-spacing: -0.01em; margin: 1.5mm 0 3.5mm 0; }
.thumb { width: 74mm; float: right; margin: 0 0 3mm 5mm; border: 0.4pt solid #ccc; }
.lbl { font-family: 'Roboto Mono', monospace; font-size: 7.5pt; letter-spacing: 0.18em;
text-transform: uppercase; color: #888; margin: 3mm 0 1mm 0; }
.mean p { margin: 0 0 2.5mm 0; }
.say { background: #000; color: #fff; padding: 3.5mm 4.5mm; margin-top: 2mm; }
.say p { margin: 0; font-size: 10pt; }
.say .lbl { color: #aaa; margin: 0 0 1mm 0; }
.ask { background: #f4f4f4; padding: 3mm 4.5mm; margin-top: 2.5mm; }
.ask p { margin: 0 0 1.5mm 0; font-size: 9.5pt; }
.ask .lbl { margin: 0 0 1mm 0; }
.clear { clear: both; }
b { font-weight: 600; }
"""


def render_thumbs():
os.makedirs(THUMB_DIR, exist_ok=True)
doc = fitz.open(DECK_PDF)
for i, page in enumerate(doc):
out = os.path.join(THUMB_DIR, f"s{i+1:02d}.png")
if not os.path.exists(out):
page.get_pixmap(dpi=60).save(out)
return len(doc)


def entry_html(e):
paras = "".join(f"<p>{p}</p>" for p in e["mean"])
ask = ""
if e.get("ask"):
qa = "".join(f'<p><b>&ldquo;{H.escape(q)}&rdquo;</b> — {H.escape(a)}</p>' for q, a in e["ask"])
ask = f'<div class="ask"><div class="lbl">If they ask</div>{qa}</div>'
return f"""
<div class="entry">
<div class="num">Slide {e['n']:02d} of 39</div>
<h2>{e['title']}</h2>
<img class="thumb" src="_thumbs/s{e['n']:02d}.png"/>
<div class="lbl">What this actually means</div>
<div class="mean">{paras}</div>
<div class="say"><div class="lbl">Say this</div><p>{e['say']}</p></div>
{ask}
<div class="clear"></div>
</div>"""


def main():
n = render_thumbs()
assert n == len(GUIDE) == 39, (n, len(GUIDE))
cover = """
<div class="cover">
<div class="kicker">Teacher guide &middot; read me the night before</div>
<h1>How machines learn to see<br/>— explained simply, slide by slide</h1>
<p>This guide walks through all 39 slides of the presentation in the simplest English possible.
For each slide: a small picture of it, what it actually means, the key sentence to say out loud,
and answers to questions students might ask.</p>
<div class="howto">
<p><b>How to use this guide</b></p>
<p>1. Read it once, start to finish. It takes about 45 minutes.</p>
<p>2. Any part that makes you pause &mdash; read that section twice. The cheat-sheet slides (36&ndash;38) double as your own revision check.</p>
<p>3. While presenting, you do not need this guide open &mdash; the &ldquo;say this&rdquo; lines are the backbone, and the slides carry the rest.</p>
<p>4. Slide 6 is the heart of the whole talk. Practice the nine multiplications once so you can lead them confidently.</p>
</div>
</div>"""
body = cover + "".join(entry_html(e) for e in GUIDE)
html = f"<html><head><meta charset='utf-8'><style>{CSS}</style></head><body>{body}</body></html>"
os.makedirs(os.path.dirname(OUT), exist_ok=True)
HTML(string=html, base_url=HERE).write_pdf(OUT)
print("wrote", OUT)


if __name__ == "__main__":
main()
Loading