Retarget human motion from video to an Adobe Mixamo-rigged 3D character.
Python
Stop notes typed on one diagnostics report from appearing on the next one.
MaxLiu93e87f575951
diff --git a/AGENTS.md b/AGENTS.mdindex 3f0b906..f234574 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -123,7 +123,7 @@ Each run writes `outputs/<YYYYMMDD_HHMMSS>_<source>/`:Problems only the eye can see (a sliding foot, a popped knee, a hand that misses the body) are not in `diagnostics.json`. They go in a review file, schema `m2mr-review-v1`, so a later pass can revise that run's `mixamo_rotations.npz`, `skeleton_motion.npz`, or the animation in `mixamo_character.glb`. The file does not contain the mesh or the npz bytes.-In `diagnostics.html` the amber lane above the intersection tracks is that pass. Drag a range, or set **In** and **Out**, and write what is wrong. The **Notes** list on the right shows the same notes; click a row to jump to its first frame. **Download notes** saves `<video stem>_review.json`. The browser keeps the notes in `localStorage` under `m2mr-review-v1:<source glb>:<frame count>:<fps>`, so regenerating the HTML does not drop them.+In `diagnostics.html` the amber lane above the intersection tracks is that pass. Drag a range, or set **In** and **Out**, and write what is wrong. The **Notes** list on the right shows the same notes; click a row to jump to its first frame. **Download notes** saves `<video stem>_review.json`. The browser keeps the notes in `localStorage` under the run folder and the source video or still, so a different report does not show them. Regenerating this report's HTML does not drop them.An agent automating the pass does not need the browser. Write `<run>/<video stem>_review.json` directly. Read `run.json` for the clip and the rig, and `diagnostics.json` for the intersections. Frame 0 is the first frame, the same index as Blender and `diagnostics.json`. Ranges are inclusive. `start_s` and `end_s` are `frame / fps`, rounded to 3 decimals.diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 98fb417..271587c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file.### Fixed+- `diagnostics.html` stored eye notes in the browser under the GLB name plus the frame count. Every GLB is named `mixamo_character.glb`, so a new report of the same length opened with the previous notes already filled in. Notes are stored for that run and its source video only.- Blender add-on: after import the timeline covers the clip as frames 0 to n-1 (was 1 to n), the frame numbers the glTF importer and `diagnostics.json` use.- Blender add-on: the first **Open HTML Report** showed the character with the source video missing. The report embeds that video by calling the `ffmpeg` program from the external Python. Blender opened from the Dock or Finder gives that process launchd's PATH (`/usr/bin:/bin:/usr/sbin:/sbin`), so a Homebrew `ffmpeg` in `/opt/homebrew/bin` or `/usr/local/bin` was not found and the video was left out. Those directories are now added when they exist. `ffmpeg` here is the system program (`brew install ffmpeg` on macOS); the external Python looks it up on PATH when it builds the report.- A subject who turned away and back could stay facing away in the recovered 3D motion for the rest of the clip. The 2D left/right stabilizer decided "real turn or label flip" at the single transition frame (it required four consecutive side-view frames after the first turn) and never revisited the decision, so one mislabelled frame or one fast spin locked the wrong facing in. `motion2mixamorig/stabilize_kp2d.py` now cuts the clip into segments at side-view frames and takes the majority of RTMPose's labels inside each segment; only runs of the opposite sign shorter than ~0.33 s count as flips. No facial keypoints are used (hats and masks do not matter) and each person track is handled on its own. On a dance clip with a fast half-second turn, wrong-facing frames went from 320 of 642 to 3. Re-running on an existing cache re-stabilizes from the `vitpose_raw.pt` backup, not from the previous rule's output.diff --git a/motion2mixamorig/diagnose_report.py b/motion2mixamorig/diagnose_report.pyindex 4850d84..a8e70be 100644--- a/motion2mixamorig/diagnose_report.py+++ b/motion2mixamorig/diagnose_report.py@@ -441,7 +441,13 @@ document.querySelectorAll('#filters button').forEach(b => b.onclick = () => {// Timeline: a sticky review lane (notes a person makes) above one track per issue.const TL = { label: 180, ruler: 22, lane: 32, row: 20, pad: 12 };const AMBER = '#e6a23c';-const storeKey = `m2mr-review-v1:${R.source}:${N}:${FPS}`;+// The GLB is named mixamo_character.glb in every run, so the browser must not+// key notes by that name: a new report would open with the previous clip's notes.+// The run folder and the source video (or still) are written into this file.+const ident = D.source || {};+const storeKey = 'm2mr-review-v1:' + JSON.stringify([+ ident.run || '', ident.video || ident.image || '', N, FPS,+]);let notes = [], selectedNote = -1, pendingIn = null, drag = null, noteSeq = 1;function newNoteId() { return 'n' + (noteSeq++); }function clampFrame(f) { return Math.max(0, Math.min(N - 1, f | 0)); }