PixelMorph

What happened when we tried to make 2D-to-3D video comfortable inside XR glasses—and built a Quest gallery to show the work把 2D 转 3D 视频做得在 XR 眼镜里真正舒服,我们踩过的坑,以及为了展示成果搭起的 Quest 展厅

If you put on a pair of XR glasses and watch an ordinary 2D video that has been converted to stereo by a modern depth model, your first reaction is usually surprise at how sharp the cutouts look—and your second reaction, about ten seconds later, is a quiet ache behind the eyes. A subway train pulls into an underground station, or a cyclist leans into a turn, and for three seconds the depth feels almost magical. Then your eyes start working harder than they should. The foreground edge fights the black border of the display; a reflection on a glass door shimmers differently in your left eye than in your right; a subtle jump repeats every second where one temporal window hands off to the next.

PixelMorph started as my Final Year Project out of that gap. Almost everyone working on monocular-to-stereo conversion treats depth accuracy as the finish line, assuming that once the depth map is crisp enough, comfortable 3D video will follow on its own. It doesn't. Over several months, the project grew into two intertwined pieces of engineering: a research pipeline trying to learn clip-level stereo settings directly from human viewing preferences, and a web and Meta Quest WebXR exhibition platform built to present the evidence honestly and let visitors judge the results inside a real headset.

Research write-ups have a habit of smoothing over dead ends until every decision looks inevitable in hindsight. I want to tell this one the way it actually unfolded—including the metrics that rewarded collapsing 3D back into 2D, the months of learned depth models that failed their own gates, the diffusion artifacts hiding inside valid pixels, and the things we still haven't proven.

戴上一副 XR 眼镜,看一段用现代深度模型从普通 2D 视频转出来的立体画面,前几秒你多半会觉得惊艳。地铁驶进站台,或者小轮车骑手压弯过线,前景利落地从背景里剥了出来,像真的有了体积。可大概十秒之后,眼眶深处就会冒出一阵安静的酸胀:前景边缘和黑色边框打架,玻璃门上的反光在两只眼里闪得不一样,大约每隔一秒,时间窗口交接处还会轻轻跳一下。

PixelMorph 是我的毕业设计,就是从这道十秒钟的坎里长出来的。做单目转双目的人大多把深度精度当成终点,以为深度图抠得够锐利,舒服的 3D 视频自然就来了。其实不然。几个月做下来,项目长成了两条紧扣的工程线:一条直接从人类观影偏好里学习片段级立体参数的研究管线,以及一套网页与 Meta Quest WebXR 展览平台,把证据老老实实摆出来,让观众戴上真机自己评判。

研究报告习惯把走过的弯路抹平,写得好像每一步都顺理成章。这篇我想按事情本来的样子讲一遍,包括那些奖励把 3D 压扁回 2D 的指标、连着几个月没过门槛的可学习深度模型、藏在有效像素里的扩散重绘瑕疵,以及我们至今还没证明的部分。

Why sharper depth doesn't mean comfortable 3D为什么深度更锐利,不代表 3D 更舒服

On a flat laptop monitor, a side-by-side stereo render looks convincing as long as the silhouettes are clean. Inside RayNeo Air XR glasses—46° diagonal, 1920×1080 per eye, roughly 40.1° horizontal field of view—the geometry stops being abstract.1 Your lenses stay focused on the virtual screen roughly six meters away, while deep foreground disparity pulls your eyes to converge closer than that screen. The larger that mismatch grows, the faster vergence–accommodation strain sets in. Even worse, when a nearby object crosses the left or right edge of the frame while popping forward in depth, your brain receives two contradictory cues at once: stereo disparity says the object is closer than the screen, while the screen's black border cleanly slices it off. That clash—a stereo window violation—feels jarring almost immediately.

Our first instinct was the standard machine-learning one: find an automatic stereo quality metric and optimize against it. We tested Apple's official frame-level stereo quality model, iSQoE, across 244 human-rated clip pairs. It failed in a way that changed how we thought about the entire project. iSQoE chose the flatter version in 91% of pairs and agreed with human choices 57.0% of the time—statistically indistinguishable from the trivial rule 'always pick the flatter video' at 55.7%.2 Even more telling, when we ran a sanity check across six diagnostic clips with the left eye held fixed, completely flat 2D video (left eye copied verbatim to the right eye) scored better than stereo neutral on every single clip.

Once you see why that happens, it's obvious. Any real 3D render has tiny imperfections: a slightly softened disocclusion seam, a touch of vertical offset, a subtle inpainting blur. A flat 2D image has zero disparity and therefore zero stereo artifacts. Earlier in the project, when we tested reward formulations on known discomfort distortions, a comfort-only score rated the completely flattened 2D degenerate as 'more comfortable' than roughly 62% of real stereo clips—only routing geometry into a separate hard validity gate rejected 98% of those flattened cheats. Optimize a static quality proxy directly and you don't get comfortable 3D; you just teach the model the laziest possible hack, which is to flatten the world back into 2D.

Perceptual comfort isn't a pixel-wise loss you can eyeball from still frames; it's a trade-off between depth sensation and binocular artifacts felt across a complete clip.

在笔记本屏幕上,只要人物轮廓干净,左右并排的立体画面看着就很像样。可戴上 RayNeo Air XR 眼镜(46° 对角视场、单眼 1920×1080、水平视场约 40.1°),几何立刻变成眼睛上的实感。1 晶状体一直聚焦在大约六米外的虚拟屏幕上,过深的前景视差却拽着双眼往更近处内聚;两者错位越大,辐辏—调节疲劳来得越快。更难受的是近处物体一边往前冲、一边压过画面左右边,立体视差说它在屏幕前面,黑框却齐刷刷把它截断。这种立体窗口违规,几乎瞬间让人别扭。

我们一开始走的是最标准的机器学习套路:找个自动立体质量指标拿来优化。拿 Apple 官方的帧级立体质量模型 iSQoE 在 244 组人类评分视频对上跑了一轮,结果直接把整个项目的思路扭了过来。iSQoE 在 91% 的配对里挑了更扁平的那一版,和人类偏好的吻合度是 57.0%,统计学上和最笨的规则「永远选更扁平的视频」(55.7%)毫无差别。2 更说明问题的是六段诊断视频的对照检查:固定左眼不动,把左眼原封不动拷给右眼做成纯 2D,结果纯 2D 在全部六段上都拿了比真立体更高的分。

想通原因其实一点不稀奇。只要是真的 3D 渲染,遮挡接缝、微弱垂直偏移、补全边缘总会带点小瑕疵;彻底扁平的 2D 视差为零,立体瑕疵自然也是零。早期测奖励公式时也栽过同一个跟头:纯舒适度打分把彻底压扁的 2D 判得比约 62% 的真实立体片段「更舒服」,直到把几何有效性拆成独立的硬门槛,才拦住 98% 这种压扁作弊。直接去优化静态质量代理,学不出舒服的 3D,只会把模型教成最懒的投机者:把世界拍回 2D。

视觉舒适度不是盯着静帧就能算出来的像素误差,而是在整段动态视频里,立体纵深感与双目瑕疵之间的持续拉锯。

The dead ends that led to two simple controls逼出两个简单旋钮的几条死胡同

The final system looks almost suspiciously simple, which is usually a sign that several more complicated ideas broke first. Early in the year, we spent months trying to learn richer depth corrections directly: a six-dimensional hand-designed controller, per-video auto-decoders over temporal video-depth features, a localized object-boundary refiner, and a learned residual warping branch. Each one hit a concrete wall we couldn't talk our way around.

The boundary refiner was the most instructive failure. On standard indoor depth validation, it lowered average metric depth error from 0.48 m to 0.45 m—the kind of headline number that normally makes you celebrate. Then we checked actual edge localization: boundary F1 dropped from 0.61 to 0.51, and seven of eight scenes got worse. The model was altering high-frequency depth without reliably knowing which RGB texture edges were real depth discontinuities. Meanwhile, the learned warping residual never cleared its initial feasibility gate, and a broader representation sweep across four frozen vision backbones—Depth Anything V2's internal DINOv2 features, V-JEPA 2.1, VideoPrism, and SigLIP2—showed that training temporal heads on 903 clips still couldn't reliably beat plain PCA or ten simple geometry statistics at predicting stereo response.

Stepping back forced a cleaner question. Instead of trying to out-predict a depth backbone, we froze Depth Anything V2 (640 pixels per eye, 24 FPS) and froze the full-attention M2SVid stereo renderer (25-frame windows with 21-frame cores, max disparity fraction 0.05). We turned off local boundary editing completely and exposed just two explicit, clip-level analytic controls: a global disparity scale s across {0.6, 1.0, 1.4}, and a within-scene depth redistribution parameter k across {−0.5, +0.5} at neutral scale.3

Freezing the heavyweights did something immediately liberating. Whenever two versions of the same video looked different inside the glasses, we knew with certainty that the difference came strictly from those two parameters—not from a drifted checkpoint, a new random seed, or a hidden decoder side effect. Only a small parameter-selection policy would be allowed to learn from complete-video human preferences.

最终系统简单得有点可疑,这通常是前面好几个更复杂的想法先撞了墙的信号。年初那几个月,我们花了不少时间尝试直接学习更丰富的深度修正:六维手工控制器、基于时序深度特征的逐视频自解码器、局部物体边界优化器,以及可学习残差扭曲分支。每一个都撞上了绕不过去的硬墙。

边界优化器给的教训最狠。在标准室内深度验证集上,它把平均度量深度误差从 0.48 m 降到了 0.45 m,平时看见这种数字早该庆祝了。可回头一查真实边缘定位,边界 F1 反而从 0.61 掉到了 0.51,八个场景里七个变差。模型在改动高频深度时,压根分不清哪些 RGB 纹理边才是真实的深度断点。另一边,可学习残差扭曲连最初的可行性门槛都没过;把四个冻结视觉骨干(Depth Anything V2 内部 DINOv2 特征、V-JEPA 2.1、VideoPrism、SigLIP2)拉出来横扫一遍,在 903 段视频上训出来的时序头,预测立体响应时依然稳赢不了普通 PCA 或十个简单的几何统计量。

退后一步反而看清了路。与其拿小数据去挑战巨型深度骨干,不如干脆锁死 Depth Anything V2(单眼 640 像素、24 FPS)和全注意力 M2SVid 立体渲染器(25 帧窗口、21 帧核心、最大视差比例 0.05),彻底关掉局部边界编辑,只暴露两个明明白白的片段级解析旋钮:全局视差缩放 s({0.6, 1.0, 1.4}),以及中性缩放下的场景内深度重分布 k({−0.5, +0.5})。3

把重型模型冻结之后,整个实验一下子清净了。只要同一段视频在眼镜里观感不同,我们就百分之百确定差异严格来自这两个参数,绝不是权重飘了、随机种子换了或者解码器藏了副作用。只有一套小巧的参数选择策略,被允许从完整视频的人类偏好里学习。

Catching what the diffusion refiner hid揪出扩散修复器悄悄藏起来的破坏

Even with frozen models, building a trustworthy preference dataset turned out to be mostly an exercise in distrusting our own pipeline. We started with 1,586 candidate clips across seven video sources—Mixkit, BDD100K, DAVIS, Assembly101, Stereo4D, HD-EPIC, and Blender. Hard technical filters cut 438 low-frame-rate clips, 40 shot cuts, 20 portrait videos, and 27 miscellaneous failures down to 1,061 eligible clips. Diversity sampling selected 312 sources spanning outdoor streets, hands-on tabletop tasks, animals, people, and indoor rooms, and 272 cleared initial rendering into paired clips (40 were excluded because no pair stayed under the 6% raw-hole limit or passed rendering checks).

Then, right before collecting ratings, we audited all 544 rendered clips and caught a failure mode that would have quietly poisoned the dataset. In a subset of videos, M2SVid's diffusion refiner was repainting real foreground objects inside pixels that were already valid after forward warping—windshield wipers, car pillars, defocused foreground subjects, flames, sparklers, and phone screens. Your left eye saw a wiper blade; your right eye saw smooth glass. Our first left-versus-right check had only caught six of these because normal stereo parallax masked smaller repaints. Once we wrote a check comparing every generated right-eye frame directly against its own raw forward warp, 26 corrupted sources lit up immediately, along with one flat far scene where a higher depth scale failed to produce wider disparity.

That audit became our final quality gate: a 6% raw-hole prescreen, a 1.3% worst-frame repaint limit inside valid warped regions, and a strict monotonicity check. Along the way, cryptographic hash audits also caught two sneaky infrastructure bugs during cloud batch rendering—62 clips rendered on a worker whose renderer fingerprint didn't match the rest of the batch, and 28 clips whose depth maps shifted subtly under multi-worker memory pressure. We threw all 90 away and re-rendered them so every clip in the release shared one exact provenance chain.4

Excising the 27 failing sources left a clean dataset of 245 paired comparisons—490 Full-SBS 3840×1080 videos—strictly partitioned by original source into 168 training, 31 validation, and 46 untouched test pairs so adjacent clips from the same video could never leak across splits. Four internal viewers judged every head-to-head pair by forced choice, answering a single overall viewing question: which version would you rather watch in 3D?

就算模型全冻结了,攒一份信得过的偏好数据集,大半时间依然是在怀疑自己的管线。我们从七个视频源(Mixkit、BDD100K、DAVIS、Assembly101、Stereo4D、HD-EPIC、Blender)收了 1,586 段候选素材。硬性技术过滤先剔掉 438 段低帧率、40 段带切镜、20 段竖屏和 27 项杂项故障,剩 1,061 段合格片段。多样性采样挑出 312 个源视频,覆盖户外街景、桌面手工、动物、人物与室内场景,其中 272 个跑通了初始成对渲染(40 个因过不了 6% 原始空洞上限或渲染检查被排除)。

就在收集人工评分前,我们把全部 544 段成片逐一过了一遍审计,抓到一个差点悄悄毁掉整份数据集的故障。在一部分视频里,M2SVid 的扩散修复器不只是在填黑缝,竟然跑进「前向扭曲本来已经好好的」有效像素里,把真实前景抹掉重画了:雨刮器没了,汽车 A 柱融进后面的马路,虚化的前景主体糊成背景,火焰、仙女棒和手机屏幕凭空消失或变形。左眼看着一根雨刮,右眼看着光溜溜的玻璃,戴进眼镜立刻犯晕。之前拿左眼比右眼只抓出了 6 段,因为正常视差把小块擦除盖过去了;直到改成把每帧生成右眼直接和它自己的原始前向扭曲比对,26 个坏源瞬间现形,外加 1 段放大缩放却没拉开视差的平坦远景。

这次审计定下了最终的三联门槛:6% 原始空洞预筛、有效扭曲区内最差单帧 1.3% 重绘上限,以及严格的视差单调性检查。过程中,加密哈希审计还在云端批渲染里抓出两处静默事故:62 段视频跑在渲染器指纹和整批不一致的节点上,28 段视频的深度图在多进程显存吃紧时悄悄漂了。把这 90 段全扔掉重渲很枯燥,但换来发布集里每段视频共享唯一可核验的溯源链。4

清掉 27 个坏源后,剩下 245 组干净的成对比较(490 段 Full-SBS 3840×1080 视频),严格按原视频切分成 168 组训练、31 组验证、46 组未触碰测试,杜绝同源相邻片段跨集泄漏。四位内部观察者对每一组做强迫二选一,回答同一个整体问题:你更想在 3D 里看哪一版?

Four parameters beat sixty-four四个参数打败六十四维

When the 245 judgments came back and we ran our preregistered evaluation ladder, the most striking result wasn't a triumph of deep representation learning—it was how brutally a high-dimensional policy overfits on 168 single-viewer labels. Standard unregularized Direct Preference Optimization over a 64-dimensional visual embedding scored 0.866 negative log-likelihood and 40% accuracy on the test split, substantially worse than a 0.693 coin flip. A physically structured ideal-point model that reasoned directly over measured disparity span cut test loss by 0.198 against that unregularized baseline, though post-hoc analysis showed heavy weight decay brought standard DPO back into the same ballpark.

Looking closely at the raw judgments explained why no complex model was pulling away. Overall, the stronger-depth clip won 80 of 168 training pairs (48%)—almost dead even—and the four viewers genuinely leaned in different directions, with one choosing stronger depth 33% of the time and another 60% of the time. We even checked whether live personalization could adapt to a new viewer in a few clicks, and the math was sobering: a single forced choice between 0.6× and 1.4× carries so little Fisher information against a reasonable viewer prior that five answers barely budge the uncertainty, and even sixty answers only shrink the posterior standard deviation by a third.5

To decide what to lock for our final demonstration, we benchmarked eleven preference-model variants (including conservative DPO, IPO, bagged models, kernel ideal points, and rater-aware models) alongside standard ML baselines (logistic regression, gradient boosting, k-nearest neighbors, and MLPs) under grouped cross-validation. The winner wasn't the cleverest neural head; it was a four-parameter level-wise Bradley–Terry utility model over each scene's rendered default disparity span.6 It posted the lowest cross-validated loss (0.675 versus 0.693 neutral) and, just as importantly, the lowest decision flip rate of any non-constant learner—15% across 30 source-bootstrap refits, compared to 24%–53% for the other models.

What I like most about this final model is that you can state its entire policy in one sentence: deep scenes with a default disparity span above roughly 11.7 pixels get compressed to 0.6× scale, shallow scenes keep the default 1.0×, and 1.4× is never chosen. Across 76 held-out scenes, it cuts average pre-inpainting holes from 2.16% down to 1.62% and nudges left–right inconsistency down from 0.148 to 0.144 relative to the fixed default, while keeping 8.67 pixels of mean disparity span—17% more depth than simply locking every video to 0.6× (7.43 px).

We also benchmarked the same pipeline against TencentARC's StereoCrafter across 14 scenes spanning both branches of our policy. StereoCrafter maps depth across a whole clip to a fixed range and runs the entire right eye through a video diffusion latent round-trip. As a result, its right eye came out noticeably softer (sharpness ratio 0.40 versus 0.65 for our outputs), its left–right inconsistency was 2.4× higher (0.314 versus 0.130), and it produced nearly twice the pre-inpainting hole area (3.16% versus 1.60%) even while delivering slightly less depth on ten of the fourteen scenes. Keeping warp-valid pixels intact turned out to matter a lot more than we expected.

245 份判断结果回来、按预注册阶梯跑完实验,最醒目的结果并不是深度表征学习的胜利,而是高维策略在 168 条单人标注上过拟合得有多惨。在 64 维视觉嵌入上跑无正则化 DPO,测试集负对数似然高达 0.866、准确率只有 40%,比 0.693 的抛硬币还差一大截。直接建在实测视差跨度上的物理结构理想点模型把测试损失比无正则化基线拉低了 0.198,不过事后分析也诚实表明,加上强权重衰减后标准 DPO 会回到大致同一区间。

翻看原始标注就能明白为什么复杂模型拉不开差距。训练集 168 组里强深度赢了 80 组(48%),几乎五五开;四位观察者的口味也各不相同,一人只选 33% 的强深度,另一人选到 60%。我们还算过「点几下实时个性化」行不行,数学结论很冷静:在合理的先验下,一次 0.6× 对 1.4× 的二选一携带的 Fisher 信息量极小,答五题几乎撼动不了不确定度,答满六十题后验标准差也才缩掉三分之一。5

为了定下最终演示要锁的模型,我们在分组交叉验证下横评了十一种偏好模型变体(包括保守 DPO、IPO、装袋模型、核理想点与感知评分者模型)和常规机器学习基线(逻辑回归、梯度提升、k 近邻、多层感知机)。胜出的不是什么花哨神经头,而是只看「场景默认渲染视差跨度」的四参数分级 Bradley–Terry 模型。6 它交出了最低的交叉验证损失(0.675 对中性基线 0.693),更重要的是拿下了所有非常数学习器里最低的决策翻转率:30 次按源自助重拟合里只有 15%,其余模型都在 24%–53% 之间。

这套最终模型最讨喜的地方,是一句话就能把整套策略讲完:默认视差跨度超过约 11.7 像素的深场景压到 0.6×,浅场景留 1.0×,1.4× 永远不用。在 76 个留出场景上,它相对固定默认把补全前平均空洞从 2.16% 降到 1.62%,左右不一致从 0.148 微降到 0.144,同时留住 8.67 像素的平均视差跨度,比一刀切压死 0.6×(7.43 px)多保留 17% 的立体深度。

我们还拿同一套管线与 TencentARC 的 StereoCrafter 在覆盖策略两支的 14 个场景上正面比了一轮。StereoCrafter 把整段深度映射到固定区间,并让整帧右眼钻进视频扩散潜空间兜一圈。结果它的右眼肉眼可见地偏软(清晰度比值 0.40 对我们的 0.65),左右不一致高出 2.4 倍(0.314 对 0.130),补全前空洞面积几乎翻倍(3.16% 对 1.60%),14 个场景里还有 10 个深度更浅。保住前向扭曲的有效像素,比我们最初想的要重要得多。

Full HD, and what we still don't know原生全高清,以及我们还没证明的事

The 640-pixel working resolution was fine for controlled experiments, but scaling it 3× onto a 1080p-per-eye headset softens foliage, grass, denim texture, and small text. For the live demonstration, I built a native-pixel Full HD pipeline on a 96 GB RTX PRO 6000 Blackwell GPU. Even getting a true native input required catching a subtle trap: our first 1080p test used a 60° perspective crop of a 4K VR180 video, which looked sharp on paper until we checked the angular geometry and realized only ~640 raw columns were being stretched to 1920 pixels. We threw that run out and switched to unscaled 1920×1080 monocular originals—a subway train pulling into a station, a BMX rider, city streets, and park scenes.

In the Full HD pipeline, depth estimation and range measurement stay at 640×360, displacement scales onto the unscaled 1920×1080 warp, and M2SVid runs across 15 overlapping 512×512 spatial tiles (128-pixel overlap, latent blending, tiled VAE decoding) per 25-frame window—taking about five minutes per six-second clip at 18.8 GiB peak allocated VRAM.7 Running a full batch in the cloud wasn't smooth either: three VMs were wiped mid-queue after about 22 minutes whenever our monitor only polled via file downloads, until we added a four-minute kernel heartbeat probe and ran the final VM 6.75 hours straight across 28 scenes without a single loss. In the end, 31 native 1080p default-versus-policy pairs passed full frame decode and seam inspection, reducing median disparity span by 39.2% (from 16.82 px to 10.32 px). One generated clip—a gorilla in tall grass—showed grass re-synthesizing between 21-frame windows, so we explicitly flagged it as not recommended rather than hiding it.

We also measured where the zero-parallax screen plane sits across 20 demonstration clips. Because our forward warper keeps all disparity nonnegative (matching a parallel stereo camera rig), every point sits at or in front of the screen. At 1.4× scale, the 95th-percentile crossed disparity hits 25.9 px (about 1.62°, or ~0.45 diopters of vergence–accommodation conflict) and pushes 7 of 20 clips past 1° of stereo window violation along the left and right edges. At 0.6× scale, that drops to 11.7 px (0.73°, ~0.20 diopters) and 0 of 20 clips.

Still, I want to be completely clear about what this study does not prove. Our four-parameter model's cross-validated loss edge over the neutral baseline (−0.018, 95% CI [−0.048, +0.011]) has a confidence interval that crosses zero. Our dataset comes from four internal viewers giving one forced choice per pair (including two ties resolved by coin flip and five setup-time technical failures that were imputed). On a brand-new video, the demo pipeline still renders three 640-pixel preview versions to measure the scene's rendered range rather than predicting it in one pass from raw RGB. Lower hole rates and smaller disparity spans are real, measured engineering trade-offs—not a closed-loop proof that a fresh group of viewers will rate the policy more comfortable inside a headset. That confirmation study is still ahead.

640 像素宽度做受控实验很趁手,可放大 3 倍投进单眼 1080p 头显,树叶、草地、牛仔布纹和小字全会发糊。为了现场演示,我在一张 96 GB RTX PRO 6000 Blackwell GPU 上搭了原生像素 Full HD 管线。光挑真正的原生输入就踩过暗坑:第一批 1080p 测试取了 4K VR180 视频的 60° 透视裁切,文件头写着 1920×1080 看着挺像样,一算角度几何才发现只有约 640 列原像素被硬拉成了 1920。我们当场作废,换回没缩过的原生 1920×1080 单目素材(进站地铁、小轮车骑手、城市街景和公园)。

在全高清管线里,深度估计和跨度测量留在 640×360,位移缩放到未降采样的 1920×1080 扭曲上,M2SVid 在每个 25 帧窗口里跑 15 块重叠 512×512 空间瓦片(128 像素重叠、潜空间混合、分块 VAE 解码),每段六秒视频耗时约五分钟,峰值显存分配 18.8 GiB。7 在云端跑满整条队列也不省心:之前监控只靠文件下载轮询,先后有三台虚拟机跑到大约 22 分钟就被回收,加上每四分钟一次的内核心跳探测后,最后一台虚拟机才稳稳连跑 6.75 小时,跑完 28 个场景零丢失。最终 31 组原生 1080p 默认对策略成片通过全帧解码与接缝检查,中位视差跨度降了 39.2%(16.82 px 降到 10.32 px)。其中「高草丛里的大猩猩」在 21 帧窗口间出现草叶重绘,我们干脆标为不推荐,绝不藏拙。

我们还量了 20 段演示视频的零视差平面位置。因为前向扭曲保持所有视差非负(等价于平行双目相机),每个点都落在屏幕平面上或屏幕前方。1.4× 下,第 95 百分位交叉视差冲到 25.9 px(约 1.62°,约 0.45 屈光度辐辏—调节冲突),20 段里有 7 段在左右边缘超 1° 立体窗口违规;0.6× 下落回 11.7 px(0.73°,约 0.20 屈光度),违规清零。

不过,这项研究「没证明什么」也得讲明白。四参数模型相对中性基线的交叉验证损失优势(−0.018,95% 置信区间 [−0.048, +0.011])依然跨着零点;标注来自四位内部观察者每对一次强迫选择(含两次抛硬币裁定的平局和五次插补的配置期故障);面对全新视频,演示管线目前还要先渲三份 640 预览去量渲染跨度,没做到从原始 RGB 单次预测。更低的空洞率和更收紧的视差是实打实的工程收益,但还不是新一批观众在头显里普遍觉得更舒服的闭环证明,那场确认实验还在后面。

Research codebases have a way of drifting away from the websites that describe them, and stereo video has an even worse problem: you can't judge 3D comfort from a flat webpage. So the second half of PixelMorph grew into two things—a verifiable research site, and a live Meta Quest WebXR exhibition system that lets a visitor walk up, submit a clip, put on a headset, and watch it in stereo.

On the web side, the React, TypeScript, Vite, Recharts, and GSAP site shares a monorepo with a Reveal.js presentation deck. A single build-time verification gate enforces a strict functional-core boundary: a static checker rejects clocks, randomness, DOM globals, and IO inside pure state models, verifies that exported research evidence and page-title manifests match their source data, checks media SHA-256 hashes, and blocks any public asset over Cloudflare Pages' 24 MB per-file limit.

Submissions, private validation, and MorphKey

For live exhibitions, visitors can bring their own clips through the browser submission flow. Videos are trimmed and normalized client-side—raw source files never hit our servers—and uploaded via short-lived conditional PUTs into private R2 storage managed by a dedicated Cloudflare Worker with D1 metadata, email OTP sessions, and CSRF protection. Finalizing a submission routes the file through a private Cloudflare Container with outbound internet completely disabled, running authenticated ffprobe and ffmpeg full-frame decoding before atomic database triggers enforce per-event quotas. If validation is unavailable, the pipeline fails closed rather than trusting client metadata.

Once accepted, each participant's detail page lazy-loads a MorphKey optical code—an animated pairing glyph adapted from Optical Pair. Staff scan the visitor's phone screen on site to pull up their submission and assign them directly to a headset without typing emails or searching lists in a crowded room.

The Hallwyl WebXR gallery on Quest 3 and Quest Pro

Inside Meta Quest Browser, playback runs on Meta's Immersive Web SDK and Three.js. Getting physical Quest hardware to render reliably took its own round of humbling debugging: our first pass enabled native WebXR composition layers and high framebuffer scaling, which looked great on desktop emulation and produced a solid black screen inside the actual headset. Rolling back to a verified projection baseline (framebuffer scale 1.0, fixed foveation 0) and high-resolution canvas textures fixed the black screen and gave us real telemetry on viewport dimensions, callback cadence, and dropped video frames.

Rather than dropping visitors into an empty black void, we retired our early procedural room and brought in a real photogrammetry scan of Stockholm's Hallwyl Museum—998,941 faces and a single 16K texture.8 To stay under Cloudflare Pages' 24 MB file limit without collapsing the room into a blurry 4K texture, a Blender and Python build pipeline decimated and repaired the mesh to 649,210 polygons (selectively closing eight slender scan tears while preserving eighteen real doorways and skylights), then clipped every triangle crossing a UV boundary to export sixteen 4128×4128 UASTC/Zstandard KTX2 mipmapped tiles so seams never crack. The script also raycasts the real floor to find an unobstructed standing origin at 1.68 m eye height and computes surface-fitted glTF anchor frames against the photogrammetry relief—zero hand-typed world coordinates at runtime.

Each physical headset (Quest 3 and Quest Pro) connects to its own hibernating Cloudflare Durable Object using an 8-hour device pairing token and 30-second single-use WebSocket tickets. Operators control prepare, pause, replay, recenter, exact frame stepping, and eye swap with 5-second command acknowledgements and serialized revision guards, so switching viewers immediately clears cached media and never leaks one person's clip into the next session.9 Once the participant holds a steady head pose for 1.5 seconds to align the room's yaw and a 4.35-second tracked greeting fades out, playback waits until the browser confirms a real decoded video frame before hiding the gallery and revealing a world-fixed curved cinema (3.5 m radius, 80° horizontal arc). One shared HTML video clock drives a single stereo mesh whose vertex shader selects the left or right half per eye in multiview—fixing an earlier multiview bug where two coincident eye meshes overwrote each other—while display-only Lavender matte tracked hands carry the PixelMorph wordmark deformed directly with the hand mesh.

研究代码库总是很容易和宣传网页各跑各的,立体视频还有个更硬的难题:隔着平面网页根本没法判断 3D 舒不舒服。于是 PixelMorph 后半段长成了两件事:一个证据可核验的研究站点,和一套线下 Meta Quest WebXR 展览系统,让观众走上前来传自己的视频、戴上头显,亲眼看立体成片。

网页端用 React、TypeScript、Vite、Recharts 与 GSAP,和 Reveal.js 演示文稿放在同一个 monorepo 里。一道构建期校验门禁守住函数式核心边界:静态检查器禁止纯状态模型里碰时钟、随机数、DOM 全局对象和 IO,核对导出的研究证据和页面标题清单与源数据一致,校验媒体 SHA-256 哈希,并拦住任何超过 Cloudflare Pages 单文件 24 MB 上限的公开资源。

观众投稿、断网验片与 MorphKey

线下展览时,观众可以直接在浏览器里投稿自己的视频。裁剪和归一化全在客户端做完,原始大文件绝不碰服务器,随后通过短时效条件 PUT 传进私有 R2 存储,由独立 Cloudflare Worker 配合 D1 元数据、邮箱 OTP 会话和 CSRF 防护托管。定稿时,文件被送进彻底断掉外网出口的私有 Cloudflare Container,跑认证过的 ffprobe 和 ffmpeg 全帧解码,再由原子数据库触发器卡死单场配额。验片容器一旦不可用,管线直接失败关闭,绝不轻信客户端报上来的元数据。

审核通过后,每位参与者的详情页会懒加载一枚 MorphKey 光学码(改编自 Optical Pair 的动态配对图形)。工作人员扫一下观众手机屏幕,立刻就能拉出投稿记录并分配到指定头显,省去在吵闹展厅里敲邮箱、翻列表的麻烦。

Quest 3 与 Quest Pro 里的 Hallwyl WebXR 展厅

在 Meta Quest Browser 里,播放基于 Meta Immersive Web SDK 与 Three.js。让真机稳稳出画面又经历了一轮扎心的排障:第一版开了原生 WebXR 合成层和高帧缓冲缩放,桌面模拟看着锐利无比,戴上真机却是一整块黑屏。回退到验证过的投影基线(帧缓冲缩放 1.0、固定注视点渲染 0)配高分辨率画布纹理才修好黑屏,并拿到了视口尺寸、回调节拍和丢帧的真实遥测。

我们没把观众扔进黑漆漆的空房间,而是换掉了早期程序化场景,引入斯德哥尔摩 Hallwyl 博物馆的真实摄影测量扫描(998,941 个三角面、一张 16K 纹理)。8 为了不把展厅压成模糊 4K 又守住 Cloudflare Pages 的 24 MB 单文件上限,一套 Blender 与 Python 管线把网格减面修复到 649,210 面(只补 8 条细长扫描裂缝,保留 18 处真实门洞和天窗),再把跨 UV 边界的三角形裁开,导出 16 张 4128×4128 的 UASTC/Zstandard KTX2 瓦片,接缝绝不开裂。脚本还对真实地面做射线检测,自动算出眼高 1.68 m 的无遮挡站立原点,贴着扫描起伏算出 glTF 锚点坐标系,运行时零手写世界坐标。

每台物理头显(Quest 3 与 Quest Pro)凭 8 小时设备配对令牌和 30 秒一次性 WebSocket 票据,连到各自的休眠式 Cloudflare Durable Object。操作员可以下发预加载、暂停、重播、重置中心、逐帧步进和左右眼互换,所有指令带 5 秒回执与串行修订守卫,换观众时立刻清掉缓存媒体,绝不串片。9 观众头部稳住 1.5 秒对齐展厅朝向、4.35 秒追踪欢迎语淡出后,系统等到浏览器确认真的解出视频帧再收起博物馆,切进世界固定的曲面影院(半径 3.5 m、水平弧度 80°)。一根共享 HTML 视频时钟驱动单一立体网格,顶点着色器在 Multiview 下按眼切取左右半幅(修掉了早期双重合网格互相覆盖的 Bug),同时仅作展示的薰衣草哑光追踪双手表面带着随手部网格形变的 PixelMorph 字标。

Notes注释

  1. Assuming a 1920-pixel eye spanning 40.1° horizontally (46° diagonal at 16:9), one 640-wide render pixel subtends roughly 0.063°. RayNeo describes the virtual screen as a 201-inch display at ~6 m, which matches this field of view, though true optical focal distance was not measured directly.↩︎按单眼 1920 像素对应水平 40.1°(16:9 下 46° 对角)算,640 宽工作分辨率下单像素约占 0.063°。RayNeo 把虚拟屏描述为约 6 m 处的 201 英寸显示,与此视场角吻合,不过真实光学焦距未直接实测。↩︎
  2. We ran Apple's ml-isqoe across all 244 scale-comparison pairs. The source-clustered bootstrap difference between iSQoE mean and the 'always flatter' heuristic was +0.012 [−0.024, +0.049]. Adding standardized iSQoE difference to our ideal-point model slightly worsened cross-validated loss (0.6916 vs 0.6900).↩︎我们在全部 244 组缩放对比上跑了 Apple ml-isqoe。iSQoE 均值与「永远更扁平」启发式的按源聚类自助法差值为 +0.012 [−0.024, +0.049];把标准化 iSQoE 差值塞进理想点模型反而略微恶化交叉验证损失(0.6916 对 0.6900)。↩︎
  3. Because our pair selector prioritized the largest predicted visual difference, 219 of the 245 final pairs compared 0.6× against 1.4× scale, and the within-scene spacing parameter k appeared in only one test pair. As a result, the first-round preference evidence is effectively about disparity scale s alone.↩︎因为配对选择器优先挑预测视觉差异最大的组合,245 组最终配对里有 219 组比的是 0.6× 和 1.4× 缩放,场景内间距参数 k 只在 1 组测试对里出现。所以首轮偏好证据实质上主要针对视差缩放 s。↩︎
  4. We also noticed a deterministic nuance in M2SVid's 25-frame windows: keeping 21-frame cores without crossfading creates a subtle right-eye jump roughly every 0.9 seconds at 24 FPS. Fixing that cleanly requires overlapping windows with crossfading and a video-consistent depth model, which we logged as renderer limitations rather than hiding.↩︎我们也记下了 M2SVid 25 帧窗口的确定性特点:只留 21 帧核心而不做交叉淡化,在 24 FPS 下每隔约 0.9 秒会有微弱右眼跳变。彻底消除需要重叠窗口淡化和时间一致深度模型,我们把它如实记为渲染器局限。↩︎
  5. With a viewer-offset prior standard deviation of 0.30, a single 0.6×-versus-1.4× choice carries Fisher information of ~0.18 against prior precision of ~11. After 5 answers, posterior SD only drops from 0.30 to 0.29; even after 60 answers it only reaches 0.21.↩︎观察者偏移先验标准差为 0.30(精度约 11)时,单次 0.6× 对 1.4× 选择的 Fisher 信息量仅约 0.18。答 5 题后验标准差只从 0.30 降到 0.29,答 60 题也才降到 0.21。↩︎
  6. The model's input coordinate is R = exp(mean(log(span_s) − log(s))), computed from sparse-match q90–q10 disparity span across rendered versions, not raw Depth Anything quantiles. Replaying the locked SHA-256 policy over the 76 held-out scenes reproduces 41 choices at 0.6×, 35 at 1.0×, and 0 at 1.4× (mean span 8.67 px, mean pre-inpaint hole fraction 1.62%).↩︎模型输入坐标 R = exp(mean(log(span_s) − log(s))),由渲染版本间的稀疏匹配 q90–q10 视差跨度算出,而非原始 Depth Anything 分位数。在 76 个留出场景上重放 SHA-256 锁定策略,复现 41 次 0.6×、35 次 1.0× 与 0 次 1.4×(平均跨度 8.67 px,补全前平均空洞 1.62%)。↩︎
  7. Each 144-frame native 1080p clip took ~303 seconds on the Blackwell GPU with 18.76 GiB peak allocated VRAM (45.60 GiB reserved), generating a 1920×1088 canvas and cropping eight rows without ever upscaling generated RGB.↩︎每段 144 帧原生 1080p 视频在 Blackwell GPU 上跑约 303 秒,峰值分配显存 18.76 GiB(预留 45.60 GiB),生成 1920×1088 画布后裁去 8 行,全程不放大生成 RGB。↩︎
  8. The Hallwyl scan materials are converted at runtime to unlit sRGB textures with anisotropy and ACES filmic tone mapping at restrained exposure to recover lost scan contrast, while status text and stereo video remain un-tonemapped so typography and source colors stay exact.↩︎Hallwyl 扫描材质在运行时转为无光照 sRGB 纹理,配合各向异性过滤与克制的 ACES 电影感色调映射找回扫描反差;状态文字与立体视频则保持无色调映射,保证字体与原片色彩不走样。↩︎
  9. Headset sessions fail closed if the control WebSocket drops, never queue offline playback commands across reconnects, and disable operator controls whenever headset telemetry goes stale. A desktop preview route lets us inspect the curved cinema and stereo shader crops without a physical headset.↩︎控制 WebSocket 一旦断开,头显会话直接失败关闭,绝不跨重连排队离线指令,遥测过期时自动禁用操作员按钮。桌面预览路由让我们不用戴真机也能查曲面影院与着色器裁切。↩︎

Built across a Python/PyTorch research workspace (Depth Anything V2, M2SVid, Modal, Blackwell GPU) and a React/TypeScript/Cloudflare Workers WebXR platform (Meta IWSDK, Durable Objects, D1/R2, Cloudflare Containers).横跨 Python/PyTorch 研究工作区(Depth Anything V2、M2SVid、Modal、Blackwell GPU)与 React/TypeScript/Cloudflare Workers WebXR 平台(Meta IWSDK、Durable Objects、D1/R2、Cloudflare Containers)完成。

Stack: M2SViD, Depth Anything V2, DINOv3, Multimodal ML, XR.技术栈:M2SViD、Depth Anything V2、DINOv3、Multimodal ML、XR。