Repository navigation
docs(genai-video,#8056): cost: frontmatter on 5 Video 01-Foundation notebooks (c.829) - #8235
Conversation
…otebooks (c.829) Sub-genre docs-cost-matrix-tranche-video (5 notebooks, Pattern A 5/5). Tranche multi-provider video : 1 LOCAL $0.00 (moviepy/ffmpeg) + 1 OpenAI GPT-5-mini $0.10 + 3 local GPU (Qwen2.5-VL 18GB, Real-ESRGAN 4GB, AnimateDiff 12GB). VRAM diversity : 0 GB (x2) / 4 GB (x1) / 12 GB (x1) / 18 GB (x1). Pattern A canonical 5/5 (cell[0]=markdown title, cell[1]=code). L930 didactique APPLIQUE: YAML indentation stricte 2-spaces sous cost: et sous notes: |, closing --- a la colonne 0. Validation 5/5 du premier coup (regex strict + yaml.safe_load produit cost=dict correct, pas None). Sub-issue L829 reaffirmee : validator scans cell[0] only, fix = PR #8219 awaiting merge ai-01 (5/5 undetected until merge). L927 NEW : PR UNSTABLE mergeStateStatus = twin parity DRIFT pré-existant main, hors-scope sauf demande explicite ai-01. L929 saturation cleared : c.829 = 8eme PR cost-matrix po-2025 sans collision. Co-Authored-By: Claude-Code <noreply@anthropic.com>
Notebook PR Validation: PASS
Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns) |
Golden-Set Execution (H.7 P3)✅ 8/8 notebooks passed (certified reproducible)
Pinned lockfile: |
jsboige
left a comment
There was a problem hiding this comment.
[Hermes] docs(genai-video,#8056): cost frontmatter on 5 Video 01-Foundation notebooks (c.829)
Frontmatter YAML inséré via Pattern A (cell[1] markdown) sur les 5 notebooks. Additif pur (+148/-0).
Vérifications :
- Pattern A 5/5 — cellule frontmatter suit le titre cell[0], précède la 1ʳᵉ cellule code ✓
OPENAI_API_KEY/HF_TOKENmentions = références viaos.environdans les commentaires YAML (external_account field), pas de valeurs en dur ✓- Cost claims cohérentes :
api_usd_est: 0.10pour GPT-5-mini (01-2) avec API cloud,0.00pour les 4 autres (local GPU/CPU) — honnête, pas d'omission API cachée ✓ - VRAM figures : Qwen2.5-VL 7B bf16 ≈ 14-18GB ✓, Real-ESRGAN ≈ 4GB ✓, AnimateDiff SD1.5+motion ≈ 12GB ✓, moviepy=0 ✓
- YAML valide (frontmatter fermé par
---final sur les 5) ✓ - 0 CJK, 0 secret/dev-path leak dans les frontmatters ✓
Concern (mineur) : 01-2-GPT-5-Video-Understanding — l'estimation 0.10 USD pour "8 frames base64 ~10k tokens input" est plausible mais non sourcée (pas de pricing table référencée). Si le prix GPT-5-mini évolue, le frontmatter devient stale. Suggestion : ajouter un commentaire # estimate as of 2026-07, verify pricing pour traçabilité. Non bloquant.
Bonne livraison tranche c.829, conforme au schéma canonique c.800.
…ins (c.833) (#8269) Pattern A + Pattern D canonique (analogue c.826/c.829-c.832 + sub-grain novateur Pattern D) : - Pattern A : cell[0]=md titre + cell[1]=code → INSERTION cellule md frontmatter a cell[1] - Pattern D (NEW, propre a ML.Net) : cell[0]=md titre + cell[1]=md intro pedagogique → INSERTION cellule md frontmatter a cell[1] Dans les 2 cas, c0 titre preserve, c1+ contenu (code OU md) decale d'un index, byte-identique. 12 notebooks ML/ML.Net (6 lecons x 2 jumeaux Python+C#) : - ML-1 (Intro) : 2 notebooks (Pattern D x2) - ML-2 (Data&Feat) : 2 notebooks (Pattern A x2) - ML-3 (Train+AutoML) : 2 notebooks (Pattern A Python + Pattern D Python + Pattern A C#) - ML-4 (Eval) : 2 notebooks (Pattern A x2) - ML-5 (TimeSeries) : 2 notebooks (Pattern D Python + Pattern A C#) - ML-6 (ONNX) : 2 notebooks (Pattern D Python + Pattern A C#) 15-field YAML c.800 canonique, adapte par notebook : - Python notebooks : sklearn/pandas/numpy standard, cpu_min=2, repro=HIGH - C# notebooks : ML.NET standard, cpu_min=2, repro=HIGH - ML-3 C# AutoML special : sweep 4 modeles (SDCA/LBFGS/FastTree/FastForest), cpu_min=4, repro=MED, ~10 min - ML-5 TimeSeries special : STL + SARIMA(p,d,q)(P,D,Q)s, cpu_min=4, repro=MED, ~5 min - ML-6 ONNX special : skl2onnx + onnxruntime, cpu_min=2, repro=MED, GPU optionnelle pas requise Conformite stricte : - yaml.safe_load 14/14 keys cost: + 1 sibling notes: + regex delimiters + 12/12 PASS strict - nbformat.validate(strict) 12/12 PASS (0 Papermill residue sur c0 = full strict OK, L927 NOT applicable) - LF-only CR=0 (L268) sur les 12 fichiers - c.281-L1 MD047 trailing newline mandatory - L800 open('wb') + UTF-8 no-BOM + trailing LF manuel - L924 byte-surgical strict (insertion bytes-level sans round-trip json.dumps) preserve whitespace-only source elements dans les outputs HTML .NET Interactive (ML-3-Entrainement&AutoML 12 lignes whitespace-only dans output HTML pre-existantes preservées byte-a-byte) - L930 strict YAML indent 2-space sous cost: et notes: | (closing --- col 0) - id sanitization : stem[:20] avec remplacement [^a-zA-Z0-9\-_] -> '-' (ML-2-Data&Features id valide) - c.187 atomic +99/-3 strict (12 files, insertion 1 cellule / notebook, 3 deletions = trailing LF fixes) - R1 catalog-pr-hygiene : aucun fichier COURSE_CATALOG.generated.* touche - C.3 0 Papermill re-exec (insertion md uniquement, code/outputs preserves byte-a-byte) - L143 secrets 0 literal inline (.env only via os.environ) - L929 cleared : 12eme PR po-2025 sans collision upstream - L898 pre-push cross-lane collision check : OK Sub-genre docs-cost-matrix-tranche-ml-mlnet-foundations : 12/12 notebooks Pattern A/D canonical. Voir PR #8235 (c.829 Video 01-Foundation Pattern A 5/5), PR #8237 (c.830 Video 02-Advanced Pattern A 4/5), PR #8245 (c.831 Video 02-5-LTX2 Pattern C sub-grain-residu 1/1), PR #8254 (c.832 Video 03-Orchestration Pattern A 3/3). Reste EPIC #8056 ML : ML-7..ML-9, TP-prevision-ventes, 4 _output.ipynb + 1 Track1_output. See #8056 partial: ML sub-grain advances 12/52 = 23% (post-c.833 cumul 28/52 ML = 54% -> 40/52 ML = 77%). 12 notebooks ML-1..ML-6 Python+C# twins couverts.
…books (c.832) (#8254) Pattern A canonical (cf c.829, c.830): cell[0]=markdown (titre + navigation) + cell[1]=code (# Parametres Papermill OU import) -> INSERTION d'une nouvelle cellule markdown frontmatter YAML entre c0 et c1 (position 1). c0 titre reste en place, c1+ code decale d'un index, byte-identique sur ec/outputs. 3 notebooks Video/03-Orchestration couverts: - 03-1-Multi-Model-Video-Comparison: 18 GB VRAM, chargement sequentiel, benchmark Hunyuan+LTX+Wan+SVD - 03-2-Video-Workflow-Orchestration: 18 GB VRAM, pipelines text->image->video->upscale->interpolation - 03-3-ComfyUI-Video-Workflows: 0 GB VRAM (service ComfyUI user-deployed, client API-only) 15-field YAML c.800 canonique, adapte: - 03-1/03-2: gpu_required=true, vram_gb=18 (8 GB sequentiel + 18 GB pic), vram_tier=GPU_HIGH - 03-3: gpu_required=false, gpu_min=0, vram_gb=0, vram_tier=NONE (service ComfyUI distant) - external_account=comfyui pour 03-3 (COMFYUI_VIDEO_URL + TOKEN via .env) - free_alternative=self pour les 3 (local OU service self-hosted) Conformite stricte: - yaml.safe_load 14/14 keys cost: + 1 sibling notes: + regex delimiters + 3/3 PASS - nbformat.validate OK (scope-strict sur mes nouvelles cellules uniquement) - LF-only CR=0 (L268) - c.281-L1 MD047 trailing newline mandatory - L800 wb mode + UTF-8 no-BOM + trailing LF manuel - L924 round-trip safe (json.dumps indent=1 ensure_ascii=False, pas byte-surgical necessaire) - c.187 atomic +24/-0 strict (1 commit, 3 files, +8 lines/notebook = 1 cellule inseree) - R1 catalog byte-identique (pas touche COURSE_CATALOG.generated.*) - C.3 0 Papermill re-exec (insertion markdown uniquement, code/outputs preservés) - L143 secrets 0 literal inline (.env only via os.environ) - L929 cleared: 11eme PR po-2025 sans collision upstream Sub-genre docs-cost-matrix-tranche-video-orchestration: 3/3 notebooks Pattern A canonical. Voir PR #8235 (c.829 Video 01-Foundation Pattern A 5/5), PR #8237 (c.830 Video 02-Advanced Pattern A 4/5 + sub-grain-residu exception c.821). Reste EPIC Video 04-Applications (4 notebooks). See #8056 partial: Video sub-grain advances 3/8 = 37.5% Video residu (post-c.831 1/12 Video residu = 8% residu).
Summary
Apply YAML
cost:frontmatter schema (15 fields per c.800 canonical) to 5 Video 01-Foundation notebooks per EPIC #8056 (P1 notebook-metadata cost-matrix).Sub-genre
docs-cost-matrix-tranche-video— première tranche Video (post c.800-c.821 Image 20/20 + c.822-c.824 Audio 30/30 + c.826 ML Cours 9/52 + c.827 ML Track1 7/52 + c.828 ML Track2+01-PyDataSci 12/52).Pattern A canonical 5/5 (cell[0]=markdown titre + cell[1]=code → insert new markdown cell after cell[0] with frontmatter, preserves title).
Tranche multi-provider :
VRAM diversity : 0 GB (x2) / 4 GB (x1) / 12 GB (x1) / 18 GB (x1). Tronche VRAM differenciee pedagogique.
Diff metric
Strict c.187 atomic (UNIQUE commit
596ea741d, +148/-0), L268 LF-only (0 CR), c.281-L1 MD047 trailing newline 5/5, G.4 atomique (1 commit, 1 sub-genre tranche-video).Bug-fix L930 NEW didactique APPLIQUÉE — YAML indentation stricte
Bug reproduit c.826 + c.828 : les FRONTMATTERS c.826/c.828 generaient du YAML avec champs
cost:non-indentes (a la colonne 0, freres decost:au lieu d'enfants). PyYAML produisaitcost: None+ champs leaked au top-level. Le validatorre.match(r'^---\s*\n(.*?)\n---\s*\n', src, re.DOTALL)+yaml.safe_load(...)"fonctionnait par accident" (capture les champs top-leaked), mais la clecostetaitNone, pas un dict.Fix source-time (c.829) — lecon ancree APPLIQUEE : fonction
build_frontmatter(title, cost_lines, notes_lines):cost_linesetnotes_linessont PRE-INDENTES 2 spaces par le caller (pas detextwrap.dedent()au contraire de c.828 → evite le round-trip indentation dudedentqui retirait les 2 leading spaces)cost:a la colonne 0<cost_line>indented 2 spaces (clef enfant decost:)notes: |a la colonne 0<note_line>indented 2 spaces (litteral scalar enfant denotes: |)---a la colonne 0 (jamais indented, suite de la concatenation)Resultat :
yaml.safe_load(m.group(1))produit{'title': '...', 'cost': {<14 fields>}, 'notes': '...'}—costest un DICT correct, pasNone. Plus de leak top-level.Validation post-population 5/5 :
re.match(r'^---\s*\n(.*?)\n---\s*\n', src, DOTALL)match=True du premier coupcost:avec 14/14 fields presents (verifie strictset(cost.keys()) == expected_keys)notes: strnon-emptytitle: strmatche expectedNote didactique ancree :
yaml.safe_load()strict validation + 2-space indentation undercost:> byte-surgical normalize post-population. Prevenir > corriger. Bug L930 LEÇON MAINTENANT RELLEMENT FIXEE (vs c.826/c.827/c.828 ou le bug etait « accepte par accident »).Sub-issue : validator lit cell[0] au lieu de cell[1] (HARD, L829)
Probleme pre-existant c.821-c.822-c.823-c.824-c.826-c.827-c.828-c.829 idem :
scripts/audit/check_cost_metadata.py:118-123lit UNIQUEMENT la cellule[0]du notebook pour detecter le bloc YAML---...---. La convention c.800/Pattern A/Pattern C = insere le frontmatter acell[1](apres le titre markdowncell[0]).Consequence :
cost_meta_found: Falsesur tous les 5 notebooks de cette PR. Le validateur actuel est techniquement casse par rapport a la convention appliquee.Fix en cours : PR #8219 OPEN MERGEABLE (c.825, SHA
e1d0cba5c, +17/-6) = patcher le validateur pour scanner toutes les cellules markdown a la recherche du bloc---...---. Resoudra L829 sub-issue des merge ai-01.Decision : NE PAS fixer dans cette PR (G.4 atomique = 1 sujet par PR). Le fix = sub-issue separee c.825 #8219, awaiting merge.
Validation manuelle 5/5 : regex
r'^---\s*\n(.*?)\n---\s*\n', DOTALLmatch=True sur les 5 fichiers post-fix (validation identique au validateur une fois que #8219 sera merge).Coverage post-merge (si PR mergee avant c.830+)
EPIC #8056 sub-grain Video = 5/17 post-c.829 (reste 12 = c.830 Video 02-Advanced 5 + c.831 Video 03-Orchestration 3 + c.832 Video 04-Applications 4).
Reste EPIC #8056 : Video 12/17 + Texte 20 + Lean (hors scope).
Conformite run
git diff --cached | tr -cd '\r' | wc -c = 0sur les 5 fichiers et le diff complet.\n).sk-|ghp_|AIza|password=|secret=dans le diff. Qwen-VL/AnimateDiff utilisentHF_TOKENviaos.environ(variable env), pas de literal inline. ESRGAN = poids publics pas gated.CATALOG*/COURSE_CATALOG*touche, catalogue byte-identique a main.json.loads()+insert cell[1]+json.dumps(indent=1, ensure_ascii=False)+ trailing NL. Round-trip preserve car cells[0] et cells[2+] non modifies.outputs— toutes les cellules code preservees byte-identique (insert at cell[1] = pure addition).re.match(r'^---\s*\n(.*?)\n---\s*\n', cell[1].source)match=True + yaml.safe_load produitcost: dict correct(14/14 keys) + title present + notes block scalar.gh pr list --search "video OR HunyuanVideo OR LTX-Video OR AnimateDiff" --state allcleared avant push — aucune PR Video cost-matrix upstream. Greenlit.Notebook details
5.1 01-1-Video-Operations-Basics ($0.00, none VRAM 0GB)
Operations de base sur videos avec moviepy (trim, concat, overlay), ffmpeg-python (probe metadata fps/codec/resolution), decord (extraction rapide VideoReader), imageio (lecture/ecriture), Pillow, matplotlib. Pipeline pedagogique : creer video test -> analyser metadata -> extraire frames -> afficher grille. 100% CPU/LITE, 0 VRAM.
5.2 01-2-GPT-5-Video-Understanding ($0.10, openai VRAM 0GB)
Video understanding avec OpenAI GPT-5-mini multimodal API. Pipeline : echantillonner N frames uniformement -> encoder base64 -> envoyer avec prompt analyse. Cout 0.10 USD pour 8 frames sur video 10s. Strategie sampling uniforme vs keyframe comparee. Fallback local : Qwen2.5-VL (notebook 5.3).
5.3 01-3-Qwen-VL-Video-Analysis ($0.00, none VRAM 18GB)
Qwen2.5-VL-7B-Instruct charge via transformers (bf16 ~14 GB). Video understanding avec echantillonnage FPS dynamique + temporal grounding (localiser evenements avec timestamps) + OCR dans frames. Necessite GPU 18+ GB VRAM (RTX 3090, A100). Alternative cloud : GPT-5-mini.
5.4 01-4-Video-Enhancement-ESRGAN ($0.00, none VRAM 4GB)
Real-ESRGAN frame-by-frame upscaling (x2 ou x4, modele RealESRGAN_x2plus ou RealESRGAN_x4plus). Pipeline extract -> upscale -> reassemble. Metriques PSNR et SSIM calculees pour evaluer qualite vs compromis temps. Concept RIFE interpolation (24fps -> 60fps). Necessite GPU 4+ GB VRAM (tile_size=256).
5.5 01-5-AnimateDiff-Introduction ($0.00, none VRAM 12GB)
AnimateDiff = motion adapter (attention temporelle) + base model Stable Diffusion v1.5. Generation text-to-video (16 frames @ 8 fps = 2s par defaut). Parametres cles : num_frames, guidance_scale (CFG), num_inference_steps, scheduler (DDIM/Euler). Sortie GIF + MP4. Necessite GPU 12+ GB VRAM (RTX 3060 12GB minimum).
Relation EPIC #8056
Suite logique (c.830+)
02-5-LTX2-Audiovisual.ipynbcell[0]=code + cell[1]=markdown = a traiter separement comme c.821 sub-grain-residu).🤖 Generated with Claude Code