<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://saisriteja.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://saisriteja.github.io/" rel="alternate" type="text/html" /><updated>2026-10-18T15:03:12+00:00</updated><id>https://saisriteja.github.io/feed.xml</id><title type="html">Teja’s Blog</title><subtitle>My first blog. Probably no one else will ever read it, but oh well.
</subtitle><author><name>K Sai Sri Teja</name></author><entry><title type="html">Reconstructing an Entire Movie Song as a 3D World</title><link href="https://saisriteja.github.io/2026/09/24/MovieDigitalTwin.html" rel="alternate" type="text/html" title="Reconstructing an Entire Movie Song as a 3D World" /><published>2026-09-24T09:00:00+00:00</published><updated>2026-09-24T09:00:00+00:00</updated><id>https://saisriteja.github.io/2026/09/24/MovieDigitalTwin</id><content type="html" xml:base="https://saisriteja.github.io/2026/09/24/MovieDigitalTwin.html"><![CDATA[<meta http-equiv="refresh" content="0; url=/MovieDigitalTwin/">
<link rel="canonical" href="https://saisriteja.github.io/MovieDigitalTwin/">

<p style="font-family: system-ui, sans-serif; font-size: 1.05rem; line-height: 1.6; max-width: 36rem; margin: 2rem auto; padding: 0 1rem;">
  Redirecting to the full article&hellip;
  If you are not redirected automatically,
  <a href="/MovieDigitalTwin/">open <em>Reconstructing an Entire Movie Song as a 3D World</em></a>.
</p>

<script>
  window.location.replace("/MovieDigitalTwin/");
</script>]]></content><author><name>K Sai Sri Teja</name></author><category term="ComputerVision" /><category term="3D" /><category term="GenerativeAI" /><summary type="html"><![CDATA[How we turned the Pinga song courtyard from Bajirao Mastani into a walkable 3D set using HY-World 2.0 — frame picking, panorama stitching, camera trajectories, WorldStereo inpainting, and 3D Gaussian Splatting.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://saisriteja.github.io/MovieDigitalTwin/media/01_input/panorama.png" /><media:content medium="image" url="https://saisriteja.github.io/MovieDigitalTwin/media/01_input/panorama.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Part 2: From Textbook Chapter to Sci-Fi Film</title><link href="https://saisriteja.github.io/2026/03/15/EducationVideoGenPart2.html" rel="alternate" type="text/html" title="Part 2: From Textbook Chapter to Sci-Fi Film" /><published>2026-03-15T12:00:00+00:00</published><updated>2026-03-15T12:00:00+00:00</updated><id>https://saisriteja.github.io/2026/03/15/EducationVideoGenPart2</id><content type="html" xml:base="https://saisriteja.github.io/2026/03/15/EducationVideoGenPart2.html"><![CDATA[<style>
.ev-post {
  --bg: #F9F7F7;
  --surface: #FFFFFF;
  --card: rgba(255, 255, 255, 0.88);
  --border: #DBE2EF;
  --text: #112D4E;
  --text-soft: #4a6380;
  --muted: #8fa3bb;
  --accent: #3F72AF;
  --accent2: #2c5590;
  --accent3: #6b9fd4;
  --accent4: #4a86c2;
  --accent5: #527faa;
  color: var(--text);
  line-height: 1.7;
}

.ev-post * { box-sizing: border-box; }

.ev-post .hero {
  background: linear-gradient(135deg, #F9F7F7 0%, #DBE2EF 55%, rgba(63, 114, 175, 0.08) 100%);
  padding: 56px 40px 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.ev-post .hero::before {
  content:'';position:absolute;top:-100px;right:-100px;
  width:500px;height:500px;
  background:radial-gradient(circle,rgba(63,114,175,.12) 0%,transparent 70%);
  pointer-events:none;
}
.ev-post .hero-inner { max-width:820px; position:relative; z-index:1; }
.ev-post .series-tag {
  display:inline-flex;align-items:center;gap:8px;
  background:rgba(63,114,175,.08);border:1px solid rgba(63,114,175,.22);
  color:var(--accent);border-radius:20px;padding:5px 14px;
  font-size:11px;letter-spacing:.12em;
  text-transform:uppercase;margin-bottom:24px;font-weight:600;
}
.ev-post .series-tag span { width:6px;height:6px;border-radius:50%;background:var(--accent);animation:ev-pulse 2s infinite; }
@keyframes ev-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.ev-post .hero h1 {
  font-size:clamp(30px,4.5vw,52px);font-weight:700;line-height:1.12;
  margin-bottom:20px;color:var(--text);
}
.ev-post .hero h1 em { color:var(--accent);font-style:normal; }
.ev-post .hero-desc {
  color:var(--text-soft);font-size:16px;max-width:680px;margin-bottom:36px;line-height:1.7;
}
.ev-post .hero-meta {
  display:flex;flex-wrap:wrap;gap:24px;align-items:center;
  font-size:12px;color:var(--muted);letter-spacing:.04em;
}
.ev-post .hero-meta a { color:var(--accent);text-decoration:none;border-bottom:1px solid rgba(63,114,175,.25); }
.ev-post .hero-meta a:hover { color:var(--accent2);border-color:var(--accent2); }

.ev-post .kpi-strip {
  display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:1px;background:var(--border);
  border-bottom:1px solid var(--border);
}
.ev-post .kpi { background:var(--surface);padding:22px 20px;text-align:center; }
.ev-post .kpi-value {
  font-size:28px;font-weight:700;
  color:var(--accent);line-height:1;margin-bottom:6px;
}
.ev-post .kpi-label { font-size:10px;color:var(--muted);letter-spacing:.08em;text-transform:uppercase; }

.ev-post .container { max-width:1100px;margin:0 auto;padding:0 32px; }
.ev-post .section { padding:60px 0;border-bottom:1px solid var(--border); }

.ev-post .section-eyebrow {
  font-size:11px;letter-spacing:.18em;
  text-transform:uppercase;color:var(--accent);margin-bottom:10px;font-weight:600;
}
.ev-post .section-title { font-size:28px;font-weight:700;line-height:1.2;margin-bottom:10px;color:var(--text); }
.ev-post .section-title em { color:var(--accent);font-style:normal; }
.ev-post .section-lead { color:var(--text-soft);font-size:15px;max-width:720px;line-height:1.7;margin-bottom:36px; }

.ev-post .goal-box {
  background:linear-gradient(135deg,rgba(219,226,239,.55),rgba(63,114,175,.06));
  border:1px solid var(--border);border-left:3px solid var(--accent);
  border-radius:14px;padding:28px 32px;margin-bottom:48px;
}
.ev-post .goal-box h3 { font-size:14px;font-weight:700;color:var(--accent);margin-bottom:12px;letter-spacing:.06em;text-transform:uppercase; }
.ev-post .goal-box p { color:var(--text-soft);font-size:15px;line-height:1.75; }

.ev-post .card {
  background:var(--card);border:1px solid var(--border);border-radius:14px;padding:24px;
  box-shadow:0 8px 32px rgba(63,114,175,0.08);
}
.ev-post .card-title {
  font-size:11px;font-weight:700;color:var(--muted);
  text-transform:uppercase;letter-spacing:.1em;margin-bottom:20px;
}

.ev-post .grid-2 { display:grid;grid-template-columns:1fr 1fr;gap:20px; }
.ev-post .grid-3 { display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px; }
@media(max-width:860px) {
  .ev-post .grid-2,.ev-post .grid-3 { grid-template-columns:1fr; }
  .ev-post .container { padding:0 16px; }
  .ev-post .hero { padding:40px 20px 32px; }
}

.ev-post .insight-row { display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin-top:20px; }
.ev-post .insight {
  background:var(--card);border:1px solid var(--border);border-radius:14px;
  padding:18px 20px;border-left:3px solid var(--accent2);
  box-shadow:0 4px 20px rgba(63,114,175,0.06);
}
.ev-post .insight.blue { border-left-color:var(--accent); }
.ev-post .insight.green { border-left-color:var(--accent3); }
.ev-post .insight.orange { border-left-color:var(--accent4); }
.ev-post .insight-icon { font-size:20px;margin-bottom:8px; }
.ev-post .insight-title { font-size:13px;font-weight:700;margin-bottom:5px;color:var(--text); }
.ev-post .insight-body { font-size:12.5px;color:var(--text-soft);line-height:1.55; }
.ev-post .insight-body strong { color:var(--text); }

.ev-post .pull-quote {
  border-left:3px solid var(--accent);padding:14px 24px;margin:28px 0;
  background:rgba(219,226,239,.35);border-radius:0 12px 12px 0;
}
.ev-post .pull-quote p { font-size:16px;font-style:italic;color:var(--text);line-height:1.65; }
.ev-post .pull-quote cite { font-size:12px;color:var(--muted);font-style:normal;display:block;margin-top:8px; }

.ev-post .prose { font-size:15px;line-height:1.8;color:var(--text-soft);max-width:760px; }
.ev-post .prose + .prose { margin-top:14px; }
.ev-post .prose strong { color:var(--text); }
.ev-post .prose em { color:var(--accent);font-style:normal;font-weight:600; }

.ev-post .spacer-sm { height:20px; }
.ev-post .spacer { height:32px; }

/* Pipeline-specific */
.ev-post .pipeline-diagram {
  background:var(--card);border:1px solid var(--border);border-radius:14px;
  padding:32px 28px;margin:32px 0;overflow-x:auto;
  box-shadow:0 8px 32px rgba(63,114,175,0.08);
}
.ev-post .pipeline-row {
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:center;
}
.ev-post .pipe-node {
  display:flex;flex-direction:column;align-items:center;gap:6px;
  min-width:90px;text-align:center;
}
.ev-post .pipe-badge {
  width:44px;height:44px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  font-size:13px;font-weight:700;color:#F9F7F7;
}
.ev-post .pipe-badge.text { background:var(--accent); }
.ev-post .pipe-badge.visual { background:var(--accent3); }
.ev-post .pipe-badge.gpu { background:var(--accent4); }
.ev-post .pipe-badge.audio { background:var(--accent2); }
.ev-post .pipe-badge.edit { background:var(--accent5); }
.ev-post .pipe-label { font-size:10px;font-weight:600;color:var(--text);letter-spacing:.04em; }
.ev-post .pipe-sub { font-size:9px;color:var(--muted);max-width:80px;line-height:1.3; }
.ev-post .pipe-arrow { color:var(--muted);font-size:18px;flex-shrink:0;padding:0 2px; }

.ev-post .stage-card {
  background:var(--card);border:1px solid var(--border);border-radius:14px;
  padding:28px 28px 24px;margin-bottom:20px;
  box-shadow:0 8px 32px rgba(63,114,175,0.06);
  position:relative;overflow:hidden;
}
.ev-post .stage-card::before {
  content:'';position:absolute;top:0;left:0;right:0;height:3px;
}
.ev-post .stage-card.s-text::before { background:var(--accent); }
.ev-post .stage-card.s-visual::before { background:var(--accent3); }
.ev-post .stage-card.s-gpu::before { background:var(--accent4); }
.ev-post .stage-card.s-audio::before { background:var(--accent2); }
.ev-post .stage-card.s-edit::before { background:var(--accent5); }

.ev-post .stage-header { display:flex;align-items:flex-start;gap:16px;margin-bottom:16px; }
.ev-post .stage-num {
  width:40px;height:40px;border-radius:10px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  font-size:14px;font-weight:700;color:#F9F7F7;
}
.ev-post .stage-num.text { background:var(--accent); }
.ev-post .stage-num.visual { background:var(--accent3); }
.ev-post .stage-num.gpu { background:var(--accent4); }
.ev-post .stage-num.audio { background:var(--accent2); }
.ev-post .stage-num.edit { background:var(--accent5); }
.ev-post .stage-name { font-size:18px;font-weight:700;color:var(--text);margin-bottom:4px; }
.ev-post .stage-agent { font-size:11px;color:var(--muted);letter-spacing:.06em;text-transform:uppercase; }
.ev-post .stage-body { font-size:14px;color:var(--text-soft);line-height:1.7;margin-bottom:16px; }
.ev-post .stage-meta { display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px; }
.ev-post .stage-tag {
  display:inline-block;font-size:10px;font-weight:600;letter-spacing:.06em;
  text-transform:uppercase;padding:4px 10px;border-radius:6px;
}
.ev-post .stage-tag.model { background:rgba(63,114,175,.1);color:var(--accent); }
.ev-post .stage-tag.output { background:rgba(107,159,212,.12);color:var(--accent3); }
.ev-post .stage-tag.gate { background:rgba(44,85,144,.08);color:var(--accent2); }

.ev-post .code-block {
  background:#112D4E;border-radius:10px;padding:16px 20px;
  font-family:'Space Mono',monospace;font-size:12px;line-height:1.6;
  color:#DBE2EF;overflow-x:auto;margin-top:12px;
}
.ev-post .code-block .comment { color:#8fa3bb; }
.ev-post .code-block .cmd { color:#6b9fd4; }

.ev-post .cast-card {
  background:var(--card);border:1px solid var(--border);border-radius:14px;
  padding:24px;text-align:center;
  box-shadow:0 4px 20px rgba(63,114,175,0.06);
}
.ev-post .cast-avatar {
  width:64px;height:64px;border-radius:50%;margin:0 auto 14px;
  display:flex;align-items:center;justify-content:center;
  font-size:24px;font-weight:700;color:#F9F7F7;
}
.ev-post .cast-avatar.m { background:var(--accent); }
.ev-post .cast-avatar.f { background:var(--accent3); }
.ev-post .cast-avatar.y { background:var(--accent4); }
.ev-post .cast-name { font-size:16px;font-weight:700;margin-bottom:4px;color:var(--text); }
.ev-post .cast-role { font-size:11px;color:var(--accent);letter-spacing:.08em;text-transform:uppercase;margin-bottom:10px; }
.ev-post .cast-desc { font-size:12.5px;color:var(--text-soft);line-height:1.55; }

.ev-post .scene-type {
  display:flex;align-items:flex-start;gap:14px;
  background:var(--card);border:1px solid var(--border);border-radius:12px;
  padding:18px 20px;margin-bottom:12px;
}
.ev-post .scene-badge {
  font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  padding:5px 10px;border-radius:6px;flex-shrink:0;margin-top:2px;
}
.ev-post .scene-badge.story { background:rgba(63,114,175,.12);color:var(--accent); }
.ev-post .scene-badge.concept { background:rgba(107,159,212,.14);color:var(--accent3); }
.ev-post .scene-badge.hybrid { background:rgba(74,134,194,.12);color:var(--accent4); }
.ev-post .scene-desc { font-size:13px;color:var(--text-soft);line-height:1.6; }
.ev-post .scene-desc strong { color:var(--text); }

.ev-post .model-table { width:100%;border-collapse:collapse;font-size:13px; }
.ev-post .model-table th {
  text-align:left;padding:10px 14px;font-size:10px;letter-spacing:.08em;
  text-transform:uppercase;color:var(--muted);background:rgba(219,226,239,.45);
  border-bottom:1px solid var(--border);
}
.ev-post .model-table td {
  padding:12px 14px;border-bottom:1px solid rgba(219,226,239,.9);
  color:var(--text-soft);vertical-align:top;
}
.ev-post .model-table td:first-child { font-weight:600;color:var(--text); }
.ev-post .model-table tr:last-child td { border-bottom:none; }

.ev-post .prev-link {
  display:inline-flex;align-items:center;gap:6px;
  color:var(--accent);text-decoration:none;font-size:13px;
  border-bottom:1px solid rgba(63,114,175,.25);margin-bottom:24px;
}
.ev-post .prev-link:hover { color:var(--accent2); }

.ev-post .next-box {
  background:linear-gradient(135deg,rgba(219,226,239,.5),rgba(63,114,175,.06));
  border:1px solid var(--border);border-radius:14px;padding:36px 40px;
  text-align:center;margin-top:60px;
}
.ev-post .next-box h3 { font-size:22px;font-weight:700;margin-bottom:12px;color:var(--text); }
.ev-post .next-box p { color:var(--text-soft);max-width:560px;margin:0 auto 24px;font-size:14px;line-height:1.7; }
.ev-post .next-box a {
  display:inline-block;background:var(--accent);color:#F9F7F7;
  font-weight:700;font-size:13px;padding:11px 28px;border-radius:10px;text-decoration:none;
  letter-spacing:.04em;
}
.ev-post .next-box a:hover { background:var(--accent2); }

.ev-post .footer {
  padding:36px;text-align:center;color:var(--muted);font-size:12px;
  border-top:1px solid var(--border);background:var(--bg);
}
.ev-post .footer a { color:var(--accent);text-decoration:none; }
.ev-post .footer a:hover { color:var(--accent2); }
</style>

<div class="ev-post">

<!-- HERO -->
<div class="hero">
  <div class="container">
    <div class="hero-inner">
      <div class="series-tag"><span></span> Education Content Creation Series · Part 2</div>
      <h1>From Textbook Chapter<br>to <em>Sci-Fi Film</em></h1>
      <p class="hero-desc">
        Part 1 decoded what makes great educational YouTube work. Part 2 is the generation side:
        a <strong style="color:var(--text)">7-stage pipeline</strong> that takes a dry textbook chapter — table of contents,
        sub-topics, equations — and produces a cinematic short film that actually teaches the material.
        Not slides. Not a voiceover over PDF pages. A <em>movie</em>.
      </p>
      <div class="hero-meta">
        <span>📅 March 2026</span>
        <span>·</span>
        <span>⏱ ~12 min read</span>
        <span>·</span>
        <span><a href="/2026/02/22/EducationVideoGenPart1.html">← Part 1: Creator DNA Analysis</a></span>
      </div>
    </div>
  </div>
</div>

<!-- KPI STRIP -->
<div class="kpi-strip">
  <div class="kpi"><div class="kpi-value">7</div><div class="kpi-label">Pipeline Stages</div></div>
  <div class="kpi"><div class="kpi-value">3</div><div class="kpi-label">Locked Characters</div></div>
  <div class="kpi"><div class="kpi-value">3</div><div class="kpi-label">Scene Types</div></div>
  <div class="kpi"><div class="kpi-value">~18</div><div class="kpi-label">Target Minutes</div></div>
  <div class="kpi"><div class="kpi-value">Qwen</div><div class="kpi-label">Text / Planning LLM</div></div>
  <div class="kpi"><div class="kpi-value">Flux</div><div class="kpi-label">Keyframe Generation</div></div>
  <div class="kpi"><div class="kpi-value">Manim</div><div class="kpi-label">Math Inserts</div></div>
</div>

<div class="container">

<a class="prev-link" href="/2026/02/22/EducationVideoGenPart1.html">← Part 1: Decoding Educational YouTube DNA</a>

<!-- THE VISION -->
<div class="section">
  <div class="section-eyebrow">The North Star</div>
  <div class="section-title">Why <em>Movie-Based</em> Education?</div>
  <p class="section-lead">
    Textbooks are precise but emotionally inert. The best YouTube educators — the ones we analyzed in Part 1 —
    succeed because they wrap ideas in narrative, character, and visual rhythm. The ideal end state isn't
    "AI-generated Khan Academy." It's production-quality films where the math is the plot.
  </p>

  <div class="goal-box">
    <h3>🎬 The Core Idea</h3>
    <p>
      Take a textbook chapter — say, <strong style="color:var(--accent2)">Complex Numbers</strong> from an intermediate mathematics syllabus —
      and transform it into a science-fiction short film. Three recurring characters navigate a real problem.
      When the story demands it, the film cuts to a precise Manim visualization of the concept.
      The viewer learns the chapter not by reading it, but by <em>living inside it</em>.
    </p>
  </div>

  <div class="insight-row">
    <div class="insight blue">
      <div class="insight-icon">📚</div>
      <div class="insight-title">Input: structured chapter text</div>
      <div class="insight-body">Table of contents, sub-topic headings, page ranges — or the full chapter body. The pipeline doesn't need perfect prose; it needs <strong>topic boundaries and mathematical scope</strong>.</div>
    </div>
    <div class="insight green">
      <div class="insight-icon">🎥</div>
      <div class="insight-title">Output: a dubbed short film</div>
      <div class="insight-body">One ~18-minute film per chapter, with cinematic story scenes, Manim concept inserts, voice performance, SFX, score — and eventually <strong>multilingual dubbing</strong> for Indian languages.</div>
    </div>
    <div class="insight orange">
      <div class="insight-icon">🔗</div>
      <div class="insight-title">Bridge to Part 1</div>
      <div class="insight-body">The creator DNA from Part 1 (narration rate, scene duration, visual richness) becomes the <strong>style target</strong> this pipeline learns to hit — Kurzgesagt pacing, OverSimplified narrative density, etc.</div>
    </div>
  </div>

  <div class="pull-quote">
    <p>"M poses the real problem → Y and F work it out → F teaches Y via cinematic scenes → one high-level Manim insert per concept → back to story. The math is never explained before the viewer has a reason to need it."</p>
    <cite>— Pipeline design principle</cite>
  </div>
</div>

<!-- CAST -->
<div class="section">
  <div class="section-eyebrow">The World</div>
  <div class="section-title">Three Characters, <em>One Series</em></div>
  <p class="section-lead">
    Every chapter shares the same cast and visual world. Characters are locked at series setup —
    reference photos, voice profiles, and visual grammar are built once and reused across all chapters.
  </p>

  <div class="grid-3">
    <div class="cast-card">
      <div class="cast-avatar m">M</div>
      <div class="cast-name">M</div>
      <div class="cast-role">The Mathematician</div>
      <div class="cast-desc">Poses the real-world problem. Reads the signals. Sets the stakes. M never lectures — M <em>notices</em> something wrong and hands the problem to the team.</div>
    </div>
    <div class="cast-card">
      <div class="cast-avatar f">F</div>
      <div class="cast-name">F</div>
      <div class="cast-role">The Friend</div>
      <div class="cast-desc">Works through the math with Y. Explains concepts only when Y (and the viewer) has a concrete reason to need them. The pedagogical voice of the series.</div>
    </div>
    <div class="cast-card">
      <div class="cast-avatar y">Y</div>
      <div class="cast-name">Y</div>
      <div class="cast-role">You — The Viewer</div>
      <div class="cast-desc">Viewer POV character. Asks the questions the audience is thinking. Y's confusion drives the pacing — F never gets ahead of Y's understanding.</div>
    </div>
  </div>

  <div class="spacer"></div>

  <p class="prose">
    The <em>Series Bible</em> (Stage 3) locks everything: character descriptions, voice profiles, world premise,
    set designs, camera rules, color grade, and a multi-angle reference photo bank per character.
    Flux keyframe generation uses these references to keep identity consistent shot-to-shot, chapter-to-chapter.
  </p>
</div>

<!-- SCENE TYPES -->
<div class="section">
  <div class="section-eyebrow">Scene Architecture</div>
  <div class="section-title">Three Scene <em>Types</em></div>
  <p class="section-lead">
    Every scene in the screenplay is tagged with one of three types. This determines which generation path handles it downstream.
  </p>

  <div class="scene-type">
    <span class="scene-badge story">STORY</span>
    <div class="scene-desc"><strong>Cinematic scenes.</strong> Characters in the sci-fi world — control rooms, antenna arrays, data streams. Generated via Flux keyframes → LTX/WAN video animation. Dialogue-driven, visually rich, full production value.</div>
  </div>
  <div class="scene-type">
    <span class="scene-badge concept">CONCEPT</span>
    <div class="scene-desc"><strong>Manim inserts.</strong> One high-level visualization per math topic — locked at Stage 1 as <code style="font-size:12px;background:rgba(219,226,239,.5);padding:2px 6px;border-radius:4px">core_visual_idea</code>. No derivations, no scope creep. Shows <em>the one thing</em> the viewer must see to understand the concept.</div>
  </div>
  <div class="scene-type">
    <span class="scene-badge hybrid">HYBRID</span>
    <div class="scene-desc"><strong>Diegetic screen → Manim match-cut.</strong> A character looks at a holographic display or cracked monitor showing the math. Camera pushes in on the screen — match-cut into the Manim visualization. Pull back to story when the concept lands.</div>
  </div>
</div>

<!-- PIPELINE OVERVIEW -->
<div class="section">
  <div class="section-eyebrow">Architecture</div>
  <div class="section-title">The 7-Stage <em>Pipeline</em></div>
  <p class="section-lead">
    Text stages run first on Qwen via vLLM. GPU-heavy pixel generation runs only after all upstream text passes quality gates.
    Each stage writes to a dedicated <code style="font-size:12px;background:rgba(219,226,239,.5);padding:2px 6px;border-radius:4px">output/</code> subdirectory — never mixing artifacts.
  </p>

  <div class="pipeline-diagram">
    <div class="pipeline-row">
      <div class="pipe-node">
        <div class="pipe-badge text">1</div>
        <div class="pipe-label">Math Bible</div>
        <div class="pipe-sub">topics + equations</div>
      </div>
      <div class="pipe-arrow">→</div>
      <div class="pipe-node">
        <div class="pipe-badge text">2</div>
        <div class="pipe-label">Screenplay</div>
        <div class="pipe-sub">scenes + dialogue</div>
      </div>
      <div class="pipe-arrow">→</div>
      <div class="pipe-node">
        <div class="pipe-badge visual">3</div>
        <div class="pipe-label">Series Bible</div>
        <div class="pipe-sub">cast + refs</div>
      </div>
      <div class="pipe-arrow">→</div>
      <div class="pipe-node">
        <div class="pipe-badge visual">4</div>
        <div class="pipe-label">Storyboard</div>
        <div class="pipe-sub">shots + keyframes</div>
      </div>
      <div class="pipe-arrow">→</div>
      <div class="pipe-node">
        <div class="pipe-badge gpu">5a</div>
        <div class="pipe-label">Cinematic</div>
        <div class="pipe-sub">LTX video</div>
      </div>
      <div class="pipe-arrow">+</div>
      <div class="pipe-node">
        <div class="pipe-badge gpu">5b</div>
        <div class="pipe-label">Manim</div>
        <div class="pipe-sub">math inserts</div>
      </div>
      <div class="pipe-arrow">→</div>
      <div class="pipe-node">
        <div class="pipe-badge audio">6</div>
        <div class="pipe-label">Audio</div>
        <div class="pipe-sub">voice + dub</div>
      </div>
      <div class="pipe-arrow">→</div>
      <div class="pipe-node">
        <div class="pipe-badge edit">7</div>
        <div class="pipe-label">Final Cut</div>
        <div class="pipe-sub">ffmpeg assembly</div>
      </div>
    </div>
  </div>

  <p class="prose">
    Stages <em>5a</em> (cinematic video) and <em>5b</em> (Manim) run in parallel after the storyboard is locked.
    Stage 6 reconciles timing across all assets. Stage 7 assembles everything into the finished film.
  </p>
</div>

<!-- STAGE BY STAGE -->
<div class="section">
  <div class="section-eyebrow">Deep Dive</div>
  <div class="section-title">Stage-by-Stage <em>Breakdown</em></div>
  <p class="section-lead">Each stage has a dedicated script, prompt template, quality gate, and output directory. The orchestrator (<code style="font-size:12px;background:rgba(219,226,239,.5);padding:2px 6px;border-radius:4px">run_pipeline.py</code>) chains them with gate checks.</p>

  <!-- Stage 1 -->
  <div class="stage-card s-text">
    <div class="stage-header">
      <div class="stage-num text">1</div>
      <div>
        <div class="stage-agent">Mathematician Agent</div>
        <div class="stage-name">Math Bible</div>
      </div>
    </div>
    <div class="stage-body">
      Reads the raw chapter text and extracts every sub-topic. For each topic, it invents a <strong>load-bearing real-world problem</strong>,
      locks the core equation, defines prerequisites, and specifies exactly one <code style="font-size:12px">core_visual_idea</code> for the Manim insert.
      Explicitly marks what to exclude — no scope creep downstream.
    </div>
    <div class="stage-meta">
      <span class="stage-tag model">Qwen 3.5</span>
      <span class="stage-tag output">output/math_bible/</span>
      <span class="stage-tag gate">Equation verification gate</span>
    </div>
    <div class="code-block">
      <span class="comment"># Input: textbook ToC or full chapter</span><br>
      <span class="cmd">python3 scripts/generate_math_bible.py \</span><br>
      &nbsp;&nbsp;--input scripts/samples/input_docs.md
    </div>
  </div>

  <!-- Stage 2 -->
  <div class="stage-card s-text">
    <div class="stage-header">
      <div class="stage-num text">2</div>
      <div>
        <div class="stage-agent">Screenwriter Agent</div>
        <div class="stage-name">Screenplay</div>
      </div>
    </div>
    <div class="stage-body">
      Transforms the math bible into a real screenplay — scene headers, action lines, character dialogue, intentions.
      Every math topic gets covered. F never explains before Y has a reason to need it.
      Scenes are tagged STORY, CONCEPT, or HYBRID. Target runtime: ~18 minutes with rising tension, not flat lectures.
    </div>
    <div class="stage-meta">
      <span class="stage-tag model">Qwen 3.5</span>
      <span class="stage-tag output">output/screenplay/</span>
      <span class="stage-tag gate">Topic coverage + dialogue WPM</span>
    </div>
    <div class="code-block">
      <span class="cmd">python3 scripts/generate_screenplay.py</span>
    </div>
  </div>

  <!-- Stage 3 -->
  <div class="stage-card s-visual">
    <div class="stage-header">
      <div class="stage-num visual">3</div>
      <div>
        <div class="stage-agent">Character &amp; Series Bible Agent</div>
        <div class="stage-name">Series Bible + Reference Bank</div>
      </div>
    </div>
    <div class="stage-body">
      Locks M, F, Y identity — descriptions, voice profiles, world premise, set designs, visual grammar, camera rules.
      Builds a multi-angle reference photo bank per character (front, three-quarter, profile, close-up, full-body).
      Built once, reused forever. Extended only when a new angle is genuinely needed.
    </div>
    <div class="stage-meta">
      <span class="stage-tag model">Qwen 3.5 + Flux</span>
      <span class="stage-tag output">output/series_bible/</span>
      <span class="stage-tag gate">Manual reference review</span>
    </div>
    <div class="code-block">
      <span class="cmd">python3 scripts/generate_series_bible.py</span><br>
      <span class="cmd">python3 scripts/build_reference_bank.py --copy-only</span>
    </div>
  </div>

  <!-- Stage 4 -->
  <div class="stage-card s-visual">
    <div class="stage-header">
      <div class="stage-num visual">4</div>
      <div>
        <div class="stage-agent">Storyboard / Image Agent</div>
        <div class="stage-name">Storyboard + Keyframes</div>
      </div>
    </div>
    <div class="stage-body">
      Breaks each screenplay scene into fully specified shots — lens, subject scale, camera move, blocking, dialogue, duration.
      Generates keyframe stills via FLUX.2-dev with multi-reference compositing from the character bank.
      Coverage rule: every scene gets at least one WIDE before any close-up. Gemma 4 runs visual QC with mask-based retry on failures.
    </div>
    <div class="stage-meta">
      <span class="stage-tag model">Qwen + Flux + Gemma 4</span>
      <span class="stage-tag output">output/storyboard/</span>
      <span class="stage-tag gate">Wide-shot coverage + QC</span>
    </div>
    <div class="code-block">
      <span class="cmd">python3 scripts/generate_storyboard.py</span><br>
      <span class="cmd">python3 scripts/generate_storyboard_keyframes.py --skip-existing</span>
    </div>
  </div>

  <!-- Stage 5a -->
  <div class="stage-card s-gpu">
    <div class="stage-header">
      <div class="stage-num gpu">5a</div>
      <div>
        <div class="stage-agent">Cinematic Video Agent</div>
        <div class="stage-name">Cinematic Videos</div>
      </div>
    </div>
    <div class="stage-body">
      Animates every STORY and HYBRID shot from its keyframe using LTX/WAN-class video models.
      Motion continues from the previous shot's implied end state. One speaking character per shot.
      Stage 5a audio is lip-sync reference only — final voice comes from Stage 6.
    </div>
    <div class="stage-meta">
      <span class="stage-tag model">LTX / WAN 2.2</span>
      <span class="stage-tag output">output/cinematic_videos/</span>
      <span class="stage-tag gate">Motion continuity check</span>
    </div>
    <div class="code-block">
      <span class="cmd">python3 scripts/generate_cinematic_videos.py --skip-existing</span>
    </div>
  </div>

  <!-- Stage 5b -->
  <div class="stage-card s-gpu">
    <div class="stage-header">
      <div class="stage-num gpu">5b</div>
      <div>
        <div class="stage-agent">Math Insert Agent</div>
        <div class="stage-name">Manim Visualizations</div>
      </div>
    </div>
    <div class="stage-body">
      One Manim animation per math topic — visualizing only the <code style="font-size:12px">core_visual_idea</code> locked at Stage 1.
      Qwen writes Manim code → render → Gemma 4 reviews visuals and code → fix loop until pass.
      Hard rule: if scope creeps here, it's a Stage 1 problem, not a Manim problem.
    </div>
    <div class="stage-meta">
      <span class="stage-tag model">Qwen + Manim + Gemma 4</span>
      <span class="stage-tag output">output/manim_videos/</span>
      <span class="stage-tag gate">Visual + code review loop</span>
    </div>
    <div class="code-block">
      <span class="cmd">python3 scripts/generate_manim_videos.py --skip-existing</span>
    </div>
  </div>

  <!-- Stage 6 -->
  <div class="stage-card s-audio">
    <div class="stage-header">
      <div class="stage-num audio">6</div>
      <div>
        <div class="stage-agent">Audio Agent</div>
        <div class="stage-name">Voice, SFX, Score &amp; Dubbing</div>
      </div>
    </div>
    <div class="stage-body">
      Four sub-steps: (1) timing pass — reconcile dialogue duration across screenplay, storyboard, and video;
      (2) voice performance — one voice clone per character, reused across the series;
      (3) sound design and score — ambience beds, foley, recurring sonic motif;
      (4) multilingual dubbing — Gemma 4 localizes dialogue while preserving voice identity per language.
    </div>
    <div class="stage-meta">
      <span class="stage-tag model">TTS + Gemma 4</span>
      <span class="stage-tag output">output/audio/</span>
      <span class="stage-tag gate">Dialogue fits shot duration</span>
    </div>
    <div class="code-block">
      <span class="cmd">python3 scripts/generate_audio.py</span>
    </div>
  </div>

  <!-- Stage 7 -->
  <div class="stage-card s-edit">
    <div class="stage-header">
      <div class="stage-num edit">7</div>
      <div>
        <div class="stage-agent">Editor Agent</div>
        <div class="stage-name">Final Cut Assembly</div>
      </div>
    </div>
    <div class="stage-body">
      Concatenates all shots in storyboard order. Applies the shared LUT from the series bible.
      Match-cuts Manim inserts via planned push-in/pull-back HYBRID shots.
      Muxes locked voice, SFX bed, and score. Repeats per language. Writes an EDL for manual tweaks without re-generation.
    </div>
    <div class="stage-meta">
      <span class="stage-tag model">ffmpeg</span>
      <span class="stage-tag output">output/final_cut/</span>
      <span class="stage-tag gate">End-to-end intent review</span>
    </div>
    <div class="code-block">
      <span class="cmd">python3 scripts/assemble_final_cut.py --chapter-slug complex_numbers</span>
    </div>
  </div>
</div>

<!-- MODEL ROUTING -->
<div class="section">
  <div class="section-eyebrow">Infrastructure</div>
  <div class="section-title">Model <em>Routing</em></div>
  <p class="section-lead">Qwen plans and judges. Gemma looks at pixels. GPU generation runs last. The rule keeps expensive compute off bad upstream text.</p>

  <div class="card" style="padding:0;overflow:hidden">
    <table class="model-table">
      <thead>
        <tr>
          <th>Task</th>
          <th>Model</th>
          <th>When</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Orchestration, math bible, screenplay, storyboard, Manim code, audio planning</td>
          <td>Qwen 3.5 via vLLM</td>
          <td>Stages 0–4, 5b code gen, 6 planning</td>
        </tr>
        <tr>
          <td>Keyframe QC, Manim visual review, dubbing / localization</td>
          <td>Gemma 4</td>
          <td>Stages 4b, 5b review, 6.4 dub</td>
        </tr>
        <tr>
          <td>Keyframe stills (multi-reference)</td>
          <td>FLUX.2-dev</td>
          <td>Stage 4b</td>
        </tr>
        <tr>
          <td>Cinematic video animation</td>
          <td>LTX / WAN 2.2</td>
          <td>Stage 5a</td>
        </tr>
        <tr>
          <td>Math visualization render</td>
          <td>Manim</td>
          <td>Stage 5b</td>
        </tr>
        <tr>
          <td>Voice / TTS performance</td>
          <td>Voice clone model</td>
          <td>Stage 6.2</td>
        </tr>
        <tr>
          <td>Final assembly</td>
          <td>ffmpeg</td>
          <td>Stage 7</td>
        </tr>
      </tbody>
    </table>
  </div>

  <div class="spacer"></div>

  <div class="goal-box">
    <h3>⚡ Running the Full Pipeline</h3>
    <p style="margin-bottom:16px">Start Qwen vLLM once, set environment variables, then orchestrate:</p>
    <div class="code-block" style="margin-top:0">
      <span class="comment"># Preview all stages and I/O paths</span><br>
      <span class="cmd">python3 scripts/run_pipeline.py --dry-run</span><br><br>
      <span class="comment"># Text stages (1 → 4)</span><br>
      <span class="cmd">python3 scripts/run_pipeline.py --from-stage 1 --to-stage 4</span><br><br>
      <span class="comment"># GPU pixel stages + audio + assembly</span><br>
      <span class="cmd">python3 scripts/generate_storyboard_keyframes.py --skip-existing</span><br>
      <span class="cmd">python3 scripts/generate_cinematic_videos.py --skip-existing</span><br>
      <span class="cmd">python3 scripts/generate_manim_videos.py --skip-existing</span><br>
      <span class="cmd">python3 scripts/generate_audio.py</span><br>
      <span class="cmd">python3 scripts/assemble_final_cut.py --chapter-slug complex_numbers</span>
    </div>
  </div>
</div>

<!-- GATES -->
<div class="section">
  <div class="section-eyebrow">Quality Control</div>
  <div class="section-title">Gates Between <em>Every Stage</em></div>
  <p class="section-lead">
    The pipeline doesn't blindly chain LLM outputs. Each stage has a gate — automated review, manual sign-off, or both —
    before the next stage is allowed to run.
  </p>

  <div class="grid-2">
    <div class="insight blue" style="border-left-width:3px">
      <div class="insight-icon">🔬</div>
      <div class="insight-title">Automated text gates</div>
      <div class="insight-body">Stage 1 re-verifies every equation with a second Qwen call. Stage 2 checks topic coverage and dialogue WPM plausibility. Failed items get targeted fixes, not full regeneration.</div>
    </div>
    <div class="insight green" style="border-left-width:3px">
      <div class="insight-icon">👁</div>
      <div class="insight-title">Visual QC gates</div>
      <div class="insight-body">Gemma 4 reviews keyframe stills and Manim renders. Mask-based inpaint retry fixes localized failures (face, wardrobe) without regenerating the entire frame.</div>
    </div>
    <div class="insight orange" style="border-left-width:3px">
      <div class="insight-icon">✋</div>
      <div class="insight-title">Manual gates</div>
      <div class="insight-body">Reference photo bank review (Stage 3), director contact-sheet per scene (Stage 4), and end-to-end intent review against the math bible (Stage 7).</div>
    </div>
    <div class="insight" style="border-left-width:3px">
      <div class="insight-icon">🚫</div>
      <div class="insight-title">Hard blocks</div>
      <div class="insight-body"><code style="font-size:11px">run_pipeline.py</code> reads gate results from <code style="font-size:11px">output/pipeline/gates/</code> and refuses to proceed on failure. Use <code style="font-size:11px">--force</code> only for development.</div>
    </div>
  </div>
</div>

<!-- CONNECTING PART 1 -->
<div class="section" style="border-bottom:none">
  <div class="section-eyebrow">The Full Picture</div>
  <div class="section-title">How Part 1 and Part 2 <em>Connect</em></div>
  <p class="section-lead">
    Part 1 measured what great educational video looks like. Part 2 is the factory that builds it.
    The DNA dimensions become concrete generation targets:
  </p>

  <div class="grid-2">
    <div class="card" style="border-left:3px solid var(--accent)">
      <div class="card-title">Part 1 → Stage 2 (Screenplay)</div>
      <p style="font-size:13px;color:var(--text-soft);line-height:1.65">Narrative DNA — sentence length, information density, curiosity-gap patterns — trains the script adapter that transforms math topics into creator-voice dialogue.</p>
    </div>
    <div class="card" style="border-left:3px solid var(--accent2)">
      <div class="card-title">Part 1 → Stage 6 (Audio)</div>
      <p style="font-size:13px;color:var(--text-soft);line-height:1.65">Vocal DNA — speech rate, pause distribution, prosody — sets TTS performance targets for each character's delivery cadence.</p>
    </div>
    <div class="card" style="border-left:3px solid var(--accent3)">
      <div class="card-title">Part 1 → Stage 4 (Storyboard)</div>
      <p style="font-size:13px;color:var(--text-soft);line-height:1.65">Visual DNA — scene duration, visual richness, shot tempo — constrains storyboard shot counts, keyframe detail level, and cut rhythm.</p>
    </div>
    <div class="card" style="border-left:3px solid var(--accent4)">
      <div class="card-title">Part 1 → Stage 7 (Final Cut)</div>
      <p style="font-size:13px;color:var(--text-soft);line-height:1.65">Structural DNA — shot budgets, scene-type sequences, video length distributions — guides the editor's assembly pattern toward creator-authentic pacing.</p>
    </div>
  </div>

  <div class="next-box">
    <h3>Part 3: First Chapter Render</h3>
    <p>
      With the pipeline architecture defined, Part 3 will walk through the first full chapter render —
      Complex Numbers — from raw textbook input to finished film, with intermediate artifacts,
      gate failures, and the lessons learned from the first end-to-end run.
    </p>
    <a href="#">Coming Soon → Part 3</a>
  </div>
</div>

</div><!-- /container -->

<div class="footer">
  <p>
    Part 2 of the Education Content Creation Series ·
    <a href="/2026/02/22/EducationVideoGenPart1.html">Part 1: Creator DNA</a> ·
    Pipeline repo: <a href="https://github.com/saisriteja/EducationContentGeneration" target="_blank">GitHub ↗</a>
  </p>
</div>

</div><!-- /.ev-post -->]]></content><author><name>K Sai Sri Teja</name></author><category term="MachineLearning" /><category term="Education" /><category term="VideoGeneration" /><summary type="html"><![CDATA[The chapter-to-movie pipeline — turning dry textbook mathematics into cinematic educational films through a 7-stage multi-agent workflow.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://s.gravatar.com/avatar/2136e716a089f4a3794f4007328c7bfb?s=800" /><media:content medium="image" url="https://s.gravatar.com/avatar/2136e716a089f4a3794f4007328c7bfb?s=800" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Part 1: Decoding Educational YouTube DNA</title><link href="https://saisriteja.github.io/2026/02/22/EducationVideoGenPart1.html" rel="alternate" type="text/html" title="Part 1: Decoding Educational YouTube DNA" /><published>2026-02-22T12:00:00+00:00</published><updated>2026-02-22T12:00:00+00:00</updated><id>https://saisriteja.github.io/2026/02/22/EducationVideoGenPart1</id><content type="html" xml:base="https://saisriteja.github.io/2026/02/22/EducationVideoGenPart1.html"><![CDATA[<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.min.js"></script>
<style>
.ev-post {
  --bg: #F9F7F7;
  --surface: #FFFFFF;
  --card: rgba(255, 255, 255, 0.88);
  --border: #DBE2EF;
  --text: #112D4E;
  --text-soft: #4a6380;
  --muted: #8fa3bb;
  --accent: #3F72AF;
  --accent2: #2c5590;
  --accent3: #6b9fd4;
  --accent4: #4a86c2;
  --accent5: #527faa;
  --yellow: #2c5590;
  color: var(--text);
  line-height: 1.7;
}

.ev-post * { box-sizing: border-box; }

.ev-post .hero {
  background: linear-gradient(135deg, #F9F7F7 0%, #DBE2EF 55%, rgba(63, 114, 175, 0.08) 100%);
  padding: 56px 40px 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.ev-post .hero::before {
  content:'';position:absolute;top:-100px;right:-100px;
  width:500px;height:500px;
  background:radial-gradient(circle,rgba(63,114,175,.12) 0%,transparent 70%);
  pointer-events:none;
}
.ev-post .hero::after {
  content:'';position:absolute;bottom:-80px;left:25%;
  width:400px;height:400px;
  background:radial-gradient(circle,rgba(219,226,239,.8) 0%,transparent 70%);
  pointer-events:none;
}
.ev-post .hero-inner { max-width:820px; position:relative; z-index:1; }
.ev-post .series-tag {
  display:inline-flex;align-items:center;gap:8px;
  background:rgba(63,114,175,.08);border:1px solid rgba(63,114,175,.22);
  color:var(--accent);border-radius:20px;padding:5px 14px;
  font-size:11px;letter-spacing:.12em;
  text-transform:uppercase;margin-bottom:24px;font-weight:600;
}
.ev-post .series-tag span { width:6px;height:6px;border-radius:50%;background:var(--accent);animation:ev-pulse 2s infinite; }
@keyframes ev-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.ev-post .hero h1 {
  font-size:clamp(30px,4.5vw,52px);font-weight:700;line-height:1.12;
  margin-bottom:20px;color:var(--text);
}
.ev-post .hero h1 em { color:var(--accent);font-style:normal; }
.ev-post .hero h1 .dna { color:var(--accent2); }
.ev-post .hero-desc {
  color:var(--text-soft);font-size:16px;max-width:680px;margin-bottom:36px;line-height:1.7;
}
.ev-post .hero-meta {
  display:flex;flex-wrap:wrap;gap:24px;align-items:center;
  font-size:12px;color:var(--muted);letter-spacing:.04em;
}
.ev-post .hero-meta a { color:var(--accent);text-decoration:none;border-bottom:1px solid rgba(63,114,175,.25); }
.ev-post .hero-meta a:hover { color:var(--accent2);border-color:var(--accent2); }

.ev-post .kpi-strip {
  display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:1px;background:var(--border);
  border-bottom:1px solid var(--border);
}
.ev-post .kpi { background:var(--surface);padding:22px 20px;text-align:center; }
.ev-post .kpi-value {
  font-size:28px;font-weight:700;
  color:var(--accent);line-height:1;margin-bottom:6px;
}
.ev-post .kpi-label { font-size:10px;color:var(--muted);letter-spacing:.08em;text-transform:uppercase; }

.ev-post .container { max-width:1100px;margin:0 auto;padding:0 32px; }
.ev-post .section { padding:60px 0;border-bottom:1px solid var(--border); }

.ev-post .section-eyebrow {
  font-size:11px;letter-spacing:.18em;
  text-transform:uppercase;color:var(--accent);margin-bottom:10px;font-weight:600;
}
.ev-post .section-title { font-size:28px;font-weight:700;line-height:1.2;margin-bottom:10px;color:var(--text); }
.ev-post .section-title em { color:var(--accent);font-style:normal; }
.ev-post .section-lead { color:var(--text-soft);font-size:15px;max-width:720px;line-height:1.7;margin-bottom:36px; }

.ev-post .goal-box {
  background:linear-gradient(135deg,rgba(219,226,239,.55),rgba(63,114,175,.06));
  border:1px solid var(--border);border-left:3px solid var(--accent);
  border-radius:14px;padding:28px 32px;margin-bottom:48px;
}
.ev-post .goal-box h3 { font-size:14px;font-weight:700;color:var(--accent);margin-bottom:12px;letter-spacing:.06em;text-transform:uppercase; }
.ev-post .goal-box p { color:var(--text-soft);font-size:15px;line-height:1.75; }
.ev-post .goal-box .dna-pills { display:flex;flex-wrap:wrap;gap:10px;margin-top:16px; }
.ev-post .pill {
  display:inline-flex;align-items:center;gap:7px;
  padding:6px 14px;border-radius:20px;font-size:12px;font-weight:600;
}
.ev-post .pill-narrative { background:rgba(63,114,175,.1);color:var(--accent);border:1px solid rgba(63,114,175,.18); }
.ev-post .pill-vocal { background:rgba(44,85,144,.08);color:var(--accent2);border:1px solid rgba(44,85,144,.16); }
.ev-post .pill-visual { background:rgba(107,159,212,.12);color:var(--accent3);border:1px solid rgba(107,159,212,.2); }
.ev-post .pill-structural { background:rgba(74,134,194,.1);color:var(--accent4);border:1px solid rgba(74,134,194,.18); }

.ev-post .card {
  background:var(--card);border:1px solid var(--border);border-radius:14px;padding:24px;
  box-shadow:0 8px 32px rgba(63,114,175,0.08);
}
.ev-post .card-title {
  font-size:11px;font-weight:700;color:var(--muted);
  text-transform:uppercase;letter-spacing:.1em;margin-bottom:20px;
}
.ev-post .chart-wrap { position:relative;width:100%; }
.ev-post .chart-wrap canvas { width:100%!important; }

.ev-post .grid-2 { display:grid;grid-template-columns:1fr 1fr;gap:20px; }
.ev-post .grid-3 { display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px; }
@media(max-width:860px) {
  .ev-post .grid-2,.ev-post .grid-3 { grid-template-columns:1fr; }
  .ev-post .container { padding:0 16px; }
  .ev-post .hero { padding:40px 20px 32px; }
}

.ev-post .dna-header {
  display:flex;align-items:flex-start;gap:18px;margin-bottom:32px;padding:20px 24px;
  background:var(--card);border:1px solid var(--border);border-radius:14px;
  box-shadow:0 8px 32px rgba(63,114,175,0.08);
}
.ev-post .dna-icon {
  width:52px;height:52px;border-radius:12px;display:flex;align-items:center;
  justify-content:center;font-size:22px;flex-shrink:0;
}
.ev-post .dna-icon-narrative { background:rgba(63,114,175,.12); }
.ev-post .dna-icon-vocal { background:rgba(44,85,144,.1); }
.ev-post .dna-icon-visual { background:rgba(107,159,212,.14); }
.ev-post .dna-icon-structural { background:rgba(74,134,194,.12); }
.ev-post .dna-label {
  font-size:10px;letter-spacing:.14em;
  text-transform:uppercase;margin-bottom:4px;font-weight:600;
}
.ev-post .dna-name { font-size:20px;font-weight:700;margin-bottom:6px;color:var(--text); }
.ev-post .dna-desc { color:var(--text-soft);font-size:13px;line-height:1.6; }

.ev-post .insight-row { display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin-top:20px; }
.ev-post .insight {
  background:var(--card);border:1px solid var(--border);border-radius:14px;
  padding:18px 20px;border-left:3px solid var(--accent2);
  box-shadow:0 4px 20px rgba(63,114,175,0.06);
}
.ev-post .insight.blue { border-left-color:var(--accent); }
.ev-post .insight.green { border-left-color:var(--accent3); }
.ev-post .insight.orange { border-left-color:var(--accent4); }
.ev-post .insight.pink { border-left-color:var(--accent5); }
.ev-post .insight.yellow { border-left-color:var(--accent2); }
.ev-post .insight-icon { font-size:20px;margin-bottom:8px; }
.ev-post .insight-title { font-size:13px;font-weight:700;margin-bottom:5px;color:var(--text); }
.ev-post .insight-body { font-size:12.5px;color:var(--text-soft);line-height:1.55; }
.ev-post .insight-body strong { color:var(--text); }

.ev-post .cluster-grid { display:grid;gap:12px;margin-top:20px; }
.ev-post .cluster-row {
  display:grid;grid-template-columns:160px 1fr 90px 90px 80px 100px;
  gap:16px;align-items:center;
  background:var(--card);border:1px solid var(--border);border-radius:10px;padding:14px 18px;
  font-size:13px;
}
.ev-post .cluster-row.header {
  background:rgba(219,226,239,.45);font-size:10px;letter-spacing:.08em;
  text-transform:uppercase;color:var(--muted);padding:10px 18px;font-weight:600;
}
@media(max-width:860px){ .ev-post .cluster-row { grid-template-columns:1fr 1fr; } .ev-post .cluster-row.header { display:none; } }
.ev-post .cluster-name { font-weight:700;font-size:13px; }

.ev-post .meter-row { display:flex;align-items:center;gap:10px;margin-bottom:9px; }
.ev-post .meter-label { font-size:12px;width:110px;flex-shrink:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text); }
.ev-post .meter-bar-wrap { flex:1;background:rgba(219,226,239,.65);border-radius:4px;height:8px;overflow:hidden; }
.ev-post .meter-bar { height:100%;border-radius:4px;transition:width 1s ease; }
.ev-post .meter-val { font-size:11px;color:var(--muted);width:48px;text-align:right;flex-shrink:0; }

.ev-post .pull-quote {
  border-left:3px solid var(--accent);padding:14px 24px;margin:28px 0;
  background:rgba(219,226,239,.35);border-radius:0 12px 12px 0;
}
.ev-post .pull-quote p { font-size:16px;font-style:italic;color:var(--text);line-height:1.65; }
.ev-post .pull-quote cite { font-size:12px;color:var(--muted);font-style:normal;display:block;margin-top:8px; }

.ev-post .tag {
  display:inline-block;background:rgba(63,114,175,.1);color:var(--accent);
  border-radius:4px;padding:1px 7px;font-size:11px;margin:2px 2px;
}
.ev-post .tag.purple { background:rgba(44,85,144,.08);color:var(--accent2); }
.ev-post .tag.green { background:rgba(107,159,212,.12);color:var(--accent3); }
.ev-post .tag.orange { background:rgba(74,134,194,.1);color:var(--accent4); }

.ev-post .next-box {
  background:linear-gradient(135deg,rgba(219,226,239,.5),rgba(63,114,175,.06));
  border:1px solid var(--border);border-radius:14px;padding:36px 40px;
  text-align:center;margin-top:60px;
}
.ev-post .next-box h3 { font-size:22px;font-weight:700;margin-bottom:12px;color:var(--text); }
.ev-post .next-box p { color:var(--text-soft);max-width:560px;margin:0 auto 24px;font-size:14px;line-height:1.7; }
.ev-post .next-box a {
  display:inline-block;background:var(--accent);color:#F9F7F7;
  font-weight:700;font-size:13px;padding:11px 28px;border-radius:10px;text-decoration:none;
  letter-spacing:.04em;
}
.ev-post .next-box a:hover { background:var(--accent2); }

.ev-post .footer {
  padding:36px;text-align:center;color:var(--muted);font-size:12px;
  border-top:1px solid var(--border);background:var(--bg);
}
.ev-post .footer a { color:var(--accent);text-decoration:none; }
.ev-post .footer a:hover { color:var(--accent2); }

.ev-post .prose { font-size:15px;line-height:1.8;color:var(--text-soft);max-width:760px; }
.ev-post .prose + .prose { margin-top:14px; }
.ev-post .prose strong { color:var(--text); }
.ev-post .prose em { color:var(--accent);font-style:normal;font-weight:600; }

.ev-post .spacer-sm { height:20px; }
.ev-post .spacer { height:32px; }
.ev-post .sep { border:none;border-top:1px solid var(--border);margin:40px 0; }
</style>

<div class="ev-post">

<!-- HERO -->
<div class="hero">
  <div class="container">
    <div class="hero-inner">
      <div class="series-tag"><span></span> Education Content Creation Series · Part 1</div>
      <h1>Decoding the <em>DNA</em> of<br>Educational <span class="dna">YouTube</span></h1>
      <p class="hero-desc">
        Before building an AI that generates production-quality educational videos, we need to understand what makes the best creators tick.
        I analyzed <strong style="color:var(--text)">53,035 scenes</strong> across <strong style="color:var(--text)">768 videos</strong> from 9 leading channels —
        extracting their Narrative, Vocal, Visual, and Structural DNA. Here's what the data reveals.
      </p>
      <div class="hero-meta">
        <span>📅 June 2026</span>
        <span>·</span>
        <span>⏱ ~10 min read</span>
        <span>·</span>
        <span>Dataset: <a href="https://huggingface.co/datasets/saisriteja/EducationContentCreation/resolve/main/scenes_dataset.json" target="_blank">scenes_dataset.json on HuggingFace ↗</a></span>
      </div>
    </div>
  </div>
</div>

<!-- KPI STRIP -->
<div class="kpi-strip">
  <div class="kpi"><div class="kpi-value">53,035</div><div class="kpi-label">Total Scenes</div></div>
  <div class="kpi"><div class="kpi-value">768</div><div class="kpi-label">Videos</div></div>
  <div class="kpi"><div class="kpi-value">9</div><div class="kpi-label">Channels</div></div>
  <div class="kpi"><div class="kpi-value">114.7h</div><div class="kpi-label">Total Content</div></div>
  <div class="kpi"><div class="kpi-value">7.78s</div><div class="kpi-label">Avg Scene Duration</div></div>
  <div class="kpi"><div class="kpi-value">75%</div><div class="kpi-label">Scenes w/ Narration</div></div>
  <div class="kpi"><div class="kpi-value">4 DNA</div><div class="kpi-label">Dimensions Analyzed</div></div>
</div>

<div class="container">

<!-- THE GOAL -->
<div class="section">
  <div class="section-eyebrow">The Mission</div>
  <div class="section-title">Why Creator <em>DNA</em>?</div>
  <p class="section-lead">
    The end goal isn't just to make educational videos — it's to generate production-quality YouTube videos <em>end-to-end</em>,
    adapting to the specific style of any creator using LoRA-style adapters learned from their existing catalog.
    But before you can learn a style, you have to measure it.
  </p>

  <div class="goal-box">
    <h3>🎯 The Four DNA Dimensions We're Extracting</h3>
    <p>
      Rather than manually designing separate heuristics for scripting, narration, storyboarding, and editing,
      the objective is to learn <strong style="color:var(--accent2)">creator-specific style adapters</strong> from existing videos so that a strong research document
      can be automatically transformed into a compelling creator-style presentation. To achieve this, we extract
      each creator's "DNA" across four dimensions:
    </p>
    <div class="dna-pills">
      <span class="pill pill-narrative">📖 Narrative DNA</span>
      <span class="pill pill-vocal">🎙️ Vocal DNA</span>
      <span class="pill pill-visual">🎨 Visual DNA</span>
      <span class="pill pill-structural">⚙️ Structural / Editing DNA</span>
    </div>
  </div>

  <!-- Channel scale chart -->
  <div class="grid-2">
    <div class="card">
      <div class="card-title">Total Shots by Channel</div>
      <div class="chart-wrap" style="height:280px"><canvas id="shotsBar"></canvas></div>
    </div>
    <div class="card">
      <div class="card-title">Total Content Hours by Channel</div>
      <div class="chart-wrap" style="height:280px"><canvas id="hoursBar"></canvas></div>
    </div>
  </div>

  <div class="insight-row">
    <div class="insight green">
      <div class="insight-icon">🏆</div>
      <div class="insight-title">Simple History dominates in volume</div>
      <div class="insight-body">14,550 shots across 99 videos — nearly <strong>27.7 hours</strong> of content. The widest format range in the dataset.</div>
    </div>
    <div class="insight blue">
      <div class="insight-icon">⚡</div>
      <div class="insight-title">OverSimplified is the most efficient</div>
      <div class="insight-body">Only 32 videos, yet <strong>6,402 shots and 10.9 hours</strong>. Averages 200 shots per video — the most shot-dense channel.</div>
    </div>
    <div class="insight orange">
      <div class="insight-icon">🎯</div>
      <div class="insight-title">Kurzgesagt: precision output</div>
      <div class="insight-body">99 videos, <strong>7,053 shots</strong>, the most consistent production cadence. Every video is structurally nearly identical.</div>
    </div>
  </div>
</div>

<!-- DNA 1: NARRATIVE -->
<div class="section">
  <div class="dna-header">
    <div class="dna-icon dna-icon-narrative">📖</div>
    <div>
      <div class="dna-label" style="color:var(--accent)">DNA Dimension 01</div>
      <div class="dna-name">Narrative DNA</div>
      <div class="dna-desc">How the creator structures information — hooks, curiosity gaps, information flow, sentence rhythm, vocabulary, storytelling patterns. This is what we learn to replicate when adapting a research script into creator-style narration.</div>
    </div>
  </div>

  <p class="prose">
    Narrative DNA is the <em>information architecture</em> of a video. It's not just what a creator says — it's the
    rhythm of when they reveal information, how they open curiosity loops, and how densely they pack ideas per sentence.
    The data exposes this through narration rate and speech length distributions.
  </p>

  <div class="spacer"></div>

  <div class="grid-2">
    <div class="card">
      <div class="card-title">% of Scenes with Narration (Speech)</div>
      <div class="chart-wrap" style="height:280px"><canvas id="speechPctBar"></canvas></div>
    </div>
    <div class="card">
      <div class="card-title">Avg Speech Length per Narrated Scene (chars)</div>
      <div class="chart-wrap" style="height:280px"><canvas id="speechLenBar"></canvas></div>
    </div>
  </div>

  <div class="spacer-sm"></div>

  <!-- Narration meter bars -->
  <div class="card" style="margin-top:0">
    <div class="card-title">Narration Rate — All Channels Ranked</div>
    <div id="speechMeters" style="padding:6px 0"></div>
  </div>

  <div class="insight-row">
    <div class="insight orange">
      <div class="insight-icon">🎤</div>
      <div class="insight-title">OverSimplified: Voice-first narrative</div>
      <div class="insight-body"><strong>87% narration rate</strong> — history storytelling demands continuous voice. The script IS the video; visuals annotate dialogue, not the reverse.</div>
    </div>
    <div class="insight blue">
      <div class="insight-icon">🤐</div>
      <div class="insight-title">CGP Grey: "Show, don't tell" outlier</div>
      <div class="insight-body">Only <strong>61% narration</strong>. Grey's narrative DNA includes deliberate silent scenes where visuals argue the point independently — a rare and learnable style signal.</div>
    </div>
    <div class="insight green">
      <div class="insight-icon">📝</div>
      <div class="insight-title">MinuteEarth: Densest sentences</div>
      <div class="insight-body"><strong>390 chars per narrated scene</strong> — nearly 3× the median. Each shot carries a full ecological argument. Long, compound, information-dense sentences are their signature.</div>
    </div>
    <div class="insight pink">
      <div class="insight-icon">⚡</div>
      <div class="insight-title">MinutePhysics &amp; CGP Grey: Punchy brevity</div>
      <div class="insight-body">Both at <strong>~107 chars/scene</strong>. Short declarative sentences, rapid pacing. Their Narrative DNA is "one idea per breath, then cut."</div>
    </div>
  </div>

  <div class="pull-quote">
    <p>"Narrative DNA is what makes a Kurzgesagt explainer <em>feel</em> different from a CGP Grey essay even when they cover the same topic. One builds tension through visual metaphor; the other spirals inward through argument. The data quantifies this."</p>
    <cite>— Series analysis note</cite>
  </div>
</div>

<!-- DNA 2: VOCAL -->
<div class="section">
  <div class="dna-header">
    <div class="dna-icon dna-icon-vocal">🎙️</div>
    <div>
      <div class="dna-label" style="color:var(--accent2)">DNA Dimension 02</div>
      <div class="dna-name">Vocal DNA</div>
      <div class="dna-desc">Delivery style — pacing, pauses, emphasis, pitch variation, prosody. Separates speaker identity from performance characteristics. This is what TTS and voice synthesis adapters need to learn.</div>
    </div>
  </div>

  <p class="prose">
    Vocal DNA sits at the intersection of what's said and <em>how</em> it's said. The dataset lets us proxy this through
    speech density per unit of scene time — a creator who fits 390 chars into a 14-second scene is speaking slowly with deliberate pauses,
    while one who fits 107 chars into a 3-second scene is at a completely different cadence.
  </p>

  <div class="spacer"></div>

  <div class="grid-2">
    <div class="card">
      <div class="card-title">Speech Density: Chars per Second of Scene (Vocal Rate Proxy)</div>
      <div class="chart-wrap" style="height:280px"><canvas id="vocalDensityBar"></canvas></div>
    </div>
    <div class="card">
      <div class="card-title">Speech Length Distribution — All Channels (Scatter)</div>
      <div class="chart-wrap" style="height:280px"><canvas id="speechScatter"></canvas></div>
    </div>
  </div>

  <div class="insight-row">
    <div class="insight blue">
      <div class="insight-icon">🐇</div>
      <div class="insight-title">MinutePhysics: Fastest vocal delivery</div>
      <div class="insight-body">At a 2.1s median scene and 107 chars of speech, the implied delivery is <strong>rapid-fire</strong>. Vocal adapter must learn to compress ideas without losing clarity.</div>
    </div>
    <div class="insight green">
      <div class="insight-icon">🐢</div>
      <div class="insight-title">MinuteEarth: Deliberate, measured delivery</div>
      <div class="insight-body">390 chars over 14.7s scenes implies a <strong>calm, documentary cadence</strong> with natural pauses between clauses — more David Attenborough than Vsauce.</div>
    </div>
    <div class="insight orange">
      <div class="insight-icon">🎭</div>
      <div class="insight-title">OverSimplified: Comedic timing signature</div>
      <div class="insight-body"><strong>87% narration, 88% SFX</strong> — the vocal delivery is structured around comedic beats, with audio punctuation (stings, sound effects) that's part of the performance, not decoration.</div>
    </div>
    <div class="insight pink">
      <div class="insight-icon">🎓</div>
      <div class="insight-title">TED-Ed: Academic register, moderate pace</div>
      <div class="insight-body">115 chars at 8.3s scenes — a clean, neutral <strong>academic lecture cadence</strong>. Deliberately accessible rather than specialized, matching their cross-curriculum audience.</div>
    </div>
  </div>
</div>

<!-- DNA 3: VISUAL -->
<div class="section">
  <div class="dna-header">
    <div class="dna-icon dna-icon-visual">🎨</div>
    <div>
      <div class="dna-label" style="color:var(--accent3)">DNA Dimension 03</div>
      <div class="dna-name">Visual DNA</div>
      <div class="dna-desc">Scene composition, shot types, animation style, color grading, transitions, visual-narration sync. This is what image generation and animation adapters must replicate per creator.</div>
    </div>
  </div>

  <p class="prose">
    Visual DNA is the most immediately recognizable layer — you can identify a Kurzgesagt video in one frame. But "style" here isn't
    just aesthetics. It's the <em>structural relationship</em> between how long scenes last, how richly they're described, and how tightly
    they sync to narration. The data gives us all three dimensions.
  </p>

  <div class="spacer"></div>

  <div class="grid-2">
    <div class="card">
      <div class="card-title">Avg Visual Description Length (chars/scene)</div>
      <div class="chart-wrap" style="height:280px"><canvas id="visualLenBar"></canvas></div>
    </div>
    <div class="card">
      <div class="card-title">Scene Duration Distribution — Full Dataset</div>
      <div class="chart-wrap" style="height:280px"><canvas id="durBucket"></canvas></div>
    </div>
  </div>

  <div class="spacer-sm"></div>

  <div class="card">
    <div class="card-title">Mean Scene Duration by Channel (Editing Tempo = Visual Rhythm)</div>
    <div class="chart-wrap" style="height:260px"><canvas id="avgDurBar"></canvas></div>
  </div>

  <div class="insight-row">
    <div class="insight green">
      <div class="insight-icon">🌿</div>
      <div class="insight-title">MinuteEarth: Richest visual scenes</div>
      <div class="insight-body">Average <strong>801 chars of visual description</strong> — layered environmental context, organism details, process annotations. Each scene is a paragraph of visual information.</div>
    </div>
    <div class="insight blue">
      <div class="insight-icon">🏃</div>
      <div class="insight-title">MinutePhysics: Visual brevity at high speed</div>
      <div class="insight-body">Only <strong>539 chars/scene</strong>, with 2.1s median cut. Their visual DNA is about <em>reduction</em> — the minimum visual to carry the maximum idea. Hand-drawn whiteboard enforces this.</div>
    </div>
    <div class="insight orange">
      <div class="insight-icon">⚙️</div>
      <div class="insight-title">Frame rate is a visual identity signal</div>
      <div class="insight-body">Kurzgesagt runs at <strong>60fps exclusively</strong>. TED-Ed, MinutePhysics, MinuteEarth all at 24fps (cinematic). Frame rate is part of the visual DNA, not just a technical spec.</div>
    </div>
    <div class="insight pink">
      <div class="insight-icon">🔗</div>
      <div class="insight-title">The richness ↔ pacing tradeoff</div>
      <div class="insight-body">Slow scenes → rich visuals. Fast scenes → sparse visuals. MinuteEarth is the clearest example: <strong>14.7s scenes, 801 chars</strong>. MinutePhysics: 2.1s, 539 chars. Generation must respect this coupling.</div>
    </div>
  </div>

  <div class="spacer-sm"></div>

  <!-- FPS table card -->
  <div class="card">
    <div class="card-title">Frame Rate by Channel — Production Technical Signature</div>
    <div style="overflow-x:auto">
      <table style="width:100%;border-collapse:collapse;font-size:13px">
        <thead>
          <tr>
            <th style="font-family:'Space Mono',monospace;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);padding:10px 14px;text-align:left;border-bottom:1px solid var(--border)">Channel</th>
            <th style="font-family:'Space Mono',monospace;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);padding:10px 14px;text-align:left;border-bottom:1px solid var(--border)">Primary FPS</th>
            <th style="font-family:'Space Mono',monospace;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);padding:10px 14px;text-align:left;border-bottom:1px solid var(--border)">Visual Style Signal</th>
          </tr>
        </thead>
        <tbody id="fpsTbody"></tbody>
      </table>
    </div>
  </div>
</div>

<!-- DNA 4: STRUCTURAL -->
<div class="section">
  <div class="dna-header">
    <div class="dna-icon dna-icon-structural">⚙️</div>
    <div>
      <div class="dna-label" style="color:var(--accent4)">DNA Dimension 04</div>
      <div class="dna-name">Structural / Editing DNA</div>
      <div class="dna-desc">The higher-level rhythm of the video — sequence of scene types, shot budgets per video, duration distributions, and how editing tempo maps to transcript structure.</div>
    </div>
  </div>

  <p class="prose">
    Structural DNA is the <em>architecture</em> of the video as a whole. Not individual scenes — but the pattern of scenes:
    how many shots does this creator use for a 10-minute video? How variable is that across their catalog? What's the
    median scene in the middle of their videos vs. the opening? This is the hardest DNA to extract, and the most valuable
    for generation — because it controls the macro-level pacing and coherence of the output.
  </p>

  <div class="spacer"></div>

  <div class="grid-2">
    <div class="card">
      <div class="card-title">Shots per Video — Min / Median / Max by Channel</div>
      <div class="chart-wrap" style="height:300px"><canvas id="shotsPerVideoBox"></canvas></div>
    </div>
    <div class="card">
      <div class="card-title">Median Video Duration (minutes) — Format Strategy</div>
      <div class="chart-wrap" style="height:300px"><canvas id="medVidDurBar"></canvas></div>
    </div>
  </div>

  <div class="spacer-sm"></div>

  <div class="card">
    <div class="card-title">Speech vs. SFX Presence — Audio Layer Structural Comparison</div>
    <div class="chart-wrap" style="height:300px"><canvas id="speechVsSfxGrouped"></canvas></div>
  </div>

  <div class="insight-row">
    <div class="insight blue">
      <div class="insight-icon">📐</div>
      <div class="insight-title">Kurzgesagt: The most learnable structure</div>
      <div class="insight-body">Std dev of <strong>30.2 shots/video</strong> — the tightest in the dataset. Their structural DNA is nearly a formula: ~70 shots, ~11 min, 79% narration. The easiest to replicate systematically.</div>
    </div>
    <div class="insight orange">
      <div class="insight-icon">🎲</div>
      <div class="insight-title">Simple History: The hardest to pin down</div>
      <div class="insight-body">Std dev of <strong>195 shots/video</strong> — from 44-shot explainers to 1,592-shot documentaries. Their structural DNA is topic-dependent; generation requires a topic-aware length model.</div>
    </div>
    <div class="insight green">
      <div class="insight-icon">🎬</div>
      <div class="insight-title">OverSimplified: Long-form with high density</div>
      <div class="insight-body">Median <strong>18.3 min videos, 200 shots each</strong>. Their structural DNA encodes sustained narrative arcs with regular comedic beat breaks — a "chapters + punchline" structure.</div>
    </div>
    <div class="insight pink">
      <div class="insight-icon">⏱️</div>
      <div class="insight-title">MinuteEarth &amp; Life Noggin: Micro-format masters</div>
      <div class="insight-body">Both median under <strong>4 min</strong>. Their structure is tight: single-idea intro → two supporting points → memorable closer. Ideal templates for short-form educational generation.</div>
    </div>
  </div>
</div>

<!-- CLUSTER ANALYSIS -->
<div class="section">
  <div class="section-eyebrow">Cross-DNA Synthesis</div>
  <div class="section-title">Five <em>Style Clusters</em> Emerge</div>
  <p class="section-lead">
    Looking across all four DNA dimensions simultaneously, the 9 channels naturally group into 5 distinct production archetypes.
    Each cluster represents a learnable style adapter target — a distinct combination of narrative register, vocal delivery, visual aesthetic, and editing structure.
  </p>

  <div class="card" style="margin-bottom:20px">
    <div class="card-title">Radar: Speech vs SFX vs Avg Shot Duration vs Visual Richness — Cluster Mapping</div>
    <div class="chart-wrap" style="height:360px"><canvas id="clusterRadar"></canvas></div>
  </div>

  <!-- Cluster rows -->
  <div class="cluster-grid">
    <div class="cluster-row header">
      <span>Cluster</span><span>Channels</span><span>Format</span><span>Pacing</span><span>Narration</span><span>Audio Layer</span>
    </div>
    <div class="cluster-row">
      <div class="cluster-name" style="color:var(--accent)">⚡ Rapid Explainer</div>
      <div style="color:var(--muted);font-size:12px">MinutePhysics · CGP Grey</div>
      <div style="font-family:'Space Mono',monospace;font-size:12px">4–8 min</div>
      <div><span class="tag">2–5s cuts</span></div>
      <div style="font-family:'Space Mono',monospace;font-size:12px">61–75%</div>
      <div style="color:var(--muted);font-size:12px">Minimal SFX</div>
    </div>
    <div class="cluster-row">
      <div class="cluster-name" style="color:var(--accent3)">🧬 Character Science</div>
      <div style="color:var(--muted);font-size:12px">Amoeba Sisters · Life Noggin</div>
      <div style="font-family:'Space Mono',monospace;font-size:12px">4–10 min</div>
      <div><span class="tag green">5–12s cuts</span></div>
      <div style="font-family:'Space Mono',monospace;font-size:12px">68–71%</div>
      <div style="color:var(--accent3);font-size:12px">High SFX</div>
    </div>
    <div class="cluster-row">
      <div class="cluster-name" style="color:var(--accent2)">✨ Premium Animation</div>
      <div style="color:var(--muted);font-size:12px">Kurzgesagt · TED-Ed</div>
      <div style="font-family:'Space Mono',monospace;font-size:12px">5–12 min</div>
      <div><span class="tag purple">6–10s cuts</span></div>
      <div style="font-family:'Space Mono',monospace;font-size:12px">74–80%</div>
      <div style="color:var(--muted);font-size:12px">Low SFX</div>
    </div>
    <div class="cluster-row">
      <div class="cluster-name" style="color:var(--accent4)">📜 History Storytelling</div>
      <div style="color:var(--muted);font-size:12px">OverSimplified · Simple History</div>
      <div style="font-family:'Space Mono',monospace;font-size:12px">10–30 min</div>
      <div><span class="tag orange">5–7s cuts</span></div>
      <div style="font-family:'Space Mono',monospace;font-size:12px">73–87%</div>
      <div style="color:var(--accent3);font-size:12px">High SFX</div>
    </div>
    <div class="cluster-row">
      <div class="cluster-name" style="color:var(--accent5)">🌍 Illustrated Nature</div>
      <div style="color:var(--muted);font-size:12px">MinuteEarth</div>
      <div style="font-family:'Space Mono',monospace;font-size:12px">3–5 min</div>
      <div><span class="tag" style="background:rgba(82,127,170,.12);color:var(--accent5)">14s cuts</span></div>
      <div style="font-family:'Space Mono',monospace;font-size:12px">75%</div>
      <div style="color:var(--accent3);font-size:12px">High SFX</div>
    </div>
  </div>
</div>

<!-- WHAT'S NEXT -->
<div class="section" style="border-bottom:none">
  <div class="section-eyebrow">What This Enables</div>
  <div class="section-title">From Analysis to <em>Generation</em></div>
  <p class="section-lead">
    This DNA analysis establishes the ground truth we'll train against. Each dimension maps directly to a generation component in the pipeline.
  </p>

  <div class="grid-3">
    <div class="card" style="border-left:3px solid var(--accent)">
      <div class="card-title">📖 Narrative → Script Adapter</div>
      <p style="font-size:13px;color:var(--muted);line-height:1.65">Sentence length, information density, and curiosity-gap patterns train the script rewriter that transforms a research document into creator-voice narration.</p>
    </div>
    <div class="card" style="border-left:3px solid var(--accent2)">
      <div class="card-title">🎙️ Vocal → TTS LoRA</div>
      <p style="font-size:13px;color:var(--muted);line-height:1.65">Speech rate proxies, pause distributions, and prosody patterns train the voice synthesis adapter that delivers narration in the creator's cadence.</p>
    </div>
    <div class="card" style="border-left:3px solid var(--accent3)">
      <div class="card-title">🎨 Visual → Image Adapter</div>
      <p style="font-size:13px;color:var(--muted);line-height:1.65">Visual description length, scene richness, shot duration, and FPS targets train the image generation pipeline for each creator's aesthetic.</p>
    </div>
  </div>
  <div class="spacer-sm"></div>
  <div class="card" style="border-left:3px solid var(--accent4)">
    <div class="card-title">⚙️ Structural → Edit Sequence Model</div>
    <p style="font-size:13px;color:var(--muted);line-height:1.65">Shot budgets, video length distributions, and scene-type sequences train the editing model that assembles generated clips into a coherent creator-style video structure.</p>
  </div>

  <div class="next-box">
    <h3>Part 2: From Textbook Chapter to Sci-Fi Film</h3>
    <p>
      With the DNA extracted, Part 2 walks through the full generation pipeline — a 7-stage workflow that
      transforms a textbook chapter into a cinematic educational film, with locked characters, Manim math inserts,
      and quality gates at every step.
    </p>
    <a href="/2026/03/15/EducationVideoGenPart2.html">Read Part 2 →</a>
  </div>
</div>

</div><!-- /container -->

<div class="footer">
  <p>
    Part 1 of the Education Content Creation Series ·
    Dataset: <a href="https://huggingface.co/datasets/saisriteja/EducationContentCreation/resolve/main/scenes_dataset.json" target="_blank">HuggingFace ↗</a> ·
    53,035 scenes · 768 videos · 9 channels · 114.7h
  </p>
</div>

</div><!-- /.ev-post -->

<script>
/* ───── DATA ───── */
const DATA = {
  amoebasisters:{label:"Amoeba Sisters",shots:5213,videos:100,avg_shot_dur:10.73,median_shot_dur:5.567,total_hours:15.54,pct_speech:67.41,pct_sounds:66.64,avg_visual_len:661.9,avg_speech_len:165.1,shots_per_video_mean:52.13,shots_per_video_median:53.5,shots_per_video_min:1,shots_per_video_max:378,video_dur_median_min:8.26},
  cgpgrey:{label:"CGP Grey",shots:3500,videos:40,avg_shot_dur:5.42,median_shot_dur:3.433,total_hours:5.27,pct_speech:60.69,pct_sounds:9.57,avg_visual_len:508.9,avg_speech_len:107.0,shots_per_video_mean:87.5,shots_per_video_median:60.5,shots_per_video_min:3,shots_per_video_max:770,video_dur_median_min:6.58},
  kurzgesagt:{label:"Kurzgesagt",shots:7053,videos:99,avg_shot_dur:10.31,median_shot_dur:6.417,total_hours:20.21,pct_speech:79.41,pct_sounds:9.78,avg_visual_len:617.6,avg_speech_len:157.4,shots_per_video_mean:71.24,shots_per_video_median:69,shots_per_video_min:8,shots_per_video_max:145,video_dur_median_min:11.45},
  lifenoggin:{label:"Life Noggin",shots:2494,videos:100,avg_shot_dur:11.39,median_shot_dur:5.433,total_hours:7.89,pct_speech:70.53,pct_sounds:72.33,avg_visual_len:729.8,avg_speech_len:209.5,shots_per_video_mean:24.94,shots_per_video_median:22,shots_per_video_min:1,shots_per_video_max:60,video_dur_median_min:4.0},
  minuteearth:{label:"MinuteEarth",shots:1793,videos:99,avg_shot_dur:14.66,median_shot_dur:9.042,total_hours:7.3,pct_speech:74.57,pct_sounds:77.52,avg_visual_len:800.6,avg_speech_len:390.3,shots_per_video_mean:18.11,shots_per_video_median:15,shots_per_video_min:2,shots_per_video_max:216,video_dur_median_min:3.89},
  minutephysics:{label:"MinutePhysics",shots:7793,videos:100,avg_shot_dur:4.67,median_shot_dur:2.127,total_hours:10.12,pct_speech:74.55,pct_sounds:77.22,avg_visual_len:539.6,avg_speech_len:107.7,shots_per_video_mean:77.93,shots_per_video_median:69.5,shots_per_video_min:1,shots_per_video_max:302,video_dur_median_min:4.93},
  oversimplified:{label:"OverSimplified",shots:6402,videos:32,avg_shot_dur:6.15,median_shot_dur:4.1185,total_hours:10.93,pct_speech:84.38,pct_sounds:88.91,avg_visual_len:634.7,avg_speech_len:135.1,shots_per_video_mean:200.06,shots_per_video_median:191.5,shots_per_video_min:62,shots_per_video_max:402,video_dur_median_min:18.28},
  simplehistory:{label:"Simple History",shots:14550,videos:99,avg_shot_dur:6.85,median_shot_dur:5.167,total_hours:27.68,pct_speech:72.55,pct_sounds:76.49,avg_visual_len:703.5,avg_speech_len:130.3,shots_per_video_mean:146.97,shots_per_video_median:93,shots_per_video_min:44,shots_per_video_max:1592,video_dur_median_min:9.94},
  teded:{label:"TED-Ed",shots:4237,videos:99,avg_shot_dur:8.27,median_shot_dur:4.755,total_hours:9.74,pct_speech:73.64,pct_sounds:13.12,avg_visual_len:562.0,avg_speech_len:115.7,shots_per_video_mean:42.8,shots_per_video_median:40,shots_per_video_min:1,shots_per_video_max:111,video_dur_median_min:5.77}
};

const KEYS = Object.keys(DATA);
const LABELS = KEYS.map(k=>DATA[k].label);
const PALETTE = ['#3F72AF','#6b9fd4','#2c5590','#4a86c2','#527faa','#1a4a78','#7aa3d4','#2e5f96','#5b8ec9'];

const CHART_DEFAULTS = {
  responsive:true, maintainAspectRatio:false,
  plugins:{
    legend:{display:false},
    tooltip:{backgroundColor:'#112D4E',titleColor:'#F9F7F7',bodyColor:'#DBE2EF',borderColor:'#3F72AF',borderWidth:1}
  },
  scales:{
    x:{ticks:{color:'#4a6380',font:{size:11}},grid:{color:'rgba(63,114,175,0.12)'}},
    y:{ticks:{color:'#4a6380',font:{size:11}},grid:{color:'rgba(63,114,175,0.08)'}}
  }
};

function barChart(id, labels, data, colors, extraOpts={}) {
  const ctx = document.getElementById(id);
  if(!ctx) return;
  return new Chart(ctx, {
    type:'bar',
    data:{labels, datasets:[{data, backgroundColor:colors||PALETTE, borderRadius:5, borderSkipped:false}]},
    options:{...CHART_DEFAULTS, ...extraOpts}
  });
}

/* 1. Shots bar */
barChart('shotsBar', LABELS, KEYS.map(k=>DATA[k].shots), PALETTE);

/* 2. Hours bar */
barChart('hoursBar', LABELS, KEYS.map(k=>+DATA[k].total_hours.toFixed(2)), PALETTE);

/* 3. Speech pct bar */
barChart('speechPctBar', LABELS, KEYS.map(k=>+DATA[k].pct_speech.toFixed(1)), PALETTE, {
  scales:{...CHART_DEFAULTS.scales, y:{...CHART_DEFAULTS.scales.y, min:50, max:92, ticks:{callback:v=>v+'%',color:'#4a6380',font:{size:11}},grid:{color:'rgba(63,114,175,0.08)'}}}
});

/* 4. Speech length bar */
barChart('speechLenBar', LABELS, KEYS.map(k=>+DATA[k].avg_speech_len.toFixed(0)), PALETTE);

/* 5. Narration meter bars */
const sortedSpeech = KEYS.map(k=>({label:DATA[k].label, val:DATA[k].pct_speech, color:PALETTE[KEYS.indexOf(k)]}))
  .sort((a,b)=>b.val-a.val);
const metersEl = document.getElementById('speechMeters');
const maxSpeech = Math.max(...sortedSpeech.map(d=>d.val));
sortedSpeech.forEach(d=>{
  const pct = (d.val/maxSpeech*100).toFixed(0);
  metersEl.innerHTML += `
    <div class="meter-row">
      <div class="meter-label">${d.label}</div>
      <div class="meter-bar-wrap"><div class="meter-bar" style="width:${pct}%;background:${d.color}"></div></div>
      <div class="meter-val">${d.val.toFixed(1)}%</div>
    </div>`;
});

/* 6. Vocal density = speech_len / avg_shot_dur */
const vocalDensity = KEYS.map(k=>+(DATA[k].avg_speech_len / DATA[k].avg_shot_dur).toFixed(1));
barChart('vocalDensityBar', LABELS, vocalDensity, PALETTE, {
  plugins:{...CHART_DEFAULTS.plugins, tooltip:{...CHART_DEFAULTS.plugins.tooltip, callbacks:{label:c=>`${c.parsed.y} chars/sec`}}}
});

/* 7. Speech scatter (avg_shot_dur vs avg_speech_len) */
{
  const ctx = document.getElementById('speechScatter');
  if(ctx) new Chart(ctx,{
    type:'scatter',
    data:{datasets:KEYS.map((k,i)=>({
      label:DATA[k].label,
      data:[{x:DATA[k].avg_shot_dur, y:DATA[k].avg_speech_len}],
      backgroundColor:PALETTE[i],pointRadius:10,pointHoverRadius:13
    }))},
    options:{
      responsive:true, maintainAspectRatio:false,
      plugins:{
        legend:{display:true, labels:{color:'#4a6380',font:{size:10},boxWidth:10,padding:10}},
        tooltip:{backgroundColor:'#112D4E',titleColor:'#F9F7F7',bodyColor:'#DBE2EF',borderColor:'#3F72AF',borderWidth:1,
          callbacks:{label:c=>`${c.dataset.label}: ${c.parsed.x}s scene, ${c.parsed.y} chars`}}
      },
      scales:{
        x:{title:{display:true,text:'Avg Scene Duration (s)',color:'#4a6380',font:{size:11}},ticks:{color:'#4a6380'},grid:{color:'rgba(63,114,175,0.12)'}},
        y:{title:{display:true,text:'Avg Speech Length (chars)',color:'#4a6380',font:{size:11}},ticks:{color:'#4a6380'},grid:{color:'rgba(63,114,175,0.08)'}}
      }
    }
  });
}

/* 8. Visual length bar */
barChart('visualLenBar', LABELS, KEYS.map(k=>+DATA[k].avg_visual_len.toFixed(0)), PALETTE);

/* 9. Duration bucket doughnut */
{
  const ctx = document.getElementById('durBucket');
  if(ctx) new Chart(ctx,{
    type:'doughnut',
    data:{
      labels:['<2s (20.3%)','2–5s (32.8%)','5–10s (26.0%)','10–20s (14.9%)','20–30s (3.6%)','30s+ (2.4%)'],
      datasets:[{data:[20.3,32.8,26.0,14.9,3.6,2.4],backgroundColor:PALETTE.slice(0,6),borderWidth:2,borderColor:'#F9F7F7'}]
    },
    options:{
      responsive:true, maintainAspectRatio:false,
      plugins:{
        legend:{position:'right',labels:{color:'#4a6380',font:{size:11},padding:12,boxWidth:12}},
        tooltip:{backgroundColor:'#112D4E',titleColor:'#F9F7F7',bodyColor:'#DBE2EF',borderColor:'#3F72AF',borderWidth:1}
      }
    }
  });
}

/* 10. Avg duration bar */
barChart('avgDurBar', LABELS, KEYS.map(k=>+DATA[k].avg_shot_dur.toFixed(2)), PALETTE);

/* 11. Shots per video min/median/max grouped bar */
{
  const ctx = document.getElementById('shotsPerVideoBox');
  if(ctx) new Chart(ctx,{
    type:'bar',
    data:{
      labels:LABELS,
      datasets:[
        {label:'Min',data:KEYS.map(k=>DATA[k].shots_per_video_min),backgroundColor:'rgba(143,163,187,0.55)',borderRadius:3,borderSkipped:false},
        {label:'Median',data:KEYS.map(k=>DATA[k].shots_per_video_median),backgroundColor:PALETTE,borderRadius:3,borderSkipped:false},
        {label:'Max (capped 500)',data:KEYS.map(k=>Math.min(DATA[k].shots_per_video_max,500)),backgroundColor:PALETTE.map(c=>c+'44'),borderRadius:3,borderSkipped:false}
      ]
    },
    options:{...CHART_DEFAULTS, plugins:{...CHART_DEFAULTS.plugins, legend:{display:true,labels:{color:'#4a6380',font:{size:11}}}}}
  });
}

/* 12. Median video duration bar */
barChart('medVidDurBar', LABELS, KEYS.map(k=>+DATA[k].video_dur_median_min.toFixed(2)), PALETTE, {
  plugins:{...CHART_DEFAULTS.plugins, tooltip:{...CHART_DEFAULTS.plugins.tooltip, callbacks:{label:c=>`${c.parsed.y} min`}}}
});

/* 13. Speech vs SFX grouped bar */
{
  const ctx = document.getElementById('speechVsSfxGrouped');
  if(ctx) new Chart(ctx,{
    type:'bar',
    data:{
      labels:LABELS,
      datasets:[
        {label:'% Scenes w/ Speech',data:KEYS.map(k=>+DATA[k].pct_speech.toFixed(1)),backgroundColor:'rgba(63,114,175,0.75)',borderRadius:4,borderSkipped:false},
        {label:'% Scenes w/ SFX/Music',data:KEYS.map(k=>+DATA[k].pct_sounds.toFixed(1)),backgroundColor:'rgba(107,159,212,0.65)',borderRadius:4,borderSkipped:false}
      ]
    },
    options:{...CHART_DEFAULTS, plugins:{...CHART_DEFAULTS.plugins, legend:{display:true,labels:{color:'#4a6380',font:{size:11}}}}}
  });
}

/* 14. Cluster radar */
{
  const ctx = document.getElementById('clusterRadar');
  if(ctx) new Chart(ctx,{
    type:'radar',
    data:{
      labels:['Narration Rate (%)','SFX Rate (%)','Scene Duration (s, inv)','Visual Richness (chars/100)','Shots/Video (norm)'],
      datasets:[
        {label:'MinutePhysics',data:[74.6,77.2,97,5.4,7.8],borderColor:'#3F72AF',backgroundColor:'rgba(63,114,175,0.12)',pointBackgroundColor:'#3F72AF',borderWidth:2},
        {label:'CGP Grey',data:[60.7,9.6,94,5.1,8.8],borderColor:'#2c5590',backgroundColor:'rgba(44,85,144,0.1)',pointBackgroundColor:'#2c5590',borderWidth:2},
        {label:'Kurzgesagt',data:[79.4,9.8,90,6.2,7.1],borderColor:'#6b9fd4',backgroundColor:'rgba(107,159,212,0.12)',pointBackgroundColor:'#6b9fd4',borderWidth:2},
        {label:'OverSimplified',data:[84.4,88.9,93,6.3,20.0],borderColor:'#4a86c2',backgroundColor:'rgba(74,134,194,0.1)',pointBackgroundColor:'#4a86c2',borderWidth:2},
        {label:'MinuteEarth',data:[74.6,77.5,68,8.0,1.8],borderColor:'#527faa',backgroundColor:'rgba(82,127,170,0.1)',pointBackgroundColor:'#527faa',borderWidth:2}
      ]
    },
    options:{
      responsive:true, maintainAspectRatio:false,
      plugins:{
        legend:{display:true,position:'top',labels:{color:'#4a6380',font:{size:11},padding:14,boxWidth:12}},
        tooltip:{backgroundColor:'#112D4E',titleColor:'#F9F7F7',bodyColor:'#DBE2EF',borderColor:'#3F72AF',borderWidth:1}
      },
      scales:{
        r:{
          ticks:{color:'#4a6380',backdropColor:'transparent',font:{size:9}},
          grid:{color:'rgba(63,114,175,0.12)'},
          pointLabels:{color:'#4a6380',font:{size:10}},
          angleLines:{color:'rgba(63,114,175,0.1)'},
          suggestedMin:0,suggestedMax:100
        }
      }
    }
  });
}

/* FPS table */
const fpsData = [
  {ch:'Amoeba Sisters',fps:'30 fps',signal:'Standard web-native animation'},
  {ch:'CGP Grey',fps:'30 / 60 fps',signal:'Mixed — newer uploads upgraded to 60fps'},
  {ch:'Kurzgesagt',fps:'60 fps ✦',signal:'Full 60fps pipeline — smoothest motion design'},
  {ch:'Life Noggin',fps:'30 fps',signal:'Mixed (some EU 25fps content)'},
  {ch:'MinuteEarth',fps:'24 fps',signal:'Cinematic film-standard — intentional aesthetic'},
  {ch:'MinutePhysics',fps:'24 fps',signal:'24fps film standard — matches hand-drawn feel'},
  {ch:'OverSimplified',fps:'30 fps',signal:'Standard web delivery'},
  {ch:'Simple History',fps:'Mixed',signal:'Widest era range — production varies by year'},
  {ch:'TED-Ed',fps:'24 fps',signal:'Fully consistent 24fps — cinematic educational tone'}
];
const tbody = document.getElementById('fpsTbody');
fpsData.forEach((r,i)=>{
  const tr = document.createElement('tr');
  tr.style.borderBottom='1px solid rgba(219,226,239,0.9)';
  tr.innerHTML = `
    <td style="padding:10px 14px;display:flex;align-items:center;gap:8px">
      <span style="width:8px;height:8px;border-radius:50%;background:${PALETTE[i]};flex-shrink:0;display:inline-block"></span>
      ${r.ch}
    </td>
    <td style="padding:10px 14px;font-family:'Space Mono',monospace;font-size:12px;color:var(--accent)">${r.fps}</td>
    <td style="padding:10px 14px;font-size:12px;color:var(--muted)">${r.signal}</td>`;
  tbody.appendChild(tr);
});
</script>]]></content><author><name>K Sai Sri Teja</name></author><category term="MachineLearning" /><category term="Education" /><category term="VideoGeneration" /><summary type="html"><![CDATA[An analysis of 53,035 scenes across 768 videos from 9 leading educational YouTube channels — extracting Narrative, Vocal, Visual, and Structural DNA.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://s.gravatar.com/avatar/2136e716a089f4a3794f4007328c7bfb?s=800" /><media:content medium="image" url="https://s.gravatar.com/avatar/2136e716a089f4a3794f4007328c7bfb?s=800" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Flow Models</title><link href="https://saisriteja.github.io/2025/08/11/FlowBasedModels.html" rel="alternate" type="text/html" title="Flow Models" /><published>2025-08-11T16:40:16+00:00</published><updated>2025-08-11T16:40:16+00:00</updated><id>https://saisriteja.github.io/2025/08/11/FlowBasedModels</id><content type="html" xml:base="https://saisriteja.github.io/2025/08/11/FlowBasedModels.html"><![CDATA[<h1 id="flow-based-generative-models">Flow-Based Generative Models:</h1>

<div style="display: flex; justify-content: space-between; align-items: center;">
    <a href="https://drive.google.com/file/d/11Rmquzpulf07s06CG1OfKqNgLrnMjR6k/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=11Rmquzpulf07s06CG1OfKqNgLrnMjR6k&amp;sz=w1000" alt="Flow Animation Left" style="max-width: 100%; height: auto; width: 450px;" />
    </a>
    <a href="https://drive.google.com/file/d/1x1nUElOeEfXv_6_Q2IulX-1HU7A54Gl8/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1x1nUElOeEfXv_6_Q2IulX-1HU7A54Gl8&amp;sz=w1000" alt="Flow Animation Right" style="max-width: 100%; height: auto; width: 450px;" />
    </a>
</div>

<!-- <div align="center">
    <a href="https://drive.google.com/file/d/1repEITw0AkNDYHVH489ikjR78YQ6QZXE/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1repEITw0AkNDYHVH489ikjR78YQ6QZXE&sz=w1000" alt="ECCV Workshop Picture" style="max-width: 100%; height: auto;">
    </a>
</div>
 -->

<p>Imagine a cloud of particles drifting through space. At first, this cloud looks like random Gaussian noise. As time flows, the cloud reshapes itself, stretching and bending, until finally it resembles the distribution of real-world data we want to generate.</p>

<p>How can we describe this transformation mathematically? The answer begins with the <strong>continuity equation</strong>.</p>

<hr />

<h2 id="the-continuity-equation-conserving-probability">The Continuity Equation: Conserving Probability</h2>

<p>Probability mass behaves like an incompressible fluid — it cannot just vanish or be created from nothing. The way it moves is governed by the <strong>continuity equation</strong>:</p>

\[\frac{\partial}{\partial t} p_t(x) + \nabla_x \cdot \big( p_t(x) \, u_t(x) \big) = 0.\]

<p>Here:</p>
<ul>
  <li>$p_t(x)$ is the probability density at time $t$,</li>
  <li>$u_t(x)$ is the <strong>velocity field</strong> describing how points at $x$ move,</li>
  <li>$\nabla_x \cdot$ is the divergence operator, capturing how mass flows in or out of a region.</li>
</ul>

<p>👉 Intuitively, this says: <em>if probability density decreases at some point $x$, it must be because the density is flowing away, carried along by the velocity field $u_t(x)$.</em></p>

<p>This law of conservation is the backbone of all flow-based models.</p>

<hr />

<h2 id="the-probability-path-watching-distributions-evolve">The Probability Path: Watching Distributions Evolve</h2>

<p>Now let’s step back. We want to morph a simple distribution (like Gaussian noise) into a complicated data distribution (like natural images). To describe this morphing, we introduce the idea of a <strong>probability path</strong>:</p>

\[\{ p_t(x) \}_{t \in [0,1]}, \quad p_0(x) = p_\text{source}(x), \; p_1(x) = p_\text{target}(x).\]

<p>This path is just a smooth sequence of probability densities indexed by time $t$.</p>

<ul>
  <li>At $t=0$, the distribution is pure noise.</li>
  <li>At $t=1$, it has become the target data distribution.</li>
  <li>For values of $t$ in between, we see the intermediate “shapes” of the distribution.</li>
</ul>

<p>Think of it as a movie of the distribution continuously warping from one form into another.</p>

<hr />

<h2 id="the-velocity-field-moving-individual-particles">The Velocity Field: Moving Individual Particles</h2>

<p>While the probability path describes how the whole distribution changes, we also want to describe how <strong>individual particles</strong> move inside this evolving cloud. That’s where the <strong>velocity field</strong> $u_t(x)$ comes in.</p>

<p>For a single particle trajectory $X_t$:</p>

\[\frac{d}{dt} X_t = u_t(X_t).\]

<p>This equation tells us that if a particle is at position $X_t$ at time $t$, its next step is determined by the velocity field at that point.</p>

<p>👉 So, the velocity field is the “microscopic rule” that, when applied to all particles, produces the macroscopic evolution of the probability distribution.</p>

<hr />

<h2 id="the-flow-a-global-transformation">The Flow: A Global Transformation</h2>

<p>If we follow each particle’s trajectory over time, we get a <strong>flow map</strong>:</p>

\[\Phi_t : x_0 \mapsto x_t,\]

<p>where $\Phi_t$ is the solution of the ODE:</p>

\[\frac{d}{dt} x_t = u_t(x_t), \quad x_0 \sim p_0.\]

<p>This map $\Phi_t$ tells us how to transport an initial sample $x_0$ (from the source distribution) into a new point $x_t$ at time $t$.</p>

<ul>
  <li>The <strong>flow of particles</strong> created by this map gives rise to</li>
  <li>The <strong>flow of probability densities</strong> $p_t(x)$ described earlier.</li>
</ul>

<p>The continuity equation ensures the two views (microscopic particles and macroscopic densities) stay perfectly in sync.</p>

<hr />

<h2 id="putting-it-all-together">Putting It All Together</h2>

<p>Here’s the full picture:</p>

<ol>
  <li>
    <p>The <strong>continuity equation</strong> guarantees probability mass is conserved:
\(\frac{\partial}{\partial t} p_t(x) = -\nabla_x \cdot \big(p_t(x) u_t(x)\big).\)</p>
  </li>
  <li>
    <p>The <strong>velocity field</strong> $u_t(x)$ determines how individual samples move:
\(\frac{d}{dt} X_t = u_t(X_t).\)</p>
  </li>
  <li>
    <p>Following these trajectories defines the <strong>flow</strong> $\Phi_t$ that maps the source distribution into the target:
\(\{X_t\}_{t \in [0,1]} \;\;\Rightarrow\;\; \{p_t(x)\}_{t \in [0,1]}.\)</p>
  </li>
</ol>

<p>In simple words:</p>
<ul>
  <li>The <strong>probability path</strong> shows how distributions change in time.</li>
  <li>The <strong>velocity field</strong> shows how points move in time.</li>
  <li>The <strong>flow</strong> is the overall transformation carrying one distribution into another.</li>
  <li>And the <strong>continuity equation</strong> is the glue that ensures consistency between them.</li>
</ul>

<hr />

<p>With this story, we’ve built the mathematical foundation for flow-based generative models: they are nothing more than learning the right velocity field $u_t(x)$ so that the flow transforms Gaussian noise into real data.</p>

<h2 id="code-part">Code Part</h2>]]></content><author><name>K Sai Sri Teja</name></author><category term="ComputerVision" /><category term="GenerativeAI" /><summary type="html"><![CDATA[A comprehensive guide to understanding flow-based generative models, from continuity equations to probability paths and velocity fields.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" /><media:content medium="image" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Pages from My IITM Chapter</title><link href="https://saisriteja.github.io/2025/06/22/IITM.html" rel="alternate" type="text/html" title="Pages from My IITM Chapter" /><published>2025-06-22T16:40:16+00:00</published><updated>2025-06-22T16:40:16+00:00</updated><id>https://saisriteja.github.io/2025/06/22/IITM</id><content type="html" xml:base="https://saisriteja.github.io/2025/06/22/IITM.html"><![CDATA[<p>This is my journey at IIT Madras.</p>

<h2 id="sri-gurubhyo-namaha">Sri Gurubhyo Namaha</h2>

<p>In 2023, when it was time to choose a professor for my MS at IIT Madras, I made the decision to work under Prof. Kaushik Mitra. It wasn’t just his deep expertise in the field of computer vision that drew me to him—it was also his spiritual depth and character. I believed that with him, I could grow not just academically, but also personally.</p>

<p>In today’s world, with the power of the internet, anyone can pick up technical knowledge. But becoming a better person—one with strong character and values—takes more than just online resources. You need to be around people who inspire you, and for me, Prof. Mitra was that person. I saw in him someone I could learn from on multiple levels.</p>

<p>The lab he leads has a strong, positive ecosystem, and I believe that’s a direct reflection of who he is as a person and a mentor. I feel genuinely fortunate to have had the opportunity to work under him, learn from him, and contribute to the lab. Whatever perks or opportunities I’ve gained after completing my MS, I owe a great deal to his guidance and support.</p>

<!-- https://drive.google.com/file/d/1K2la5Td5x1ALSHDMrkMbEaiu1UKfuXU0/view?usp=drive_link -->

<div align="center">
    <a href="https://drive.google.com/file/d/1K2la5Td5x1ALSHDMrkMbEaiu1UKfuXU0/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1K2la5Td5x1ALSHDMrkMbEaiu1UKfuXU0&amp;sz=w1000" alt="ECCV Workshop Picture 5" style="max-width: 100%; height: auto;" />
    </a>
</div>

<div align="center">
    📸 <strong>Sarvam Shree Jagannath.</strong>
</div>

<p>The initial days were tough—managing both education and a job at the same time was one of the biggest challenges I’ve ever faced. I came to IIT with a dream to build something big, and I knew it would take everything I had. Social life took a backseat; hanging out with friends or maintaining a circle just didn’t seem possible at the time.</p>

<p>But along the way, I was fortunate to meet people who became true friends. They influenced me in the best ways and reminded me that friendships are just as important as the degree you earn here. My undergraduate journey had its share of struggles, but IIT gave me a second chance to turn things around—both academically and personally. From education to friendships, this place helped fix what I thought was broken.</p>

<h2 id="the-hindi-group">The HINDI group</h2>

<p>Being a South Indian and an introvert, I never really felt the need to hang out beyond my comfort zone—especially with people from completely different backgrounds. But life had other plans, and that’s how I met Hrithik—my first friend at IIT.</p>

<p>He showed up during both the tough times and the fun ones, constantly reminding me that we’re not just here to study, but also to live a little and enjoy the journey. And honestly, the time we spent together was just lit. Late-night dinners, long walks, random deep talks about life and lab issues—those moments made this place feel like home.</p>

<p>Despite being… well, let’s just say a <em>little stupid</em>, Hrithik is one of the most honest and genuinely good people I’ve met. There’s a fine line between being crazy and being normal—and I’m pretty sure he’s got a foot on either side of that line. But that’s exactly what made it all so fun.</p>

<p>Looking back, I realize that these are the memories that really stick. You’re only in your 20s once, and this kind of chaos—you don’t get to relive it later. I’m just glad I had someone like Hrithik to share it with.</p>

<div align="center">
    <a href="https://drive.google.com/file/d/1z7DhXFNuVJZBPYfGAs6Np3tPAkNK-qD1/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1z7DhXFNuVJZBPYfGAs6Np3tPAkNK-qD1&amp;sz=w1000" alt="ECCV Workshop Picture 5" style="max-width: 100%; height: auto;" />
    </a>
</div>

<div align="center">
    📸 <strong>You never live in your 20's again.</strong>
</div>

<h2 id="i-here-by-decarle-this-manvinayak-as-a-part-of-my-family">I Here by decarle this man(Vinayak) as a part of my Family</h2>

<p>I honestly don’t care what anyone thinks—but if there’s one person who deserves credit for pushing me to finish my MS and making things fall into place, it’s this guy. It all started with a random call where he said, <em>“Let’s cook something in 3D computer vision.”</em> I was hesitant at first. But because of our shared bond over Krishna Bhakti, I said, <em>“Yes, let’s cook.”</em> That decision turned out to be one of the best I’ve ever made.</p>

<p>Since then, he’s become more than a collaborator—he’s like family. He works insanely hard, doesn’t have a big circle (just like me), and we’ve both walked similar paths—facing the same pain, sharing the same ambitions. We’ve worked on multiple projects together and published two papers. But the real win? His family has become like my own, and that connection has added a whole new layer of joy to this journey.</p>

<p>With mutual trust between our families, we even got to travel together to Milan, Italy, to present our work at ECCV. On top of that, we took two unforgettable spiritual trips—one to the North and one to the South—to seek blessings from Lord Vishnu and Lord Shiva. Those moments were nothing short of magical.</p>

<p>What’s even more inspiring is that despite being younger than me, he’s taught me so much—about responsibility, making the right choices in life, and staying grounded in both education and spirituality.</p>

<div align="center">
    <a href="https://drive.google.com/file/d/1LJ0sRFGM3-T402aEZTEH1znRQxmVza9S/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1LJ0sRFGM3-T402aEZTEH1znRQxmVza9S&amp;sz=w1000" alt="ECCV Workshop Picture 2" style="max-width: 100%; height: auto;" />
    </a>
</div>

<div align="center">
    📸 <strong>Now vinayak's family is my family too.</strong>
</div>

<h2 id="its-not-computer-vision-but-its-computational-imaging-lab">Its not Computer Vision but its Computational Imaging Lab</h2>

<p>I’ve always loved images—how they’re captured, the kind of cameras used, how to make them look beautiful, and how to fix the blur or other degradations. That’s pretty much what I did at IIT. Nothing too fancy on the outside—it sounds simple. But once you dive into the actual coding and research, you realize how tough it really is.</p>

<p>Whenever I hit roadblocks, I’d look around at my lab and the people in it. The support system here is something special. The team is humble, and that humility starts from the top—with Prof. Kaushik Mitra. His leadership creates an atmosphere where we know we’re in it together, and no matter how difficult things get, we’ll find a way through.</p>

<p>Research, especially in AI these days, isn’t easy. The tough times are many, and the good times come rarely—but they do come. And when they do, they feel earned. What really helped me push my work forward and get my papers accepted at conferences was the constant support from my labmates. I honestly couldn’t have done it without them.</p>

<div align="center">
    <a href="https://drive.google.com/file/d/1KRRqdXsPLGgc0Rll6CsCPHKwK0BkZ5QO/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1KRRqdXsPLGgc0Rll6CsCPHKwK0BkZ5QO&amp;sz=w1000" alt="ECCV Workshop Picture 3" style="max-width: 100%; height: auto;" />
    </a>
</div>

<div align="center">
    📸 <strong>Labmates and willkommen celebrations.</strong>
</div>

<h2 id="i-know-this-is-not-the-end-but-we-need-to-leave-the-heaveniitm-now">I know this is not the end, but we need to leave the heaven(IITM) now.</h2>

<p>My journey at IIT Madras began in a lab at HTIC, where Aswath and I used to constantly wonder about the future—<em>Will we make it? Will we graduate together?</em> Those questions were always floating around as we worked side by side.</p>

<p>Vinayak played a key role too—always pushing me, encouraging me to submit my MS thesis on time so that we could all graduate together. And in the end, we did it. We made it.</p>

<p>This day—the day we graduated—is easily one of the most memorable moments of my life. What made it truly special was being able to bring my parents along. Seeing them proud, smiling, and standing beside me on that day—that feeling is something I’ll carry with me forever.</p>

<p>Here’s a small gallery of those graduation memories, moments that remind me not just of academic achievement, but of friendships, teamwork, and the journey that brought us here.</p>

<div align="center">
    <a href="https://drive.google.com/file/d/1-9xZNzGRdeMgYAGug40fUuPlnT7WyNmr/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1-9xZNzGRdeMgYAGug40fUuPlnT7WyNmr&amp;sz=w1000" alt="ECCV Workshop Picture 4" style="max-width: 100%; height: auto;" />
    </a>
</div>

<div align="center">
    📸 <strong>We started from the bottom and we are here together at the end as well.</strong>
</div>

<p>Hare Krishna</p>]]></content><author><name>K Sai Sri Teja</name></author><category term="Personal" /><summary type="html"><![CDATA[This is my journey at IIT Madras.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" /><media:content medium="image" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Auto Deep Learning</title><link href="https://saisriteja.github.io/2025/01/22/AutoDL.html" rel="alternate" type="text/html" title="Auto Deep Learning" /><published>2025-01-22T16:40:16+00:00</published><updated>2025-01-22T16:40:16+00:00</updated><id>https://saisriteja.github.io/2025/01/22/AutoDL</id><content type="html" xml:base="https://saisriteja.github.io/2025/01/22/AutoDL.html"><![CDATA[<h1 id="basic-training-process">Basic Training Process</h1>

<p>Suppose the goal is to understand the types of cars present in your city by conducting a survey that gathers information such as the car’s brand and certain characteristics (e.g., color, type, size). This can be solved by building two types of deep learning models:</p>

<ul>
  <li><strong>Detection model</strong>: To detect the presence and location of cars in the images/videos.</li>
  <li><strong>Classification model</strong>: To classify the brand and other characteristics of each detected car.</li>
</ul>

<div align="center">
    <a href="https://drive.google.com/file/d/1sbiliBe5U11adskL-ZJnMf6QXZJyo1Ox/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1sbiliBe5U11adskL-ZJnMf6QXZJyo1Ox&amp;sz=w1000" alt="ECCV Workshop Picture" style="max-width: 100%; height: auto;" />
    </a>
</div>

<p>My work has primarily involved video datasets, with a focus on building detection and classification models. However, this general deep learning development pipeline can be applied across various systems beyond just videos.</p>

<p>The typical process involves the following stages:</p>

<h2 id="1-data-collection">1. Data Collection</h2>

<ul>
  <li>Gather raw video footage from different sources across the city.</li>
  <li>Since the raw video contains a mixture of useful and irrelevant footage, it is essential to carefully select relevant frames.</li>
  <li>This often requires manual effort: cherry-picking frames where cars are clearly visible and ignoring noisy or irrelevant data.</li>
</ul>

<h2 id="2-annotation">2. Annotation</h2>

<ul>
  <li>After selecting frames, the next step is <strong>manual annotation</strong>:
    <ul>
      <li>Drawing bounding boxes around cars (for detection).</li>
      <li>Labeling brand names and characteristics (for classification).</li>
    </ul>
  </li>
  <li>This step is time-consuming and crucial because model performance heavily depends on the quality of the annotations.</li>
</ul>

<h2 id="3-model-training">3. Model Training</h2>

<ul>
  <li>Train deep learning models on the annotated dataset.</li>
  <li>The training process usually involves:
    <ul>
      <li>Tuning hyperparameters,</li>
      <li>Performing multiple iterations of training and evaluation,</li>
      <li>Conducting stress testing under various conditions (e.g., different lighting, angles, occlusions) to ensure robustness.</li>
    </ul>
  </li>
</ul>

<div align="center">
    <a href="https://drive.google.com/file/d/1PtFwwzSShjZihsKYq-iBeF4HYtZ0KOXs/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1PtFwwzSShjZihsKYq-iBeF4HYtZ0KOXs&amp;sz=w1000" alt="Automation Slide" style="max-width: 100%; height: auto;" />
    </a>
</div>

<h2 id="data-cleaning-and-annotation-in-self-driving-car-datasets">Data Cleaning and Annotation in Self-Driving Car Datasets</h2>

<p>In the context of <strong>self-driving cars</strong>, not all data collected is relevant for training deep learning models. It is essential to clean the data and discard irrelevant or redundant information. Below, we outline some common scenarios and techniques for data cleaning and annotation.</p>

<h2 id="1-data-cleaning">1. Data Cleaning</h2>

<p>In a self-driving car dataset, certain situations may involve irrelevant data that should be discarded. Some examples include:</p>

<h3 id="example-scenarios">Example Scenarios</h3>

<ul>
  <li>
    <p><strong>Standing at Traffic Signals</strong>: If the car is stationary at a traffic light for an extended period, the frames captured during this time may not contain significant changes, rendering them useless for model training.</p>
  </li>
  <li>
    <p><strong>Running on Empty Streets</strong>: Similarly, when the car is running on an empty street, there may be little to no interaction with other vehicles or pedestrians. These frames could provide minimal information and should be discarded.</p>
  </li>
</ul>

<h3 id="techniques-for-data-cleaning">Techniques for Data Cleaning</h3>

<p>Several computer vision techniques can assist in cleaning the dataset by identifying and removing redundant or irrelevant frames:</p>

<ul>
  <li>
    <p><strong>Optical Flow</strong>: Optical flow can be used to track the movement between consecutive frames. If there is little to no movement between frames, it indicates minimal changes, which could be discarded. This helps in capturing only the “important” frames that contain meaningful visual changes.</p>
  </li>
  <li>
    <p><strong>Embedding Space Analysis</strong>:</p>
    <ul>
      <li><strong>Image Embeddings</strong>: Models like <strong>ResNet</strong> or <strong>CLIP</strong> can be used to create embeddings for each frame. By comparing the embeddings of consecutive frames, we can identify near-duplicate frames. If two frames are too similar in the embedding space, one of them can be discarded.</li>
      <li><strong>Text Embeddings via VQA Models</strong>: Visual Question Answering (VQA) models can be used to extract textual information from images. By using <strong>VQA models</strong> and performing a semantic comparison of text embeddings, we can identify frames with repetitive or irrelevant content based on the questions and answers extracted from the frames.</li>
    </ul>
  </li>
</ul>

<h2 id="2-annotation-1">2. Annotation</h2>

<p>Annotation is a critical step in training deep learning models for computer vision tasks, especially when working with image or video datasets. Accurate and consistent annotations are essential for model performance.</p>

<h3 id="techniques-for-annotation">Techniques for Annotation</h3>

<p>To automate or assist in the annotation process, we can use several advanced models and tools:</p>

<ul>
  <li><strong>Grounding Models for Annotation</strong>:
    <ul>
      <li><strong>GDINO</strong> and <strong>GSAM</strong> are grounding models that can automatically annotate images by associating objects or regions of interest within the image with textual descriptions or labels.</li>
    </ul>
  </li>
  <li><strong>VQA Models for Confirmation</strong>:
    <ul>
      <li>Visual Question Answering (VQA) models can be leveraged to confirm or enhance annotations. By asking the model specific questions related to the content of an image (e.g., “What objects are present?” or “Is there a car in the image?”), we can confirm or refine the accuracy of manual annotations.</li>
    </ul>
  </li>
</ul>

<div align="center">
    <a href="https://drive.google.com/file/d/1P2yZ8YPI-LWcb-Wn9J8FzWSiVAV543hr/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1P2yZ8YPI-LWcb-Wn9J8FzWSiVAV543hr&amp;sz=w1000" alt="Automation in Detail" style="max-width: 100%; height: auto;" />
    </a>
</div>

<div align="center">
    <a href="https://drive.google.com/file/d/1x_i0fvpuBxuTK21UX6GKWPOlyTgaQukM/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1x_i0fvpuBxuTK21UX6GKWPOlyTgaQukM&amp;sz=w1000" alt="Automation Pipeline" style="max-width: 100%; height: auto;" />
    </a>
</div>

<h2 id="1-data-pruning">1. Data Pruning</h2>

<p>In the realm of <strong>self-driving cars</strong>, training deep learning models on massive datasets of images and videos can be highly resource-intensive. Not only does it require significant computational power, but it also consumes large amounts of time and money. This raises an important question: <strong>Can we reduce the number of training images without compromising model performance?</strong> The answer lies in <strong>data pruning</strong>.</p>

<h3 id="what-is-data-pruning">What is Data Pruning?</h3>

<p><strong>Data pruning</strong> involves selecting a subset of the dataset that is both representative and diverse while discarding irrelevant or redundant images. The goal is to retain a dataset that captures all the key variations and nuances of the real-world environment without the unnecessary bulk. This helps <strong>optimize the training process</strong> by reducing the computational cost, speeding up training, and, in some cases, preventing overfitting.</p>

<h3 id="how-data-pruning-works">How Data Pruning Works</h3>

<p>The most common approach to pruning data is by utilizing <strong>embedding space</strong> techniques. Here’s how this can be applied in practice:</p>

<ul>
  <li>
    <p><strong>Embedding Generation</strong>: By generating embeddings of images using models such as <strong>VQA (Visual Question Answering)</strong> or traditional <strong>core vision models</strong> like <strong>ResNet</strong> or <strong>CLIP</strong>, each image or frame is mapped to a high-dimensional space. These embeddings effectively capture the essential features of each image, enabling a comparison of how similar or diverse the images are with respect to each other.</p>
  </li>
  <li>
    <p><strong>Cluster Sampling</strong>: Once the embeddings are generated, the next step is to perform clustering on these embeddings. <strong>Clustering algorithms</strong> (e.g., k-means, DBSCAN) group similar images together. By analyzing these clusters, we can select samples from only the most representative clusters, ensuring diversity while minimizing redundancy. This is crucial because self-driving cars encounter a wide variety of scenarios, from <strong>driving in urban streets</strong>, <strong>navigating intersections</strong>, to <strong>detecting pedestrians or cyclists</strong>. The diversity of these scenarios must still be captured, but redundant frames from similar situations (such as multiple frames from empty streets) can be pruned.</p>
  </li>
</ul>

<h3 id="benefits-of-data-pruning-in-self-driving-car-models">Benefits of Data Pruning in Self-Driving Car Models</h3>

<p>Data pruning in the context of self-driving car models can provide several key advantages:</p>

<ol>
  <li>
    <p><strong>Reduced Training Time</strong>: By selecting only the most relevant and diverse images from the dataset, we drastically reduce the size of the training data, which in turn speeds up the training process.</p>
  </li>
  <li>
    <p><strong>Cost Efficiency</strong>: With reduced data requirements, the computational cost associated with training decreases, which is essential for maintaining cost-effective operations.</p>
  </li>
  <li>
    <p><strong>Maintained Accuracy and Diversity</strong>: Pruning does not mean simply removing images at random; it ensures that the data selected maintains high representational accuracy. As a result, the model continues to perform well in recognizing and predicting scenarios it may encounter in real-world driving environments (e.g., recognizing cars at various angles, handling occlusions, understanding traffic signs, etc.).</p>
  </li>
  <li>
    <p><strong>Avoiding Overfitting</strong>: Using a large but redundant dataset can lead to overfitting, where the model memorizes the training data rather than generalizing to new, unseen data. Data pruning helps combat this by ensuring that the model is trained on a <strong>diverse yet compact</strong> set of images that are not too repetitive, allowing the model to generalize better.</p>
  </li>
</ol>

<p>By adopting data pruning techniques, we can create an efficient, scalable, and cost-effective training pipeline for self-driving car models, ensuring the model is both accurate and practical for deployment.</p>

<div align="center">
    <a href="https://drive.google.com/file/d/1KZQYKaBgeHLu-T4QrAnVTrb98zKkTfuK/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1KZQYKaBgeHLu-T4QrAnVTrb98zKkTfuK&amp;sz=w1000" alt="Data Pruning" style="max-width: 100%; height: auto;" />
    </a>
</div>

<h2 id="2-training-the-model">2. Training the Model</h2>

<p>Training a deep learning model for self-driving car systems follows the traditional <strong>deep learning pipeline</strong>, but with additional considerations unique to the challenges in autonomous driving. Below is an overview of the typical steps involved:</p>

<h3 id="1-data-augmentation">1. Data Augmentation</h3>

<p><strong>Data augmentation</strong> is a crucial step in improving the model’s ability to generalize. This involves artificially increasing the size of the training dataset by applying transformations to the existing data. For self-driving car models, the following augmentations are commonly used:</p>

<ul>
  <li>
    <p><strong>Motion Blur</strong>: Simulating the effect of blurred images due to fast-moving objects or shaky cameras. This helps the model learn to handle real-world conditions where blur might occur due to vehicle movement or external factors.</p>
  </li>
  <li>
    <p><strong>Night-Time Images</strong>: Adding variations to simulate driving in low-light conditions, such as night-time or poorly lit environments. This helps the model perform well under different lighting conditions.</p>
  </li>
  <li>
    <p><strong>Pixelation</strong>: Simulating lower-resolution images or pixelated frames that may be captured in real-world scenarios (e.g., due to network latency or foggy conditions). This ensures the model can still detect important objects even in degraded image quality.</p>
  </li>
  <li>
    <p><strong>Weather Conditions</strong>: Augmenting the data with images affected by different weather conditions such as rain, fog, snow, or sunlight glare. This helps the model learn how to detect objects and navigate the environment under challenging weather conditions, which is a common real-world scenario for self-driving cars.</p>
  </li>
</ul>

<h3 id="2-model-hyperparameter-tuning">2. Model Hyperparameter Tuning</h3>

<p>Once the model architecture is chosen, the next step is to tune the <strong>hyperparameters</strong>. Hyperparameter tuning is a critical process in achieving optimal performance. Common hyperparameters include:</p>

<ul>
  <li>
    <p><strong>Learning Rate</strong>: Controls the step size during optimization. A learning rate that is too high may lead to unstable training, while a rate that is too low can slow down the learning process.</p>
  </li>
  <li>
    <p><strong>Batch Size</strong>: Determines how many training examples are used in each forward/backward pass. Larger batches may speed up training but require more memory, while smaller batches may lead to better generalization.</p>
  </li>
  <li>
    <p><strong>Epochs</strong>: The number of times the entire training dataset is passed through the model. More epochs may increase accuracy but could also risk overfitting.</p>
  </li>
  <li>
    <p><strong>Regularization Parameters</strong>: Techniques such as <strong>Dropout</strong> or <strong>L2 regularization</strong> help prevent overfitting, which is especially important in self-driving car models where generalization to various environments and conditions is critical.</p>
  </li>
</ul>

<p>Hyperparameter tuning often involves techniques like <strong>grid search</strong>, <strong>random search</strong>, or more advanced methods like <strong>Bayesian optimization</strong> to find the most optimal set of hyperparameters for the given task.</p>

<h3 id="3-model-testing">3. Model Testing</h3>

<p>After training, the model is evaluated using <strong>testing</strong> and <strong>validation</strong> datasets. This step assesses the model’s performance on unseen data and ensures that it generalizes well to real-world scenarios. Testing for self-driving car models may involve:</p>

<ul>
  <li>
    <p><strong>Accuracy</strong>: Evaluating how well the model detects and classifies objects (e.g., other vehicles, pedestrians, traffic signs) in various conditions.</p>
  </li>
  <li>
    <p><strong>Performance under Edge Cases</strong>: Testing the model under challenging edge cases, such as low visibility (fog, heavy rain), high-speed driving, or complex urban environments.</p>
  </li>
  <li>
    <p><strong>Real-World Simulations</strong>: Using simulation tools (e.g., CARLA, NVIDIA DriveSim) to test the model’s decision-making abilities in virtual environments that simulate various real-world driving scenarios.</p>
  </li>
</ul>

<h3 id="4-pushing-to-server-for-production">4. Pushing to Server for Production</h3>

<p>Once the model performs well on the test set, the final step is to push it to the production server for deployment. This involves:</p>

<ul>
  <li>
    <p><strong>Deployment</strong>: The model is integrated into the self-driving car’s software stack, where it is tested in real-world environments. Continuous monitoring of the model’s performance is essential to ensure safety and accuracy. Any issues identified may lead to further iterations of training and testing.</p>
  </li>
  <li>
    <p><strong>Model Versioning</strong>: It’s important to keep track of model versions and updates to ensure that any improvements or bug fixes are properly deployed, and the vehicle is running the most up-to-date and safe model.</p>
  </li>
</ul>

<p>By following this process, self-driving car systems can be trained, tested, and deployed effectively, enabling them to handle a wide range of driving scenarios and improve over time.</p>

<div align="center">
    <a href="https://drive.google.com/file/d/1DVkwfPXO-n11eNF4se1NVo869kPMk9Rx/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1DVkwfPXO-n11eNF4se1NVo869kPMk9Rx&amp;sz=w1000" alt="Train the Model" style="max-width: 100%; height: auto;" />
    </a>
</div>

<h2 id="3-model-pruning">3. Model Pruning</h2>

<p>In real-world applications, especially in resource-constrained environments such as edge devices or embedded systems (e.g., self-driving cars, mobile devices), <strong>model size</strong> and <strong>computation power</strong> are significant constraints. To address this, <strong>model pruning</strong> is employed to reduce the complexity of the model without sacrificing much of its accuracy.</p>

<p>The goal is to <strong>shrink the model’s computational footprint</strong>, allowing it to run faster and on lower-power devices while maintaining acceptable performance.</p>

<h3 id="techniques-for-model-pruning">Techniques for Model Pruning</h3>

<p>Here are several common techniques used for model pruning and optimization:</p>

<h3 id="1-model-quantization">1. Model Quantization</h3>

<p><strong>Model quantization</strong> involves reducing the precision of the numbers used in the model (typically from 32-bit floating-point to 16-bit or even 8-bit integers). This technique has the following benefits:</p>

<ul>
  <li>
    <p><strong>Reduced Model Size</strong>: Quantizing the weights and activations decreases the model size significantly, allowing it to fit into memory-limited devices.</p>
  </li>
  <li>
    <p><strong>Faster Inference</strong>: Lower precision operations are computationally faster, leading to a speed-up in inference time, which is critical in real-time systems like self-driving cars.</p>
  </li>
  <li>
    <p><strong>Power Efficiency</strong>: Reduced computation load also leads to lower power consumption, which is crucial for devices that are battery-powered or have limited computational resources.</p>
  </li>
</ul>

<h3 id="2-model-pruning-and-sparsity">2. Model Pruning and Sparsity</h3>

<p><strong>Model pruning</strong> is the process of removing certain weights from the network that are deemed unnecessary for the model’s performance. This reduces the <strong>number of parameters</strong> in the model and leads to a more <strong>sparse network</strong>. Pruning can be done in various ways:</p>

<ul>
  <li>
    <p><strong>Weight Pruning</strong>: This involves removing weights that have little effect on the output (often weights with small values are pruned).</p>
  </li>
  <li>
    <p><strong>Neuron Pruning</strong>: Involves removing entire neurons or layers from the network that contribute little to the model’s predictions. For example, neurons that are inactive during training or have low activations can be pruned.</p>
  </li>
  <li>
    <p><strong>Structured Pruning</strong>: Rather than pruning individual weights or neurons, structured pruning removes entire filters, channels, or blocks. This can lead to significant reductions in computation and memory usage.</p>
  </li>
</ul>

<p><strong>Benefits</strong>:</p>
<ul>
  <li>
    <p><strong>Model Size Reduction</strong>: Pruning significantly reduces the model’s size, making it more deployable on devices with limited storage.</p>
  </li>
  <li>
    <p><strong>Speedup</strong>: The reduced number of parameters means fewer computations, leading to faster inference times.</p>
  </li>
  <li>
    <p><strong>Memory Efficiency</strong>: Sparse models can be stored more efficiently, using specialized data structures like <strong>sparse matrices</strong> to save memory.</p>
  </li>
</ul>

<h3 id="3-neural-network-architecture-search-nas">3. Neural Network Architecture Search (NAS)</h3>

<p><strong>Neural Architecture Search (NAS)</strong> is an automated technique used to find the most efficient model architecture for a given task. NAS searches for optimal architectures by exploring different configurations of layers, neurons, and connections, often within predefined constraints like model size or computation.</p>

<p><strong>Benefits</strong>:</p>
<ul>
  <li>
    <p><strong>Optimized Model Architecture</strong>: NAS helps discover more efficient architectures that require fewer resources while maintaining or improving performance.</p>
  </li>
  <li>
    <p><strong>Automated Search</strong>: It automates the design of models, making it easier to find architectures that perform well under computational constraints.</p>
  </li>
</ul>

<h3 id="4-model-distillation">4. Model Distillation</h3>

<p><strong>Model distillation</strong> involves training a smaller, more efficient model (called the “student”) to mimic the behavior of a larger, more complex model (called the “teacher”). The smaller model learns from the outputs of the larger model, effectively inheriting the knowledge of the teacher while being much lighter.</p>

<p><strong>Benefits</strong>:</p>
<ul>
  <li>
    <p><strong>Smaller Models</strong>: The student model is typically much smaller than the teacher model, making it suitable for deployment on resource-constrained devices.</p>
  </li>
  <li>
    <p><strong>Retaining Accuracy</strong>: Distillation can often lead to a smaller model that retains much of the accuracy of the larger model, making it a highly effective technique for model compression.</p>
  </li>
  <li>
    <p><strong>Faster Inference</strong>: The distilled model is designed to be efficient, thus speeding up inference, which is especially useful in real-time systems like autonomous driving.</p>
  </li>
</ul>

<h3 id="combining-techniques">Combining Techniques</h3>

<p>These pruning techniques can be combined to achieve further optimization:</p>
<ul>
  <li>
    <p><strong>Pruning + Quantization</strong>: After pruning, quantization can further reduce the size and improve the performance of the model.</p>
  </li>
  <li>
    <p><strong>Distillation + Pruning</strong>: A smaller distilled model can be further pruned for even more efficiency.</p>
  </li>
</ul>

<h3 id="conclusion">Conclusion</h3>

<p>For systems like <strong>self-driving cars</strong>, where real-time inference is critical, <strong>model pruning</strong> and optimization techniques are necessary to ensure the model runs efficiently on embedded systems. By reducing the model size, improving speed, and lowering power consumption, pruning helps strike the right balance between accuracy and computational efficiency.</p>

<div align="center">
    <a href="https://drive.google.com/file/d/1Nm8tER5juPwnXfuK2vjfITaqXqZ_QFKm/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1Nm8tER5juPwnXfuK2vjfITaqXqZ_QFKm&amp;sz=w1000" alt="Model Pruning" style="max-width: 100%; height: auto;" />
    </a>
</div>

<h2 id="4-model-dependability">4. Model Dependability</h2>

<p><strong>Model dependability</strong> refers to the ability to trust a model’s predictions and understand when the model might fail or give unreliable results. Ensuring dependability is critical, especially in high-stakes applications like <strong>self-driving cars</strong> where safety and accuracy are paramount.</p>

<h3 id="methods-to-assess-model-dependability">Methods to Assess Model Dependability</h3>

<ol>
  <li>
    <p><strong>Grad-CAM (Gradient-weighted Class Activation Mapping)</strong></p>

    <p>Grad-CAM is a popular technique that helps understand the areas in an image that a model is focusing on when making predictions. It produces a heatmap that highlights which regions of an image contribute most to the model’s output. This can help in the following ways:</p>

    <ul>
      <li><strong>Understanding Model Attention</strong>: By visualizing which parts of an image the model is attending to, we can gain insights into its decision-making process.</li>
      <li><strong>Debugging</strong>: If the model is focusing on irrelevant or unintended parts of an image (e.g., a shadow instead of the traffic sign), we can identify potential sources of error or bias.</li>
      <li><strong>Validating Model Trustworthiness</strong>: Grad-CAM helps confirm that the model is relying on meaningful features (e.g., car headlights, road signs) rather than noise or unrelated elements.</li>
    </ul>

    <p>Grad-CAM can be particularly useful in self-driving cars where understanding what the model sees and reacts to can be the difference between safe and unsafe driving decisions.</p>
  </li>
  <li>
    <p><strong>Out-of-Distribution (OOD) Testing and Morphing Images</strong></p>

    <p>OOD testing is an essential aspect of assessing how well a model handles <strong>extreme cases</strong> or <strong>unseen scenarios</strong> that are far from the data distribution on which it was trained. Morphing images or creating synthetic data pushes the model to deal with cases that it might not have encountered during training. The following are common areas of focus during OOD testing:</p>

    <ul>
      <li><strong>Shape</strong>: Altering the shape of objects in the image (e.g., skewing or distorting cars, pedestrians, or traffic signs) to test if the model can generalize to new forms.</li>
      <li><strong>3D Pose</strong>: Modifying the 3D pose of objects (e.g., rotating cars or pedestrians) to ensure the model can correctly interpret objects in various orientations.</li>
      <li><strong>Texture</strong>: Changing the texture of objects (e.g., altering the texture of road surfaces or vehicles) to check if the model can still recognize objects under different visual conditions.</li>
      <li><strong>Context</strong>: Testing how well the model performs when the <strong>context</strong> around the object changes (e.g., a car appearing in an unusual background like a foggy environment or a snowy landscape).</li>
      <li><strong>Weather</strong>: Creating scenarios with different weather conditions (e.g., rain, snow, fog) to determine how environmental factors affect the model’s performance. For instance, self-driving cars need to understand traffic signals even in poor visibility conditions.</li>
      <li><strong>Occlusion</strong>: Simulating occlusion (e.g., parts of an object being hidden by another object, like a pedestrian behind a car or a traffic sign partially blocked by a tree) to see how the model handles partial information and still makes correct predictions.</li>
    </ul>

    <p>OOD testing allows us to better understand where and how the model might fail, ensuring robustness and reliability in real-world scenarios, especially when the system encounters unexpected or extreme situations.</p>
  </li>
</ol>

<h3 id="why-is-model-dependability-important">Why is Model Dependability Important?</h3>

<p>For critical systems like <strong>autonomous driving</strong>, <strong>medical imaging</strong>, or <strong>aviation systems</strong>, it is essential that the model is dependable and can be relied upon in all situations. If the model cannot perform well under unusual conditions (e.g., rain, snow, night time), it could lead to catastrophic consequences.</p>

<p>By using techniques like Grad-CAM and OOD testing, we can improve model dependability, ensure that the model behaves as expected in diverse real-world scenarios, and minimize the risk of failures.</p>

<div align="center">
    <a href="https://drive.google.com/file/d/1fwxZU_yPNzsn_Z1YLoATJYfJUjGdrW3q/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1fwxZU_yPNzsn_Z1YLoATJYfJUjGdrW3q&amp;sz=w1000" alt="Model Explainability" style="max-width: 100%; height: auto;" />
    </a>
</div>

<!-- 
automation slide
https://drive.google.com/file/d/1PtFwwzSShjZihsKYq-iBeF4HYtZ0KOXs/view?usp=sharing

automation in details
https://drive.google.com/file/d/1P2yZ8YPI-LWcb-Wn9J8FzWSiVAV543hr/view?usp=sharing

automation pipeline
https://drive.google.com/file/d/1x_i0fvpuBxuTK21UX6GKWPOlyTgaQukM/view?usp=sharing

datapruning
https://drive.google.com/file/d/1KZQYKaBgeHLu-T4QrAnVTrb98zKkTfuK/view?usp=sharing

train the model
https://drive.google.com/file/d/1DVkwfPXO-n11eNF4se1NVo869kPMk9Rx/view?usp=sharing

model pruning
https://drive.google.com/file/d/1Nm8tER5juPwnXfuK2vjfITaqXqZ_QFKm/view?usp=sharing

model explainability
https://drive.google.com/file/d/1fwxZU_yPNzsn_Z1YLoATJYfJUjGdrW3q/view?usp=sharing

 -->]]></content><author><name>K Sai Sri Teja</name></author><category term="DeepLearning" /><summary type="html"><![CDATA[Basic Training Process]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" /><media:content medium="image" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Building Better Deep Learning Models</title><link href="https://saisriteja.github.io/2025/01/22/BuildingBetterDeepLearningModel.html" rel="alternate" type="text/html" title="Building Better Deep Learning Models" /><published>2025-01-22T16:40:16+00:00</published><updated>2025-01-22T16:40:16+00:00</updated><id>https://saisriteja.github.io/2025/01/22/BuildingBetterDeepLearningModel</id><content type="html" xml:base="https://saisriteja.github.io/2025/01/22/BuildingBetterDeepLearningModel.html"><![CDATA[<h1 id="building-deep-learning-models">Building Deep Learning Models</h1>

<p>In my previous blog, I discuss the AutoDL pipeline, which you can explore here: <a href="https://saisriteja.github.io/2025/01/22/AutoDL.html">AutoDL Blog</a>. The final module of this pipeline focuses on model dependability—helping us understand when a model performs well and when it fails. One key insight is that no matter how much you manipulate or augment poor-quality data, it will not improve the model’s output. Therefore, it’s crucial to break free from this cycle and identify where the issue lies if the model’s accuracy plateaus.</p>

<p>Deep learning models are inherently probabilistic and heavily dependent on the data they are trained on. This makes them particularly vulnerable to out-of-distribution data, posing a significant challenge both for the model and for human interpretation.</p>

<p>To overcome these challenges, improving the priors and representations within the model is essential. For instance, in self-driving cars, while RGB cameras may struggle in low-light conditions, thermal cameras can provide valuable insights by detecting heat signatures.</p>

<p>Advancements in model architectures and algorithms can help push the boundaries of performance, enabling more robust handling of edge cases and out-of-distribution scenarios. Incorporating multimodal inputs, such as text, speech, or novel sensors (e.g., thermal cameras), can further enhance model robustness by providing better priors and improving the model’s ability to handle complex, real-world applications.</p>

<div align="center">
    <a href="https://drive.google.com/file/d/1oaHXFoyBH1w4nQNuxQ1sIVaPlcgpc-yC/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1oaHXFoyBH1w4nQNuxQ1sIVaPlcgpc-yC&amp;sz=w1000" alt="Model Explainability" style="max-width: 100%; height: auto;" />
    </a>
</div>

<h1 id="overview-of-key-technologies">Overview of Key Technologies</h1>

<h2 id="multimodal-stack">MultiModal Stack</h2>

<p>In this approach, new modalities are integrated alongside existing ones, such as text, speech, or advanced cameras, to enhance model performance. The goal is to leverage complementary information from different modalities—information that may not be present in the current modality but exists in another. The model then selects the most relevant information from both sources to make a more informed decision.</p>

<h2 id="model-explainability">Model Explainability</h2>

<div align="center">
    <a href="https://drive.google.com/file/d/1w7NDzXJEU7WaM7bIlK8AIMv7365WeY6U/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1w7NDzXJEU7WaM7bIlK8AIMv7365WeY6U&amp;sz=w1000" alt="Model Explainability" style="max-width: 100%; height: auto;" />
    </a>
    <p style="text-align: center;">On the left, the person is not visible in the low-light RGB image, but is clearly seen in the thermal image. On the right, the SPAD camera captures high-resolution output without read noise due to its hardware, offering enhanced visibility even in low-light conditions, such as at night.</p>
</div>

<h3 id="computer-vision-stack">Computer Vision Stack</h3>

<ol>
  <li>
    <p><strong>Lensless Imaging</strong><br />
Lensless imaging leverages computational methods to reconstruct images without traditional optical lenses. It captures light patterns using a sensor array and processes the data using algorithms to generate high-quality 3D images.</p>
  </li>
  <li>
    <p><strong>Thermal Cameras</strong><br />
Thermal cameras detect infrared radiation emitted by objects, converting it into visible images. These cameras are especially useful in low-light conditions and for detecting temperature anomalies, commonly used in medical imaging, surveillance, and night vision.</p>
  </li>
  <li>
    <p><strong>SPAD Cameras (Single-Photon Avalanche Diode)</strong><br />
SPAD cameras are highly sensitive sensors that detect single photons, enabling ultra-low light imaging. They are used in applications such as time-of-flight (ToF) imaging, LiDAR systems, and quantum optics, providing high-resolution depth information.</p>
  </li>
  <li>
    <p><strong>Depth Cameras (LiDAR)</strong><br />
LiDAR uses laser pulses to measure distances, creating precise 3D maps of environments. It is a key technology in autonomous vehicles, robotics, and any application requiring accurate depth sensing, providing detailed environmental awareness.</p>
  </li>
</ol>

<h2 id="algorithm-stack">Algorithm Stack</h2>
<h3 id="generative-ai">Generative AI</h3>

<ol>
  <li>
    <p><strong>GANs (Generative Adversarial Networks)</strong><br />
GANs consist of two networks—a generator and a discriminator—that work in opposition. The generator creates data, while the discriminator evaluates it. This adversarial process improves the quality of generated content over time, commonly used for image synthesis and enhancement tasks.</p>
  </li>
  <li>
    <p><strong>Diffusion Models</strong><br />
Diffusion models generate data by progressively denoising random noise, reversing a process of gradual degradation. They are known for their ability to create high-quality, diverse images and are applied to tasks like image synthesis and inpainting.</p>
  </li>
  <li>
    <p><strong>Flow-Based Models</strong><br />
Flow-based models transform a simple distribution (e.g., Gaussian noise) into a complex distribution by learning invertible transformations. They are particularly suited for tasks requiring exact likelihood computation, such as density estimation and image generation.</p>
  </li>
  <li>
    <p><strong>NeRFs (Neural Radiance Fields)</strong><br />
NeRFs model 3D scenes by representing the interaction of light within the scene, enabling the generation of highly realistic 3D views from 2D images. They are commonly used in virtual reality, 3D rendering, and photorealistic scene generation.</p>
  </li>
  <li>
    <p><strong>Gaussian Splatting</strong><br />
Gaussian splatting involves representing 3D scenes or objects using points with associated Gaussian distributions. This technique provides an efficient and accurate way to synthesize 3D objects, enhancing volumetric rendering quality.</p>
  </li>
</ol>

<h3 id="image-restorationcleaning">Image Restoration/Cleaning</h3>

<ol>
  <li><strong>U-Net Architectures</strong><br />
U-Net-based architectures are widely used for image restoration and segmentation. They excel in capturing fine spatial details and contextual information. Notable U-Net variants include:
    <ul>
      <li><strong>Restormer</strong>: Optimized for image denoising and deblurring tasks, providing enhanced restoration quality.</li>
      <li><strong>UFormer</strong>: Combines U-Net with transformers to improve feature extraction and restoration accuracy, especially for high-quality image reconstruction.</li>
      <li><strong>AutoDir</strong>: An autoencoder-based U-Net variant designed to perform image restoration in an unsupervised manner.</li>
    </ul>
  </li>
</ol>

<h2 id="slides">Slides</h2>

<ul>
  <li><a href="https://docs.google.com/presentation/d/1yYPugrsdYUut1hcbN96eXrzerQguvg2CTnJaPIk_lug/edit?usp=sharing">Diffusion Slides</a></li>
  <li><a href="https://docs.google.com/presentation/d/1OKtE_RMAl_JY3t2DGcpUf0cb-tvRH6W0YzRLrIj501w/edit?usp=sharing">Gaussian Splatting Slides</a></li>
</ul>]]></content><author><name>K Sai Sri Teja</name></author><category term="DeepLearning" /><summary type="html"><![CDATA[Building Deep Learning Models]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" /><media:content medium="image" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Deep learning Stack</title><link href="https://saisriteja.github.io/2025/01/22/DeepLearningStack.html" rel="alternate" type="text/html" title="Deep learning Stack" /><published>2025-01-22T16:40:16+00:00</published><updated>2025-01-22T16:40:16+00:00</updated><id>https://saisriteja.github.io/2025/01/22/DeepLearningStack</id><content type="html" xml:base="https://saisriteja.github.io/2025/01/22/DeepLearningStack.html"><![CDATA[<h1 id="deep-learning-stack-of-blogs">Deep Learning Stack of Blogs</h1>

<p>I am documenting a series of blogs based on what I have learned throughout my journey. These blogs capture the experiments, insights, and concepts I explored. Since my primary focus is computer vision rather than large language models (LLMs), the content leans more towards vision-centric topics.</p>

<table>
  <thead>
    <tr>
      <th style="text-align: left">Blog Topic</th>
      <th style="text-align: left">Link</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left">Auto Deep Learning: Automating training and learning from model failures</td>
      <td style="text-align: left"><a href="https://saisriteja.github.io/2025/01/22/AutoDL.html">AutoDL</a></td>
    </tr>
    <tr>
      <td style="text-align: left">Building Better Deep Learning Models: Recovering and improving models after failures</td>
      <td style="text-align: left"><a href="https://saisriteja.github.io/2025/01/22/BuildingBetterDeepLearningModel.html">Building Better DL Model</a></td>
    </tr>
    <tr>
      <td style="text-align: left">Movie set as a 3D world: Pinga / HY-World 2.0 reconstruction write-up</td>
      <td style="text-align: left"><a href="https://saisriteja.github.io/MovieDigitalTwin/">Movie Digital Twin</a></td>
    </tr>
  </tbody>
</table>

<h2 id="notes">Notes</h2>

<p>The following are my personal notes and learning resources. These documents contain my study notes, insights, and references on various topics:</p>

<ul>
  <li><a href="https://drive.google.com/drive/folders/10YlEOSzj-oQif-fyhOeXsUUxotfmQr_E?usp=sharing">SMPL Blog Notes</a></li>
  <li><a href="https://docs.google.com/document/d/1jE5fnJjAcXzwhT9ebR6zj_ijTZ6dWM9Az4p20Kl84Yc/edit?usp=sharing">MultiModal Machine Learning Notes</a></li>
  <li><a href="https://docs.google.com/document/d/1qPapGRwM9RtvB85jYnQ7HJaqkBWyhYGNjHm2FKg0CFw/edit?usp=sharing">Generative AI Notes</a></li>
  <li><a href="https://docs.google.com/document/d/1qPapGRwM9RtvB85jYnQ7HJaqkBWyhYGNjHm2FKg0CFw/edit?usp=sharing">Computer Vision Core Notes</a></li>
  <li><a href="https://docs.google.com/document/d/1qPapGRwM9RtvB85jYnQ7HJaqkBWyhYGNjHm2FKg0CFw/edit?tab=t.u04i0kugcuak">3D Vision Notes</a></li>
  <li><a href="https://docs.google.com/document/d/1qPapGRwM9RtvB85jYnQ7HJaqkBWyhYGNjHm2FKg0CFw/edit?tab=t.u04i0kugcuak">2D Vision Notes</a></li>
</ul>]]></content><author><name>K Sai Sri Teja</name></author><category term="DeepLearning" /><summary type="html"><![CDATA[Deep Learning Stack of Blogs]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" /><media:content medium="image" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">ECCV 2024</title><link href="https://saisriteja.github.io/2024/08/22/ECCV2024.html" rel="alternate" type="text/html" title="ECCV 2024" /><published>2024-08-22T16:40:16+00:00</published><updated>2024-08-22T16:40:16+00:00</updated><id>https://saisriteja.github.io/2024/08/22/ECCV2024</id><content type="html" xml:base="https://saisriteja.github.io/2024/08/22/ECCV2024.html"><![CDATA[<h2 id="-eccv-2024---my-experience-in-milan">🌍 ECCV 2024 - My Experience in Milan</h2>

<p>The European Conference on Computer Vision (ECCV) is one of the most prestigious events in the field of computer vision, held annually in Europe. This year, it was hosted in the charming city of Milan, Italy 🇮🇹, and I had the incredible opportunity to be part of it!</p>

<p>In this blog, I’ll be sharing my experiences at ECCV 2024, and of course, showcasing beautiful moments captured in Italy. 📸</p>

<hr />

<h2 id="-eccv-conference-insights">🎉 <strong>ECCV Conference Insights</strong></h2>

<h2 id="️-virtual-try-on-workshop">🖥️ <strong>Virtual Try-On Workshop</strong></h2>

<p><strong>📄 Published Paper on DIVA</strong><br />
At ECCV 2024, I had the honor of presenting my paper, DIVA: Deep Indic Virtual Apparel Try-On, a project that holds deep personal and professional significance. As the world of virtual try-ons continues to evolve, the focus of our work was to tackle a niche yet crucial problem: virtual try-ons for Indic clothing.</p>

<p>The journey began with recognizing a gap in existing virtual try-on systems — most were not designed to handle the diversity and cultural richness of Indian garments. From the graceful sarees to the elaborate lehengas, these garments have unique shapes, drapes, and fabrics that present significant challenges for virtual modeling.</p>

<p>To solve this, we introduced the IndicViton Dataset: a carefully curated collection of high-resolution images (720 × 540) that showcase a variety of Indian apparel in multiple poses and orientations. This dataset plays a critical role in training models that can capture the nuances of these garments.</p>

<p>The heart of our work lies in the DIVA model — a diffusion-based framework that handles the complexities of multi-pose garment images with remarkable visual accuracy. With DIVA, we could ensure that the virtual try-ons not only look realistic but also retain the cultural authenticity of the attire.</p>

<p>At the heart of the paper is a recognition that the world of virtual try-ons must evolve to better reflect the cultural and regional diversity of clothing across the globe. By focusing on Indian fashion, our work hopes to make virtual clothing experiences more inclusive and accurate, catering to the unique needs of the Indian market and beyond.</p>

<p><strong>Key Highlights</strong>:</p>

<ul>
  <li><strong>IndicViton Dataset</strong>: A high-resolution (720 × 540) dataset featuring garments in multiple poses and orientations, helping achieve better results in virtual try-ons.</li>
  <li><strong>Diffusion-Based Model (DIVA)</strong>: A cutting-edge model that handles multi-pose garment images with high visual fidelity, ensuring accurate virtual try-on outcomes.</li>
  <li><strong>Culturally Specific Focus</strong>: Tailored to the diverse Indian apparel, including dhoti, sarees, kurtas, lehengas, and more. Usage of scribble maps as priors to achieve this.</li>
</ul>

<p><strong>Publication</strong><br />
The research was presented at <strong>ECCV 2024</strong>.<br />
👉 <a href="https://saisriteja.github.io/DIVA/">Access the paper here</a></p>

<hr />

<h3 id="-networking-with-industry-peers">🤝 <strong>Networking with Industry Peers</strong></h3>

<p>I had the opportunity to connect with professionals from <strong>Amazon</strong> and <strong>TCS</strong>, who are working on virtual try-on solutions for the Indian market. We exchanged ideas, discussed challenges, and explored the growing potential in the virtual try-on space.</p>

<hr />

<h3 id="-global-insights">🌏 <strong>Global Insights</strong></h3>

<p>I also interacted with researchers from <strong>Korea</strong> and <strong>China</strong>, learning about their innovative methods in virtual try-ons. It was incredible to get a glimpse of their approaches and gain insights into global advancements in this exciting field.</p>

<h3 id="-eccv-photos">📸 <strong>ECCV Photos</strong></h3>

<p>Check out some of my favorite moments from ECCV 2024 below!</p>

<div align="center">
    <a href="https://drive.google.com/file/d/1repEITw0AkNDYHVH489ikjR78YQ6QZXE/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1repEITw0AkNDYHVH489ikjR78YQ6QZXE&amp;sz=w1000" alt="ECCV Workshop Picture" style="max-width: 100%; height: auto;" />
    </a>
</div>

<div align="center">
    📸 **ECCV Workshop Pictures**  
</div>

<hr />

<h2 id="insights-on-academic-and-research-success">Insights on Academic and Research Success</h2>

<ol>
  <li>
    <p><strong>Focus on Quality over Quantity</strong><br />
Aim to write impactful, high-quality papers, following the example of researchers like <strong>Kaiming He</strong>, rather than producing a high volume of low-impact work.</p>
  </li>
  <li>
    <p><strong>Future-Forward Problem Statements</strong><br />
Select research problems that are ahead of their time, focusing on areas that the industry is unlikely to tackle in the next 5 years. This ensures your work remains <strong>relevant</strong> and <strong>groundbreaking</strong>.</p>
  </li>
  <li>
    <p><strong>Iterative Adaptation in Research</strong><br />
Approach research topics like developing a taste for coffee—initially challenging, but over time, you’ll adapt to a particular flavor or niche that resonates with you.</p>
  </li>
  <li>
    <p><strong>Deep Expertise in a Single Area</strong><br />
Develop deep expertise in one domain rather than spreading efforts thinly across multiple topics. <strong>Specialization</strong> often yields greater recognition and deeper contributions.</p>
  </li>
  <li>
    <p><strong>Fundamental Innovations Over Trends</strong><br />
Focus on addressing <strong>fundamental challenges</strong> rather than following hyped topics. Unique, foundational contributions often yield long-term impact and recognition.</p>
  </li>
  <li>
    <p><strong>Admission Processes</strong><br />
Understand that professors may not have complete autonomy in selecting students; initial screenings and decisions are often made at the university level based on set criteria.</p>
  </li>
  <li>
    <p><strong>Conferences as Networking Hubs</strong><br />
Attending conferences like <strong>ECCV</strong> not only helps in sharing your work but also offers opportunities to <strong>network</strong> with leading researchers, identify trending topics, and gather feedback to refine your research direction.</p>
  </li>
  <li>
    <p><strong>Industry-Academia Divide</strong><br />
Recognize that academia allows freedom to explore novel, uncharted problems, while <strong>industry research</strong> may focus on immediate applications and profitability. Use this distinction to define your <strong>academic contributions</strong>.</p>
  </li>
  <li>
    <p><strong>Patience in Research Journey</strong><br />
Breakthroughs often take time. Commit to your research journey with <strong>patience</strong>, <strong>persistence</strong>, and <strong>adaptability</strong>, as impactful results may not come immediately.</p>
  </li>
</ol>

<div align="center">
    <a href="https://drive.google.com/file/d/1p-HuvAbKQZwS-KiABASngaJ36Itp4eLw/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1p-HuvAbKQZwS-KiABASngaJ36Itp4eLw&amp;sz=w1000" alt="ECCV Workshop Picture" style="max-width: 100%; height: auto;" />
    </a>
</div>

<div align="center">  
    Prof. Michel J. Black (left) and Prof. Shree Nayar (right)  
</div>

<hr />

<h2 id="what-to-do-at-a-conference">What to Do at a Conference</h2>

<ol>
  <li>
    <p><strong>Prepare by Reviewing Papers</strong><br />
Prior to attending, obtain the list of presented papers and review their work in advance. This preparation helps you identify specific researchers or sessions of interest, allowing you to ask insightful questions in person. Avoid going in unprepared, as the abundance of information can be overwhelming and lead to quick saturation. Expect a block of papers related to <strong>3D</strong>, <strong>2D</strong>, <strong>diffusion models</strong>, <strong>federated learning</strong>, etc.</p>
  </li>
  <li>
    <p><strong>Build a Strong Network</strong><br />
Make as many connections as possible! Take photos of attendee ID cards to remember individuals and later connect with them. Engage in conversations to learn more about their research and foster potential collaborations. I had a chance to talk with academic cousins, professors, and their students.</p>
  </li>
  <li>
    <p><strong>Attend Workshops Strategically</strong><br />
Workshops often provide a condensed overview of state-of-the-art techniques and ideas within an hour. Attending these sessions allows you to absorb key advancements efficiently. Since I am more of a <strong>2D vision</strong> guy, I would be interested in <strong>3D vision</strong> and solving <strong>3D problems in 2D</strong>.</p>
  </li>
  <li>
    <p><strong>Participate in Poster Sessions</strong><br />
Poster sessions are excellent for one-on-one interactions with researchers. Use this opportunity to delve deeper into their work, discuss methodologies, and explore potential applications of their research.</p>
  </li>
  <li>
    <p><strong>Engage in Q&amp;A Sessions</strong><br />
Ask questions during presentations to clarify concepts, challenge ideas, or spark discussions. This not only helps you understand the work better but also establishes you as an engaged participant.</p>
  </li>
  <li>
    <p><strong>Take Detailed Notes</strong><br />
Keep a notebook or digital device handy to jot down key takeaways, interesting ideas, or potential future research directions. Notes will help you revisit and reflect on what you’ve learned after the conference.</p>
  </li>
  <li>
    <p><strong>Exchange Ideas</strong><br />
Share your work with peers to get feedback and suggestions. Conversations about your research can lead to new insights or even collaborations.</p>
  </li>
  <li>
    <p><strong>Follow Up Post-Conference</strong><br />
After the conference, reach out to the people you met. This follow-up helps solidify connections and keeps the conversation alive for potential collaborations or mentorship. This is where I make most of my connections—the last day is just for that! Say hello to as many people as you can.</p>
  </li>
  <li>
    <p><strong>Explore Industry Stalls</strong><br />
If the conference includes industry exhibits, visit booths to learn about the latest tools, datasets, or collaborations that could enhance your research. You can also ask people about referrals or problems they are trying to solve.</p>
  </li>
  <li>
    <p><strong>Plan Breaks and Downtime</strong><br />
Conferences can be intense, so schedule short breaks to rest and process information. Use this time to review notes, organize contacts, or prepare for upcoming sessions.</p>
  </li>
  <li>
    <p><strong>Attend Keynotes and Plenaries</strong><br />
Keynote speeches often provide a broad perspective on current trends and future directions in the field. Make it a priority to attend these sessions.</p>
  </li>
</ol>

<hr />

<h3 id="-visiting-nearby-places">🌍 <strong>Visiting Nearby Places</strong></h3>

<div align="center">
    <a href="https://drive.google.com/file/d/1a8-6INTbHdH_yR6g8Fi6JAf21XJxkPze/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1a8-6INTbHdH_yR6g8Fi6JAf21XJxkPze&amp;sz=w1000" alt="Milan" style="max-width: 100%; height: auto;" />
    </a>
</div>

<div align="center">  
    Milan
</div>

<div align="center">
    <a href="https://drive.google.com/file/d/1ZKO2bH4v0LyUh3OZBGCVvuzu1XZb6GmY/view?usp=sharing">
        <img src="https://drive.google.com/thumbnail?id=1ZKO2bH4v0LyUh3OZBGCVvuzu1XZb6GmY&amp;sz=w1000" alt="Rome" style="max-width: 100%; height: auto;" />
    </a>
</div>

<div align="center">  
    Rome
</div>]]></content><author><name>K Sai Sri Teja</name></author><category term="Personal" /><summary type="html"><![CDATA[🌍 ECCV 2024 - My Experience in Milan]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" /><media:content medium="image" url="https://saisriteja.github.io/img/postbanners/2024-08-07-convert-datetime2-bigint.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Introduction to Pybullet</title><link href="https://saisriteja.github.io/pybullet/2022/09/22/PyBulletTutorial.html" rel="alternate" type="text/html" title="Introduction to Pybullet" /><published>2022-09-22T16:40:16+00:00</published><updated>2022-09-22T16:40:16+00:00</updated><id>https://saisriteja.github.io/pybullet/2022/09/22/PyBulletTutorial</id><content type="html" xml:base="https://saisriteja.github.io/pybullet/2022/09/22/PyBulletTutorial.html"><![CDATA[<h1 id="pybullet-robots-and-cameras">Pybullet: Robots and Cameras</h1>
<p>Welcome to the tutorial on using PyBullet, the physics engine for simulating rigid body dynamics. In this blog post, we will be diving into the basics of PyBullet and how to use it to simulate physics in your own projects. Whether you’re a beginner or an experienced developer, this tutorial will provide you with the knowledge and tools you need to get started with PyBullet. So, let’s get started and learn how to create realistic physics simulations with PyBullet!</p>

<p align="center">
<img src="https://user-images.githubusercontent.com/70435083/215378837-13b4e1a8-f2db-4aff-96ff-e76ea7639b80.gif" alt="ultrasoundgif" class="center" />
</p>

<p align="center">
<a href="">UR5 robot interaction with a torid soft body.</a>
</p>

<p>In this blog, we will be utilizing a UR5 robot to demonstrate the capabilities of PyBullet. We will guide you through the process of loading the robot into the simulation and show you how to manipulate its movement. Additionally, we will also explore the use of cameras to view the robot from different angles, providing a more realistic representation of its motion</p>

<p>URDF (Unified Robot Description Format) is a file format used to describe the physical structure and kinematics of a robot. It is an XML-based format that is used to define the robot’s links, joints, and sensors. The URDF file contains information about the robot’s geometry, mass properties, joint limits, and other parameters. It is used to define the robot’s model for physics simulation and visualization.</p>

<p>URDF is widely used in robotics, it is used in popular robot simulators like Gazebo and PyBullet, as well as in many robot operating systems like ROS. URDF files can be created manually or generated from CAD models using various tools like xacro, URDF exporter from SolidWorks, Inventor, etc. The URDF file can be loaded into a robot simulator, and the robot’s model can be used for physics simulation, motion planning, and visualization.</p>

<p>PyBullet, a physics simulation engine, also provides support for simulating soft-body dynamics. Soft-bodies are objects that can bend, stretch, and deform, unlike rigid bodies that maintain a fixed shape. Examples of soft-bodies include fabrics, ropes, and other flexible materials.</p>

<p>In PyBullet, soft-bodies are represented using the Bullet Soft Body library. This library allows users to create and simulate soft-bodies using a variety of methods, including cloth, rope, and mesh simulations. The library also provides several parameters that can be used to control the behavior of the soft-body, such as stiffness, damping, and mass.</p>

<p>The user can create a soft-body using the p.createSoftBody function. This function takes several arguments such as the shape of the soft-body, its mass, and its collision shape. After creating the soft-body, the user can apply forces and torques to it, and the library will simulate its dynamics accordingly.</p>

<p>One of the main advantages of using soft-bodies in PyBullet is the ability to create realistic simulations of flexible materials such as fabrics, ropes, and other flexible materials. This can be useful in many applications such as robotics, animation, and gaming.</p>

<p align="center">
<img src="https://user-images.githubusercontent.com/70435083/215378959-46fa9d30-1bc1-4625-805b-d64a319fbf57.gif" alt="ultrasoundgif" class="center" />
</p>

<p align="center">
<a href="">Interaction with the soft body.</a>
</p>

<p align="center">
<img src="https://user-images.githubusercontent.com/70435083/215380122-689f9c61-64c1-46ee-941c-426424f31743.JPG" alt="ultrasoundgif" class="center" />
<br />
<a href="">Close view of robot interacting with the toroid.</a>
</p>

<p>python code</p>

<h2 id="install-the-dependencies-and-load-the-necessary-headers">Install the dependencies and load the necessary headers</h2>

<pre><code class="language-python">#install the dependencies and load the necessary headers
import pybullet as p
import pybullet_data
import time

#connect to the physics server
p.connect(p.DIRECT)
#allow to find the assets (URDF, obj, textures etc)
p.setAdditionalSearchPath(pd.getDataPath())

p.setGravity(0,0,-10)

#load the ground plane
planeId = p.loadURDF("plane.urdf")
</code></pre>

<h2 id="load-the-robot">Load the robot</h2>
<p>startPos is a list of 3 floating-point numbers that represent the initial position of an object in 3D space. The values in the list correspond to the x, y, and z coordinates respectively. In this case, the initial position is set to the origin (0,0,0) which is the point (x,y,z) = (0,0,0) in the 3D space.</p>

<p>startOrientation is a variable that holds the initial orientation of an object in the form of a quaternion. A quaternion is a 4D mathematical object that can be used to represent rotations in 3D space. In this case, startOrientation is set by calling the p.getQuaternionFromEuler function, which takes a list of 3 floating-point numbers representing the Euler angles (in radians) of the object’s initial orientation.
The [0,0,0] passed as the argument corresponds to the yaw, pitch and roll of the object in that order.</p>

<p>Together, startPos and startOrientation define the initial position and orientation of an object in the simulation. These values can be used to specify the initial state of an object when it is added to the simulation.</p>

<pre><code class="language-python">#place the robot at the base position
startPos = [0,0,0]
startOrientation = p.getQuaternionFromEuler([0,0,0])

#load the robot urdf file
boxId = p.loadURDF("/content/pybullet-works/notebooks/meshes/ur5.urdf",startPos, startOrientation)
</code></pre>

<h2 id="adding-camera-to-the-scence">Adding camera to the scence</h2>
<p>The variables pitch, roll, and yaw define the rotation of the camera in 3D space. pitch represents the rotation around the x-axis, roll represents the rotation around the y-axis, and yaw represents the rotation around the z-axis. In this case, the pitch is set to -10 degrees, which will make the camera look slightly downwards, the roll is set to 0, and the yaw is not defined.</p>

<p>upAxisIndex is an integer variable that represents the up axis of the camera. This variable is used to specify which axis of the camera is pointing upwards. In this case, the value is set to 2, which corresponds to the z-axis.</p>

<p>camDistance is a variable that represents the distance of the camera from the target position. In this case, the camera is 1.5 units away from the target position.</p>

<p>pixelWidth and pixelHeight define the resolution of the image captured by the camera. In this case, the image will be 640 pixels wide and 480 pixels tall.</p>

<p>nearPlane and farPlane define the near and far clipping planes of the camera, respectively. Objects closer than the near plane or farther than the far plane will not be visible in the captured image. In this case, the near plane is set to 0.01 units and the far plane is set to 100 units.</p>

<p>fov is the field of view of the camera, measured in degrees. In this case, the field of view is set to 60 degrees.</p>

<p>viewMatrix and projectionMatrix are 4x4 matrices that define the position and configuration of the camera. viewMatrix is computed using the p.computeViewMatrixFromYawPitchRoll function, which takes several arguments such as the target position, distance, yaw, pitch, roll, and up axis index of the camera. projectionMatrix is computed using the p.computeProjectionMatrixFOV function, which takes the field of view, aspect ratio, near and far clipping planes of the camera.</p>

<p>Finally, the p.getCameraImage function is used to capture an image of the simulation. This function takes several arguments such as the width, height, viewMatrix, and projectionMatrix of the camera and returns an image in the form of an array.</p>

<pre><code class="language-python">%%time
camTargetPos = [0, 0, 0]
cameraUp = [0, 0, 1]
cameraPos = [1, 1, 1]
p.setGravity(0, 0, -10)

from google.colab import widgets
import numpy as np
import random
import time
from matplotlib import pylab
grid = widgets.Grid(2, 2)
yaw = 0
for r in range(2):
  for c in range(2):
    yaw += 60
    with grid.output_to(r, c):
      grid.clear_cell()
      pylab.figure(figsize=(10, 5))
      pitch = -10.0
      roll = 0
      upAxisIndex = 2
      camDistance = 1.5
      pixelWidth = 640
      pixelHeight = 480
      nearPlane = 0.01
      farPlane = 100
      fov = 60
      viewMatrix = p.computeViewMatrixFromYawPitchRoll(camTargetPos, camDistance, yaw, pitch,
                                                                  roll, upAxisIndex)
      aspect = pixelWidth / pixelHeight
      projectionMatrix = p.computeProjectionMatrixFOV(fov, aspect, nearPlane, farPlane)
          
      img_arr = p.getCameraImage(pixelWidth,pixelHeight,viewMatrix,projectionMatrix)
      w = img_arr[0]  #width of the image, in pixels
      h = img_arr[1]  #height of the image, in pixels
      rgb = img_arr[2]  #color data RGB
      dep = img_arr[3]  #depth data
      print("w=",w,"h=",h)
      np_img_arr = np.reshape(rgb, (h, w, 4))
      np_img_arr = np_img_arr * (1. / 255.)
      pylab.imshow(np_img_arr, interpolation='none', animated=True, label="pybullet")
</code></pre>
<p align="center">
<img src="https://user-images.githubusercontent.com/70435083/215380119-15fcf56b-8aaa-429a-854c-b58bb810fab4.JPG" alt="ultrasoundgif" class="center" />
<br />
<a href="">Robot in all views.</a>
</p>

<h2 id="create-an-animated-png">Create an animated png</h2>

<pre><code class="language-python">
!pip install numpngw
from numpngw import write_apng
from IPython.display import Image


frames=[] #frames to create animated png
for r in range(60):
    yaw += 6
    pitch = -10.0
    roll = 0
    upAxisIndex = 2
    camDistance = 1.5
    pixelWidth = 320
    pixelHeight = 200
    nearPlane = 0.01
    farPlane = 100
    fov = 60
    viewMatrix = p.computeViewMatrixFromYawPitchRoll(camTargetPos, camDistance, yaw, pitch,
                                                                roll, upAxisIndex)
    aspect = pixelWidth / pixelHeight
    projectionMatrix = p.computeProjectionMatrixFOV(fov, aspect, nearPlane, farPlane)
        
    img_arr = p.getCameraImage(pixelWidth,pixelHeight,viewMatrix,projectionMatrix)
    w = img_arr[0]  #width of the image, in pixels
    h = img_arr[1]  #height of the image, in pixels
    rgb = img_arr[2]  #color data RGB
    dep = img_arr[3]  #depth data
    #print("w=",w,"h=",h)
    np_img_arr = np.reshape(rgb, (h, w, 4))
    frame = np_img_arr[:, :, :3]
    frames.append(frame)
print("creating animated png, please about 5 seconds")
%time write_apng("example6.png", frames, delay=100)
%time Image(filename="example6.png")
</code></pre>

<p align="center">
<img src="https://user-images.githubusercontent.com/70435083/215378974-9468cbe5-50e2-49a3-8a74-4031634cc8f1.gif" alt="ultrasoundgif" class="center" />
</p>

<p align="center">
<a href="">UR5 robot interaction with a torid soft body.</a>
</p>]]></content><author><name>K Sai Sri Teja</name></author><category term="Pybullet" /><category term="Robotics" /><summary type="html"><![CDATA[Pybullet tutorial, Load and View robots.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://s.gravatar.com/avatar/2136e716a089f4a3794f4007328c7bfb?s=800" /><media:content medium="image" url="https://s.gravatar.com/avatar/2136e716a089f4a3794f4007328c7bfb?s=800" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>