Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dab536987a | ||
|
|
444ee56c6a |
@@ -1,4 +0,0 @@
|
||||
node_modules/
|
||||
dist/
|
||||
evidence/_video/
|
||||
public/bundle.js
|
||||
@@ -1,46 +0,0 @@
|
||||
# HEL-702 · 独立3D角色换装/动作/环境 技术验证包
|
||||
|
||||
隔离试验目录:不依赖、不修改生产 `web/`,未部署。所有结论基于本目录实际运行结果(2026-10-20)。
|
||||
|
||||
## 结论速览(均已实测,非设想)
|
||||
|
||||
| 验证项 | 结果 | 证据 |
|
||||
|---|---|---|
|
||||
| VRM 角色浏览器加载 | ✅ 两个模型(pixiv/VirtualCast)加载成功,152ms | `evidence/runtime-stats.json`, 截图01/09 |
|
||||
| 换装(非改色) | ✅ 原始套装 ↔ 自制连帽衫+长裤(不同几何,绑定同一骨架)切换 | 截图02/03 |
|
||||
| 站/坐/阅读 | ✅ 坐姿 hips=0.515m 精确对齐椅面0.46m;书本距两手各0.095m | 截图04/05 + probe 数据 |
|
||||
| 环境↔角色解耦 | ✅ 昼夜+晴雨切换后 19骨四元数 maxDelta=0(程序断言) | `decouplingAssert: {pass:true}` |
|
||||
| 视线/表情交互 | ✅ 视线转向镜头时眼球偏转+happy表情权重0→0.9 | 截图07/07b/07c |
|
||||
| 标准动画文件播放 | ✅ test.vrma(VRMA 1.0)跨模型重定向播放 | 截图08/08b, 录屏 |
|
||||
| 真实天气接口 | ✅ Open-Meteo 无Key 取得3城市气温/降水/天气码/日出日落 + 中文地理编码 | `evidence/weather/*.json` |
|
||||
| 性能实测 | 67k三角/61 draw calls/27纹理/42MB JS堆;SwiftShader软渲染24fps(下界) | `runtime-stats.json` |
|
||||
|
||||
## 复现步骤
|
||||
|
||||
```bash
|
||||
cd experiments/hel-702-3d-verify
|
||||
npm install
|
||||
npx esbuild src/main.js --bundle --format=esm --outfile=public/bundle.js
|
||||
# 浏览器人工查看: 任一静态服务器指向本目录, 路由 / -> public/index.html, /assets/ -> assets/
|
||||
# 自动取证(截图+录屏+数据):
|
||||
node capture/capture.mjs # 完整序列(约90s, 需 playwright chromium)
|
||||
node capture/capture.mjs --shot 'state={"action":"read","time":"night","weather":"rain"}' cam=main out=x.png
|
||||
```
|
||||
|
||||
页面 URL 参数:`?model=twist|seed&cam=main|front|wide|closeup`。
|
||||
运行时控制台 API:`__app.setState({outfit:'A'|'B', action:'stand'|'sit'|'read'|'vrma', time:'day'|'night', weather:'sunny'|'rain', gaze:'idle'|'camera'})`,`__app.snapshotPose()` / `__app.assertPosePreserved()`(环境切换姿态保持断言),`__app.probe()`(骨骼/道具几何数据)。
|
||||
|
||||
## 素材与授权(详见 assets/manifest.json)
|
||||
|
||||
- `VRM1_Constraint_Twist_Sample.vrm` — pixiv Inc., VRM Public License 1.0(允许改変/再配布的公开授权,内嵌元数据可在运行时读取,本页已读取展示)。来源 vrm-c/vrm-specification 官方样例仓库,sha256 见 manifest。
|
||||
- `Seed-san.vrm` — VirtualCast, Inc., 同上。
|
||||
- `test.vrma` — three-vrm(MIT) 仓库示例动画。
|
||||
- 服装B(连帽衫+长裤)为本验证自制占位几何,只证明"同一骨架绑定两套不同服装并切换"的管线,正式服装属于后续美术施工。
|
||||
|
||||
## 关键设计(供正式施工沿用)
|
||||
|
||||
1. 环境状态(time/weather/灯光/雨)与角色状态(outfit/action/gaze)在代码层完全隔离,环境更新不触碰 `vrm` 对象 —— 天气刷新不会导致角色重建或姿势重置。
|
||||
2. 姿势走 VRM normalized 人形骨架(任何 VRM 通用),目标四元数 + 指数平滑 = 动作自然过渡;坐姿按家具实测高度计算 hips 偏移。
|
||||
3. 道具(书本)按帧放在两手骨骼中点并对齐角色朝向,不依赖特定模型手型。
|
||||
4. 服装=骨架上的独立网格集合:原生 VRoid 模型 Tops/Bottoms/Shoes 本就是独立 skinned primitive,切换=可见性/几何集合切换,骨架不动。
|
||||
5. 行为/心情接口预留:`__app.setState({gaze})` 即注意力接口雏形;八字/心情引擎接入点在 `applyState` 的角色段,本轮未接(明确标记:非真实状态引擎驱动)。
|
||||
@@ -1,54 +0,0 @@
|
||||
{
|
||||
"note": "HEL-702 素材清单:来源/哈希/授权(生成于 2026-10-20)",
|
||||
"assets": [
|
||||
{
|
||||
"file": "VRM1_Constraint_Twist_Sample.vrm",
|
||||
"sizeBytes": 10776032,
|
||||
"sizeMB": "10.3",
|
||||
"sha256": "12c2b97e95e700783a6a550dc0eee2d7880aeedccef9ae67bc4c5a2f0f2631a2",
|
||||
"source": "https://github.com/vrm-c/vrm-specification/tree/master/samples/VRM1_Constraint_Twist_Sample",
|
||||
"author": "pixiv Inc.",
|
||||
"license": "VRM Public License 1.0",
|
||||
"licenseUrl": "https://vrm.dev/licenses/1.0/",
|
||||
"embeddedMeta": {
|
||||
"name": "VRM1_Constraint_Twist_Sample",
|
||||
"authors": ["pixiv Inc."],
|
||||
"licenseUrl": "https://vrm.dev/licenses/1.0/",
|
||||
"commercialUssageName": null,
|
||||
"modificationName": null,
|
||||
"redistributionName": null
|
||||
},
|
||||
"structure": "3 skinned meshes (Body 5 prims / Face 7 prims / Hair), 83 skin joints, VRoid 材质分区: Tops_01_CLOTH / Bottoms_01_CLOTH / Shoes_01_CLOTH 独立 primitive, 19/19 标准人形骨骼齐全, 57 表情形态键"
|
||||
},
|
||||
{
|
||||
"file": "Seed-san.vrm",
|
||||
"sizeBytes": 10917800,
|
||||
"sizeMB": "10.4",
|
||||
"sha256": "624d0d554bc205bbdc33e22a68a2c3c20edebb3e573011ead8878a65e5329b23",
|
||||
"source": "https://github.com/vrm-c/vrm-specification/tree/master/samples/Seed-san",
|
||||
"author": "VirtualCast, Inc.",
|
||||
"license": "VRM Public License 1.0",
|
||||
"licenseUrl": "https://vrm.dev/licenses/1.0/",
|
||||
"embeddedMeta": {
|
||||
"name": "Seed-san",
|
||||
"authors": ["VirtualCast, Inc."],
|
||||
"licenseUrl": "https://vrm.dev/licenses/1.0/"
|
||||
},
|
||||
"structure": "5 skinned meshes, wear 网格 12 个材质 primitive, 23 skin joints, 43 形态键, PBR+MToon 混合(验证 MToon 兼容性用)"
|
||||
},
|
||||
{
|
||||
"file": "test.vrma",
|
||||
"sizeBytes": 11548,
|
||||
"sha256": "38d0fd12d61e896f1a970b5e358ebb41a96c8d5ee8e284496ea18f0ba1f04e7b",
|
||||
"source": "https://github.com/pixiv/three-vrm/tree/dev/packages/three-vrm-animation/examples/models",
|
||||
"author": "pixiv Inc. (three-vrm, MIT)",
|
||||
"license": "MIT (作为 three-vrm 仓库示例文件分发)",
|
||||
"content": "VRM Animation 1.0 示例:51 骨骼映射 + happy 表情 + lookAt 通道,3 动画通道(旋转/位移),用于验证标准动画文件加载与重定向"
|
||||
}
|
||||
],
|
||||
"runtimeDeps": {
|
||||
"three": "^0.170.0 (MIT)",
|
||||
"@pixiv/three-vrm": "^3.4.2 (MIT)",
|
||||
"@pixiv/three-vrm-animation": "^3.4.2 (MIT)"
|
||||
}
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/* HEL-702 证据采集:headless Chromium (SwiftShader) 驱动验证页,截图 + 录屏 + 运行数据 */
|
||||
import { chromium } from 'playwright';
|
||||
import http from 'node:http';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const ROOT = path.resolve(path.dirname(new URL(import.meta.url).pathname), '..');
|
||||
const PUB = path.join(ROOT, 'public');
|
||||
const PORT = 8931;
|
||||
|
||||
const MIME = { '.html': 'text/html', '.js': 'text/javascript', '.json': 'application/json', '.vrm': 'model/gltf-binary', '.vrma': 'model/gltf-binary', '.png': 'image/png' };
|
||||
const server = http.createServer((req, res) => {
|
||||
const url = req.url.split('?')[0];
|
||||
let p;
|
||||
if (url === '/' || url === '/index.html') p = path.join(ROOT, 'public', 'index.html');
|
||||
else if (url.startsWith('/assets/')) p = path.join(ROOT, url.slice(1));
|
||||
else if (url === '/bundle.js') p = path.join(ROOT, 'public', 'bundle.js');
|
||||
else { res.writeHead(404); res.end('nf'); return; }
|
||||
fs.readFile(p, (e, buf) => {
|
||||
if (e) { res.writeHead(404); res.end('nf'); return; }
|
||||
res.writeHead(200, { 'content-type': MIME[path.extname(p)] || 'application/octet-stream' });
|
||||
res.end(buf);
|
||||
});
|
||||
});
|
||||
await new Promise((r) => server.listen(PORT, r));
|
||||
|
||||
const SHOT = process.argv.includes('--shot'); // 单镜头模式: --shot state=json cam=name out=xx.png
|
||||
const arg = (k) => process.argv.slice(2).find((a) => a.startsWith(k + '='))?.slice(k.length + 1);
|
||||
|
||||
const outDir = path.join(ROOT, 'evidence', 'shots');
|
||||
fs.mkdirSync(outDir, { recursive: true });
|
||||
|
||||
const browser = await chromium.launch({ args: ['--use-angle=swiftshader', '--enable-unsafe-swiftshader'] });
|
||||
|
||||
async function session({ video = false } = {}) {
|
||||
const ctx = await browser.newContext({
|
||||
viewport: { width: 960, height: 540 },
|
||||
recordVideo: video ? { dir: path.join(ROOT, 'evidence', '_video'), size: { width: 960, height: 540 } } : undefined,
|
||||
});
|
||||
const page = await ctx.newPage();
|
||||
page.on('console', (m) => { if (m.type() === 'error') console.error('[page err]', m.text()); });
|
||||
page.on('pageerror', (e) => console.error('[page throw]', e.message, (e.stack?.split('\n').slice(1, 8).join('\n') || '')));
|
||||
return { ctx, page };
|
||||
}
|
||||
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
|
||||
if (SHOT) {
|
||||
const { ctx, page } = await session();
|
||||
const state = JSON.parse(arg('state') || '{}');
|
||||
const cam = arg('cam') || 'main';
|
||||
const model = arg('model') || 'twist';
|
||||
const out = path.join(outDir, arg('out') || 'shot.png');
|
||||
await page.goto(`http://localhost:${PORT}/?cam=${cam}&model=${model}`);
|
||||
await page.waitForFunction(() => window.__app?.ready === true, null, { timeout: 60000 });
|
||||
await sleep(600);
|
||||
await page.evaluate((s) => window.__app.setState(s), state);
|
||||
await sleep(arg('wait') ? parseInt(arg('wait')) : 1600);
|
||||
await page.screenshot({ path: out });
|
||||
const stats = await page.evaluate(() => JSON.parse(JSON.stringify(window.__stats)));
|
||||
const probe = await page.evaluate(() => window.__app.probe());
|
||||
console.log('shot saved:', out);
|
||||
console.log('probe:', JSON.stringify(probe));
|
||||
console.log('stats:', JSON.stringify({ fps: stats.fps, loadMs: stats.loadMs, info: stats.info, meta: stats.modelMeta }));
|
||||
await ctx.close();
|
||||
} else {
|
||||
/* 完整证据序列(含录屏) */
|
||||
const { ctx, page } = await session({ video: true });
|
||||
await page.goto(`http://localhost:${PORT}/?cam=main&model=twist`);
|
||||
await page.waitForFunction(() => window.__app?.ready === true, null, { timeout: 60000 });
|
||||
await sleep(1200);
|
||||
|
||||
const cap = async (name, state, wait = 1500, caption) => {
|
||||
await page.evaluate((c) => { const el = document.getElementById('caption'); el.textContent = c; el.style.opacity = 1; }, caption || '');
|
||||
await page.evaluate((s) => window.__app.setState(s), state);
|
||||
await sleep(wait);
|
||||
await page.screenshot({ path: path.join(outDir, name) });
|
||||
const probe = await page.evaluate(() => window.__app.probe());
|
||||
globalProbes[name] = probe;
|
||||
console.log('captured', name, JSON.stringify(probe));
|
||||
};
|
||||
const globalProbes = {};
|
||||
|
||||
await cap('01-meta-stand-day-sunny.png', { outfit: 'A', action: 'stand', time: 'day', weather: 'sunny', gaze: 'idle' }, 1200,
|
||||
'① VRM 实时加载 · 站立 · 白天/晴(HUD 显示模型内嵌授权元数据)');
|
||||
await cap('02-outfitA-front.png', { outfit: 'A', action: 'stand' }, 1500, '② 服装A:原始 Tops+Bottoms+Shoes');
|
||||
await page.evaluate(() => window.__app.snapshotPose());
|
||||
await cap('03-outfitB-front.png', { outfit: 'B', action: 'stand' }, 1800, '③ 服装B:自制连帽衫+长裤(不同几何,非改色)· 骨架未动');
|
||||
await cap('04-sit-day.png', { action: 'sit' }, 2000, '④ 坐下:hips 对齐椅面高度 0.46m,过渡平滑');
|
||||
await cap('05-read-day.png', { action: 'read', gaze: 'idle' }, 2000, '⑤ 阅读:书本绑定右手原始骨骼,视线落在书页');
|
||||
await page.evaluate(() => window.__app.snapshotPose());
|
||||
await cap('06-read-night-rain.png', { time: 'night', weather: 'rain' }, 2500, '⑥ 夜晚+雨:环境切换 · 姿态保持(HUD 显示断言结果)');
|
||||
const decoupling = await page.evaluate(() => window.__app.assertPosePreserved());
|
||||
console.log('decoupling assert:', JSON.stringify(decoupling));
|
||||
await page.screenshot({ path: path.join(outDir, '06b-decouple-assert.png') });
|
||||
await cap('07-gaze-camera.png', { gaze: 'camera' }, 1500, '⑦ 交互注意力:视线转向镜头 + happy 表情');
|
||||
await cap('08-vrma-play.png', { action: 'vrma', gaze: 'idle' }, 2500, '⑧ 播放标准 VRMA 动画文件(跨模型重定向)');
|
||||
await page.screenshot({ path: path.join(outDir, '08b-vrma-mid.png') });
|
||||
|
||||
/* 姿态保持 + 运行数据 */
|
||||
const stats = await page.evaluate(() => JSON.parse(JSON.stringify(window.__stats)));
|
||||
/* fps 稳态测量:连续采样 6s */
|
||||
const fps = await page.evaluate(async () => {
|
||||
await new Promise((r) => setTimeout(r, 6000));
|
||||
return { fps: window.__stats.fps, info: window.__stats.info, heapMB: window.__stats.heapMB ?? null };
|
||||
});
|
||||
stats.steady = fps;
|
||||
stats.decouplingAssert = decoupling;
|
||||
stats.userAgent = await page.evaluate(() => navigator.userAgent);
|
||||
stats.environment = 'headless chromium + SwiftShader software WebGL2 (无GPU沙箱的下界测量)';
|
||||
stats.probes = globalProbes;
|
||||
fs.writeFileSync(path.join(ROOT, 'evidence', 'runtime-stats.json'), JSON.stringify(stats, null, 2));
|
||||
console.log('stats saved');
|
||||
const video = page.video();
|
||||
const vidPath = await video.path();
|
||||
await ctx.close(); /* finalizes video */
|
||||
if (vidPath && fs.existsSync(vidPath)) {
|
||||
const dest = path.join(ROOT, 'evidence', 'hel-702-verify-demo.webm');
|
||||
fs.copyFileSync(vidPath, dest);
|
||||
console.log('video saved:', dest);
|
||||
}
|
||||
}
|
||||
|
||||
/* Seed-san 第二模型验证(管线通用性 + MToon/PBR 混合) */
|
||||
{
|
||||
const { ctx, page } = await session();
|
||||
await page.goto(`http://localhost:${PORT}/?cam=main&model=seed`);
|
||||
await page.waitForFunction(() => window.__app?.ready === true, null, { timeout: 60000 });
|
||||
await sleep(1500);
|
||||
await page.evaluate(() => window.__app.setState({ outfit: 'A', action: 'stand' }));
|
||||
await sleep(1200);
|
||||
await page.screenshot({ path: path.join(outDir, '09-seedsan-load.png') });
|
||||
const meta = await page.evaluate(() => window.__stats.modelMeta);
|
||||
const load = await page.evaluate(() => window.__stats.loadMs);
|
||||
fs.writeFileSync(path.join(ROOT, 'evidence', 'seed-san-runtime.json'), JSON.stringify({ meta, loadMs: load }, null, 2));
|
||||
console.log('seed-san ok:', JSON.stringify(meta), 'loadMs', load);
|
||||
await ctx.close();
|
||||
}
|
||||
|
||||
await browser.close();
|
||||
server.close();
|
||||
@@ -1,380 +0,0 @@
|
||||
{
|
||||
"modelMeta": {
|
||||
"name": "VRM1_Constraint_Twist_Sample",
|
||||
"authors": [
|
||||
"pixiv Inc."
|
||||
],
|
||||
"licenseUrl": "https://vrm.dev/licenses/1.0/",
|
||||
"commercialUssageName": "(未设置→按VRM PL 1.0默认)",
|
||||
"modificationName": "(未设置→按VRM PL 1.0默认)",
|
||||
"allowedUserName": "(未设置)"
|
||||
},
|
||||
"asset": {
|
||||
"file": "VRM1_Constraint_Twist_Sample.vrm",
|
||||
"sizeBytes": 10776032,
|
||||
"sizeMB": "10.3",
|
||||
"sha256": "12c2b97e95e700783a6a550dc0eee2d7880aeedccef9ae67bc4c5a2f0f2631a2",
|
||||
"source": "https://github.com/vrm-c/vrm-specification/tree/master/samples/VRM1_Constraint_Twist_Sample",
|
||||
"author": "pixiv Inc.",
|
||||
"license": "VRM Public License 1.0",
|
||||
"licenseUrl": "https://vrm.dev/licenses/1.0/",
|
||||
"embeddedMeta": {
|
||||
"name": "VRM1_Constraint_Twist_Sample",
|
||||
"authors": [
|
||||
"pixiv Inc."
|
||||
],
|
||||
"licenseUrl": "https://vrm.dev/licenses/1.0/",
|
||||
"commercialUssageName": null,
|
||||
"modificationName": null,
|
||||
"redistributionName": null
|
||||
},
|
||||
"structure": "3 skinned meshes (Body 5 prims / Face 7 prims / Hair), 83 skin joints, VRoid 材质分区: Tops_01_CLOTH / Bottoms_01_CLOTH / Shoes_01_CLOTH 独立 primitive, 19/19 标准人形骨骼齐全, 57 表情形态键"
|
||||
},
|
||||
"loadMs": 152,
|
||||
"fps": 20,
|
||||
"info": {
|
||||
"calls": 61,
|
||||
"triangles": 67298,
|
||||
"textures": 27,
|
||||
"geometries": 58
|
||||
},
|
||||
"heapMB": 42,
|
||||
"steady": {
|
||||
"fps": 24,
|
||||
"info": {
|
||||
"calls": 61,
|
||||
"triangles": 67298,
|
||||
"textures": 27,
|
||||
"geometries": 58
|
||||
},
|
||||
"heapMB": 42
|
||||
},
|
||||
"decouplingAssert": {
|
||||
"pass": true,
|
||||
"maxDelta": 0
|
||||
},
|
||||
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/156.0.8078.4 Safari/537.36",
|
||||
"environment": "headless chromium + SwiftShader software WebGL2 (无GPU沙箱的下界测量)",
|
||||
"probes": {
|
||||
"01-meta-stand-day-sunny.png": {
|
||||
"headY": 1.387,
|
||||
"hipsY": 0.908,
|
||||
"footMinY": 0.101,
|
||||
"kneeFwd": -0.043,
|
||||
"faceAngleToCamDeg": 10.9,
|
||||
"bookToRHand": null,
|
||||
"bookToLHand": null,
|
||||
"handDist": 0.475,
|
||||
"rHandPos": [
|
||||
-0.55,
|
||||
0.87,
|
||||
0.39
|
||||
],
|
||||
"lHandPos": [
|
||||
-0.12,
|
||||
0.87,
|
||||
0.18
|
||||
],
|
||||
"headPos": [
|
||||
-0.3,
|
||||
1.39,
|
||||
0.34
|
||||
],
|
||||
"bbox": [
|
||||
0.607,
|
||||
1.617,
|
||||
0.469
|
||||
],
|
||||
"eyeYaw": 491.3,
|
||||
"happyWeight": 0,
|
||||
"rootPos": [
|
||||
-0.3,
|
||||
0,
|
||||
0.35
|
||||
],
|
||||
"rootYaw": 0.45,
|
||||
"seatY": 0.46,
|
||||
"outfitBBound": true
|
||||
},
|
||||
"02-outfitA-front.png": {
|
||||
"headY": 1.386,
|
||||
"hipsY": 0.908,
|
||||
"footMinY": 0.101,
|
||||
"kneeFwd": -0.044,
|
||||
"faceAngleToCamDeg": 10.5,
|
||||
"bookToRHand": null,
|
||||
"bookToLHand": null,
|
||||
"handDist": 0.475,
|
||||
"rHandPos": [
|
||||
-0.54,
|
||||
0.87,
|
||||
0.39
|
||||
],
|
||||
"lHandPos": [
|
||||
-0.12,
|
||||
0.87,
|
||||
0.19
|
||||
],
|
||||
"headPos": [
|
||||
-0.31,
|
||||
1.39,
|
||||
0.33
|
||||
],
|
||||
"bbox": [
|
||||
0.607,
|
||||
1.617,
|
||||
0.469
|
||||
],
|
||||
"eyeYaw": 376.2,
|
||||
"happyWeight": 0,
|
||||
"rootPos": [
|
||||
-0.3,
|
||||
0,
|
||||
0.35
|
||||
],
|
||||
"rootYaw": 0.45,
|
||||
"seatY": 0.46,
|
||||
"outfitBBound": true
|
||||
},
|
||||
"03-outfitB-front.png": {
|
||||
"headY": 1.386,
|
||||
"hipsY": 0.908,
|
||||
"footMinY": 0.101,
|
||||
"kneeFwd": -0.044,
|
||||
"faceAngleToCamDeg": 10.5,
|
||||
"bookToRHand": null,
|
||||
"bookToLHand": null,
|
||||
"handDist": 0.475,
|
||||
"rHandPos": [
|
||||
-0.54,
|
||||
0.87,
|
||||
0.39
|
||||
],
|
||||
"lHandPos": [
|
||||
-0.11,
|
||||
0.87,
|
||||
0.19
|
||||
],
|
||||
"headPos": [
|
||||
-0.31,
|
||||
1.39,
|
||||
0.33
|
||||
],
|
||||
"bbox": [
|
||||
0.607,
|
||||
1.617,
|
||||
0.469
|
||||
],
|
||||
"eyeYaw": -362.9,
|
||||
"happyWeight": 0,
|
||||
"rootPos": [
|
||||
-0.3,
|
||||
0,
|
||||
0.35
|
||||
],
|
||||
"rootYaw": 0.45,
|
||||
"seatY": 0.46,
|
||||
"outfitBBound": true
|
||||
},
|
||||
"04-sit-day.png": {
|
||||
"headY": 0.995,
|
||||
"hipsY": 0.515,
|
||||
"footMinY": 0.01,
|
||||
"kneeFwd": 0.353,
|
||||
"faceAngleToCamDeg": 34.8,
|
||||
"bookToRHand": null,
|
||||
"bookToLHand": null,
|
||||
"handDist": 0.475,
|
||||
"rHandPos": [
|
||||
0.41,
|
||||
0.48,
|
||||
-0.04
|
||||
],
|
||||
"lHandPos": [
|
||||
0.87,
|
||||
0.48,
|
||||
0.1
|
||||
],
|
||||
"headPos": [
|
||||
0.62,
|
||||
1,
|
||||
0.11
|
||||
],
|
||||
"bbox": [
|
||||
0.603,
|
||||
1.617,
|
||||
0.666
|
||||
],
|
||||
"eyeYaw": -1164,
|
||||
"happyWeight": 0,
|
||||
"rootPos": [
|
||||
0.62,
|
||||
0,
|
||||
0.1
|
||||
],
|
||||
"rootYaw": -0.3,
|
||||
"seatY": 0.46,
|
||||
"outfitBBound": true
|
||||
},
|
||||
"05-read-day.png": {
|
||||
"headY": 0.989,
|
||||
"hipsY": 0.515,
|
||||
"footMinY": 0.01,
|
||||
"kneeFwd": 0.353,
|
||||
"faceAngleToCamDeg": 43.4,
|
||||
"bookToRHand": 0.095,
|
||||
"bookToLHand": 0.095,
|
||||
"handDist": 0.186,
|
||||
"rHandPos": [
|
||||
0.42,
|
||||
0.88,
|
||||
0.44
|
||||
],
|
||||
"lHandPos": [
|
||||
0.59,
|
||||
0.88,
|
||||
0.5
|
||||
],
|
||||
"headPos": [
|
||||
0.61,
|
||||
0.99,
|
||||
0.14
|
||||
],
|
||||
"bbox": [
|
||||
0.641,
|
||||
1.617,
|
||||
0.666
|
||||
],
|
||||
"eyeYaw": -1442.2,
|
||||
"happyWeight": 0,
|
||||
"rootPos": [
|
||||
0.62,
|
||||
0,
|
||||
0.1
|
||||
],
|
||||
"rootYaw": -0.3,
|
||||
"seatY": 0.46,
|
||||
"outfitBBound": true
|
||||
},
|
||||
"06-read-night-rain.png": {
|
||||
"headY": 0.989,
|
||||
"hipsY": 0.515,
|
||||
"footMinY": 0.01,
|
||||
"kneeFwd": 0.353,
|
||||
"faceAngleToCamDeg": 43.4,
|
||||
"bookToRHand": 0.095,
|
||||
"bookToLHand": 0.095,
|
||||
"handDist": 0.186,
|
||||
"rHandPos": [
|
||||
0.42,
|
||||
0.88,
|
||||
0.44
|
||||
],
|
||||
"lHandPos": [
|
||||
0.59,
|
||||
0.88,
|
||||
0.5
|
||||
],
|
||||
"headPos": [
|
||||
0.61,
|
||||
0.99,
|
||||
0.14
|
||||
],
|
||||
"bbox": [
|
||||
0.641,
|
||||
1.617,
|
||||
0.666
|
||||
],
|
||||
"eyeYaw": -838.3,
|
||||
"happyWeight": 0,
|
||||
"rootPos": [
|
||||
0.62,
|
||||
0,
|
||||
0.1
|
||||
],
|
||||
"rootYaw": -0.3,
|
||||
"seatY": 0.46,
|
||||
"outfitBBound": true
|
||||
},
|
||||
"07-gaze-camera.png": {
|
||||
"headY": 0.989,
|
||||
"hipsY": 0.515,
|
||||
"footMinY": 0.01,
|
||||
"kneeFwd": 0.353,
|
||||
"faceAngleToCamDeg": 43.4,
|
||||
"bookToRHand": 0.095,
|
||||
"bookToLHand": 0.095,
|
||||
"handDist": 0.186,
|
||||
"rHandPos": [
|
||||
0.42,
|
||||
0.88,
|
||||
0.44
|
||||
],
|
||||
"lHandPos": [
|
||||
0.59,
|
||||
0.88,
|
||||
0.5
|
||||
],
|
||||
"headPos": [
|
||||
0.61,
|
||||
0.99,
|
||||
0.14
|
||||
],
|
||||
"bbox": [
|
||||
0.641,
|
||||
1.617,
|
||||
0.666
|
||||
],
|
||||
"eyeYaw": 2191.6,
|
||||
"happyWeight": 0.9,
|
||||
"rootPos": [
|
||||
0.62,
|
||||
0,
|
||||
0.1
|
||||
],
|
||||
"rootYaw": -0.3,
|
||||
"seatY": 0.46,
|
||||
"outfitBBound": true
|
||||
},
|
||||
"08-vrma-play.png": {
|
||||
"headY": 0.989,
|
||||
"hipsY": 0.515,
|
||||
"footMinY": 0.01,
|
||||
"kneeFwd": 0.346,
|
||||
"faceAngleToCamDeg": 38.3,
|
||||
"bookToRHand": null,
|
||||
"bookToLHand": null,
|
||||
"handDist": 0.186,
|
||||
"rHandPos": [
|
||||
-0.09,
|
||||
0.88,
|
||||
0.39
|
||||
],
|
||||
"lHandPos": [
|
||||
0.09,
|
||||
0.88,
|
||||
0.39
|
||||
],
|
||||
"headPos": [
|
||||
0,
|
||||
0.99,
|
||||
0.04
|
||||
],
|
||||
"bbox": [
|
||||
0.597,
|
||||
1.617,
|
||||
0.598
|
||||
],
|
||||
"eyeYaw": 898.1,
|
||||
"happyWeight": 0,
|
||||
"rootPos": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"rootYaw": 0,
|
||||
"seatY": 0.46,
|
||||
"outfitBBound": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"name": "Seed-san",
|
||||
"authors": [
|
||||
"VirtualCast, Inc."
|
||||
],
|
||||
"licenseUrl": "https://vrm.dev/licenses/1.0/",
|
||||
"commercialUssageName": "(未设置→按VRM PL 1.0默认)",
|
||||
"modificationName": "(未设置→按VRM PL 1.0默认)",
|
||||
"allowedUserName": "(未设置)"
|
||||
},
|
||||
"loadMs": 121
|
||||
}
|
||||
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 146 KiB |
|
Before Width: | Height: | Size: 146 KiB |
|
Before Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 149 KiB |
|
Before Width: | Height: | Size: 149 KiB |
|
Before Width: | Height: | Size: 110 KiB |
@@ -1 +0,0 @@
|
||||
{"results":[{"id":1808926,"name":"杭州","latitude":30.29365,"longitude":120.16142,"elevation":12.0,"feature_code":"PPLA","country_code":"CN","admin1_id":1784764,"admin2_id":1808925,"timezone":"Asia/Shanghai","population":11936010,"country_id":1814991,"country":"中国","admin1":"浙江","admin2":"杭州市"},{"id":6976333,"name":"杭州","latitude":30.06517,"longitude":102.19527,"elevation":2321.0,"feature_code":"PPL","country_code":"CN","admin1_id":1794299,"admin2_id":1810269,"timezone":"Asia/Shanghai","country_id":1814991,"country":"中国","admin1":"四川","admin2":"甘孜藏族自治州"}],"generationtime_ms":0.11372566}
|
||||
@@ -1 +0,0 @@
|
||||
{"latitude":31.247803,"longitude":121.5,"generationtime_ms":0.2837181091308594,"utc_offset_seconds":28800,"timezone":"Asia/Shanghai","timezone_abbreviation":"GMT+8","elevation":3.0,"current_units":{"time":"iso8601","interval":"seconds","temperature_2m":"°C","relative_humidity_2m":"%","precipitation":"mm","weather_code":"wmo code","wind_speed_10m":"km/h"},"current":{"time":"2026-10-20T09:45","interval":900,"temperature_2m":25.4,"relative_humidity_2m":79,"precipitation":0.00,"weather_code":3,"wind_speed_10m":5.4},"daily_units":{"time":"iso8601","sunrise":"iso8601","sunset":"iso8601","temperature_2m_max":"°C","temperature_2m_min":"°C","precipitation_sum":"mm"},"daily":{"time":["2026-10-20","2026-10-21"],"sunrise":["2026-10-20T06:00","2026-10-21T06:00"],"sunset":["2026-10-20T17:17","2026-10-21T17:16"],"temperature_2m_max":[27.6,22.0],"temperature_2m_min":[21.4,15.5],"precipitation_sum":[2.60,8.90]}}
|
||||
@@ -1 +0,0 @@
|
||||
{"latitude":35.7,"longitude":139.6875,"generationtime_ms":0.12254714965820312,"utc_offset_seconds":32400,"timezone":"Asia/Tokyo","timezone_abbreviation":"GMT+9","elevation":43.0,"current_units":{"time":"iso8601","interval":"seconds","temperature_2m":"°C","relative_humidity_2m":"%","precipitation":"mm","weather_code":"wmo code","wind_speed_10m":"km/h"},"current":{"time":"2026-10-20T10:45","interval":900,"temperature_2m":24.2,"relative_humidity_2m":84,"precipitation":0.00,"weather_code":2,"wind_speed_10m":7.0},"daily_units":{"time":"iso8601","sunrise":"iso8601","sunset":"iso8601","temperature_2m_max":"°C","temperature_2m_min":"°C","precipitation_sum":"mm"},"daily":{"time":["2026-10-20","2026-10-21"],"sunrise":["2026-10-20T05:51","2026-10-21T05:52"],"sunset":["2026-10-20T16:59","2026-10-21T16:58"],"temperature_2m_max":[25.2,28.0],"temperature_2m_min":[16.4,18.4],"precipitation_sum":[0.60,1.00]}}
|
||||
@@ -1 +0,0 @@
|
||||
{"latitude":30.263618,"longitude":120.14051,"generationtime_ms":0.2598762512207031,"utc_offset_seconds":28800,"timezone":"Asia/Shanghai","timezone_abbreviation":"GMT+8","elevation":13.0,"current_units":{"time":"iso8601","interval":"seconds","temperature_2m":"°C","relative_humidity_2m":"%","precipitation":"mm","weather_code":"wmo code","wind_speed_10m":"km/h"},"current":{"time":"2026-10-20T09:45","interval":900,"temperature_2m":24.8,"relative_humidity_2m":79,"precipitation":0.00,"weather_code":3,"wind_speed_10m":2.0},"daily_units":{"time":"iso8601","sunrise":"iso8601","sunset":"iso8601","temperature_2m_max":"°C","temperature_2m_min":"°C","precipitation_sum":"mm"},"daily":{"time":["2026-10-20","2026-10-21"],"sunrise":["2026-10-20T06:04","2026-10-21T06:05"],"sunset":["2026-10-20T17:23","2026-10-21T17:22"],"temperature_2m_max":[29.4,21.4],"temperature_2m_min":[20.7,14.8],"precipitation_sum":[2.60,4.70]}}
|
||||
@@ -1,666 +0,0 @@
|
||||
{
|
||||
"name": "hel-702-3d-verify",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "hel-702-3d-verify",
|
||||
"dependencies": {
|
||||
"@pixiv/three-vrm": "^3.4.2",
|
||||
"@pixiv/three-vrm-animation": "^3.4.2",
|
||||
"esbuild": "^0.25.0",
|
||||
"playwright": "^1.49.0",
|
||||
"three": "^0.170.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
|
||||
"integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"aix"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
|
||||
"integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
|
||||
"integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
|
||||
"integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
|
||||
"integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
|
||||
"integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
|
||||
"integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
|
||||
"integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
|
||||
"integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openharmony-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openharmony"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"sunos"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
|
||||
"integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@pixiv/three-vrm": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/three-vrm/-/three-vrm-3.5.5.tgz",
|
||||
"integrity": "sha512-RPXy7jYAXs704NIpZlosB0U2ENu21G9DrqGWdQgRe8dShaCo1ugpj+6BVPRCy91nt+MPMA96j5rbsSzEl0HlQA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pixiv/three-vrm-core": "3.5.5",
|
||||
"@pixiv/three-vrm-materials-hdr-emissive-multiplier": "3.5.5",
|
||||
"@pixiv/three-vrm-materials-mtoon": "3.5.5",
|
||||
"@pixiv/three-vrm-materials-v0compat": "3.5.5",
|
||||
"@pixiv/three-vrm-node-constraint": "3.5.5",
|
||||
"@pixiv/three-vrm-springbone": "3.5.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"three": ">=0.137"
|
||||
}
|
||||
},
|
||||
"node_modules/@pixiv/three-vrm-animation": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/three-vrm-animation/-/three-vrm-animation-3.5.5.tgz",
|
||||
"integrity": "sha512-Q0kEtmftxfv0iCUHQkJH2jAr1zmT9ywYXnAzhxnLPMYCsx0Kken3J3U2GJF9PdGZmLlKpoK0LFEXVdD/L7ZA4Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pixiv/three-vrm-core": "3.5.5",
|
||||
"@pixiv/types-vrmc-vrm-1.0": "3.5.5",
|
||||
"@pixiv/types-vrmc-vrm-animation-1.0": "3.5.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"three": ">=0.137"
|
||||
}
|
||||
},
|
||||
"node_modules/@pixiv/three-vrm-core": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/three-vrm-core/-/three-vrm-core-3.5.5.tgz",
|
||||
"integrity": "sha512-jjaXZbMVRsk2HAGVxqDLmSJyGOJqbMcJpuTHR1TY/TN1FxiKdAzSqdr/ZUcczYipNf8IL9vDT9NX2XmWj+ybRQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pixiv/types-vrm-0.0": "3.5.5",
|
||||
"@pixiv/types-vrmc-vrm-1.0": "3.5.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"three": ">=0.137"
|
||||
}
|
||||
},
|
||||
"node_modules/@pixiv/three-vrm-materials-hdr-emissive-multiplier": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/three-vrm-materials-hdr-emissive-multiplier/-/three-vrm-materials-hdr-emissive-multiplier-3.5.5.tgz",
|
||||
"integrity": "sha512-XnHEqpY4ctYMucpeRcptdphOe0RrW7V5fUvojasD8Ja4MTjjrjCNFxsAvp3+HBkPZbkTM2sDCjJBJNzxN1scrA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pixiv/types-vrmc-materials-hdr-emissive-multiplier-1.0": "3.5.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"three": ">=0.137"
|
||||
}
|
||||
},
|
||||
"node_modules/@pixiv/three-vrm-materials-mtoon": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/three-vrm-materials-mtoon/-/three-vrm-materials-mtoon-3.5.5.tgz",
|
||||
"integrity": "sha512-7lThHf4OKBOsVenD+R6L6HffNUlKO3Twnhr3+z77MnUsSzsOanjVKJtjSIly9QJ6hgl8YJmI6RnxCKqXcpplog==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pixiv/types-vrm-0.0": "3.5.5",
|
||||
"@pixiv/types-vrmc-materials-mtoon-1.0": "3.5.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"three": ">=0.137"
|
||||
}
|
||||
},
|
||||
"node_modules/@pixiv/three-vrm-materials-v0compat": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/three-vrm-materials-v0compat/-/three-vrm-materials-v0compat-3.5.5.tgz",
|
||||
"integrity": "sha512-NjsTK4P4qdcr+RoL2gEUNgF2CY/aplNvyHHxI99N7D6CxDZ2H93FQ9aIuLCABj5b+4CIvldWMCcnS7YuLIr3Lw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pixiv/types-vrm-0.0": "3.5.5",
|
||||
"@pixiv/types-vrmc-materials-mtoon-1.0": "3.5.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"three": ">=0.137"
|
||||
}
|
||||
},
|
||||
"node_modules/@pixiv/three-vrm-node-constraint": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/three-vrm-node-constraint/-/three-vrm-node-constraint-3.5.5.tgz",
|
||||
"integrity": "sha512-+ShEXioZ5Ctf0EZ5ZViZ4n0jhV/qtJRH0Juw8nRnMNODZXDSr+B3An2lrfRoMhowCzG63GiUG4lXWV9noMXosA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pixiv/types-vrmc-node-constraint-1.0": "3.5.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"three": ">=0.137"
|
||||
}
|
||||
},
|
||||
"node_modules/@pixiv/three-vrm-springbone": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/three-vrm-springbone/-/three-vrm-springbone-3.5.5.tgz",
|
||||
"integrity": "sha512-GWAWrIegGH/u1ZA+Es03Qzc2yafrQOrhtal9jzUIAgU8Wm2DYuqAABOY+du/9RpBRK8D4T8DBPvRGQqvfrQ/uA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pixiv/types-vrm-0.0": "3.5.5",
|
||||
"@pixiv/types-vrmc-springbone-1.0": "3.5.5",
|
||||
"@pixiv/types-vrmc-springbone-extended-collider-1.0": "3.5.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"three": ">=0.137"
|
||||
}
|
||||
},
|
||||
"node_modules/@pixiv/types-vrm-0.0": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/types-vrm-0.0/-/types-vrm-0.0-3.5.5.tgz",
|
||||
"integrity": "sha512-2S/0jswMjJTwL9ky8YzDR0CIaP6ZmE+HFuyW/0h+SA+awELf+J7WGgC8lTLM1MXzokO7Z2YVljU2F0fEhlKDIQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@pixiv/types-vrmc-materials-hdr-emissive-multiplier-1.0": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/types-vrmc-materials-hdr-emissive-multiplier-1.0/-/types-vrmc-materials-hdr-emissive-multiplier-1.0-3.5.5.tgz",
|
||||
"integrity": "sha512-IuHw9ehXt2bymqfdFV+f2cCXo8kvJUfh0Zuut8qmKXoEb7HVyLGIQyS4TcQHG5yY22UTWHI1Axo5tQv35lPTgQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@pixiv/types-vrmc-materials-mtoon-1.0": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/types-vrmc-materials-mtoon-1.0/-/types-vrmc-materials-mtoon-1.0-3.5.5.tgz",
|
||||
"integrity": "sha512-GFVuksAJVhrWTXYmI/ucNsE611/d8N6BoZrzhUAAINndt98loyzapW2+DJu+GsUBO5yxd+vLsL0FB16XD9+TGg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@pixiv/types-vrmc-node-constraint-1.0": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/types-vrmc-node-constraint-1.0/-/types-vrmc-node-constraint-1.0-3.5.5.tgz",
|
||||
"integrity": "sha512-8EbJ1uzkn9yJQarCChmpG12+mc2c7PimHvQ8H6/tMh/hqp5NtJND0z2lR2KeVxw9A3M+TpF+xgImhLBxGjqwzQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@pixiv/types-vrmc-springbone-1.0": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/types-vrmc-springbone-1.0/-/types-vrmc-springbone-1.0-3.5.5.tgz",
|
||||
"integrity": "sha512-gRQ5Y7PaGiMefvOrJ3hvoSPqpA67jiwyhwh8ItjsPi3yri/Hn3CeXplW3Cbx3ZPbfu+C3Q2MCRa2TqAUOjeMRA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@pixiv/types-vrmc-springbone-extended-collider-1.0": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/types-vrmc-springbone-extended-collider-1.0/-/types-vrmc-springbone-extended-collider-1.0-3.5.5.tgz",
|
||||
"integrity": "sha512-+6RxLaAvVguP7upjS/OT4viNPWvac1HBRQY1nmdvfYNQuCMdrMsCZqvy2af0Fcjnda4V9JbKFIpZDC0lrw1+uQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@pixiv/types-vrmc-vrm-1.0": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/types-vrmc-vrm-1.0/-/types-vrmc-vrm-1.0-3.5.5.tgz",
|
||||
"integrity": "sha512-WnemHHo2375BcBdumEhvrupZzsMSzTfdWlokmV9sUX2oC+OAQqJFfBjLF8ppkOhzHpl4MAPJqEfuhBJtNPm9ww==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@pixiv/types-vrmc-vrm-animation-1.0": {
|
||||
"version": "3.5.5",
|
||||
"resolved": "https://registry.npmmirror.com/@pixiv/types-vrmc-vrm-animation-1.0/-/types-vrmc-vrm-animation-1.0-3.5.5.tgz",
|
||||
"integrity": "sha512-pyow6wBLdRZbLQbtHqu8uvYG+NXJbwIiLVK6pM6UvtaYotecOv43t6qIdMLYuieV+F+bEJcdfOLFZZVolrOOcQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pixiv/types-vrmc-vrm-1.0": "3.5.5"
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.25.12.tgz",
|
||||
"integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.25.12",
|
||||
"@esbuild/android-arm": "0.25.12",
|
||||
"@esbuild/android-arm64": "0.25.12",
|
||||
"@esbuild/android-x64": "0.25.12",
|
||||
"@esbuild/darwin-arm64": "0.25.12",
|
||||
"@esbuild/darwin-x64": "0.25.12",
|
||||
"@esbuild/freebsd-arm64": "0.25.12",
|
||||
"@esbuild/freebsd-x64": "0.25.12",
|
||||
"@esbuild/linux-arm": "0.25.12",
|
||||
"@esbuild/linux-arm64": "0.25.12",
|
||||
"@esbuild/linux-ia32": "0.25.12",
|
||||
"@esbuild/linux-loong64": "0.25.12",
|
||||
"@esbuild/linux-mips64el": "0.25.12",
|
||||
"@esbuild/linux-ppc64": "0.25.12",
|
||||
"@esbuild/linux-riscv64": "0.25.12",
|
||||
"@esbuild/linux-s390x": "0.25.12",
|
||||
"@esbuild/linux-x64": "0.25.12",
|
||||
"@esbuild/netbsd-arm64": "0.25.12",
|
||||
"@esbuild/netbsd-x64": "0.25.12",
|
||||
"@esbuild/openbsd-arm64": "0.25.12",
|
||||
"@esbuild/openbsd-x64": "0.25.12",
|
||||
"@esbuild/openharmony-arm64": "0.25.12",
|
||||
"@esbuild/sunos-x64": "0.25.12",
|
||||
"@esbuild/win32-arm64": "0.25.12",
|
||||
"@esbuild/win32-ia32": "0.25.12",
|
||||
"@esbuild/win32-x64": "0.25.12"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright": {
|
||||
"version": "1.64.1",
|
||||
"resolved": "https://registry.npmmirror.com/playwright/-/playwright-1.64.1.tgz",
|
||||
"integrity": "sha512-HCrVhHr5QQuwYoswEUGTb7gGp522yflbv/ST8nF4sFWGuLjQCt17Q/EubpGGSNKYn1tsTCPZxqHhHCfVURu7UA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"playwright-core": "1.64.1"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.64.1",
|
||||
"resolved": "https://registry.npmmirror.com/playwright-core/-/playwright-core-1.64.1.tgz",
|
||||
"integrity": "sha512-BC4s8y6SEVA6Q1rSxZTto8hI1KUI3xXlHGZgvGqP4IqPdI/a6FX9H29IDNz7vKo9l21b6LfYosScPL6M3xxyDQ==",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"playwright-core": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/three": {
|
||||
"version": "0.170.0",
|
||||
"resolved": "https://registry.npmmirror.com/three/-/three-0.170.0.tgz",
|
||||
"integrity": "sha512-FQK+LEpYc0fBD+J8g6oSEyyNzjp+Q7Ks1C568WWaoMRLW+TkNNWmenWeGgJjV105Gd+p/2ql1ZcjYvNiPZBhuQ==",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"name": "hel-702-3d-verify",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "esbuild src/main.js --bundle --format=esm --outfile=public/bundle.js",
|
||||
"serve": "npx -y serve public -l 8931",
|
||||
"capture": "node capture/capture.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pixiv/three-vrm": "^3.4.2",
|
||||
"@pixiv/three-vrm-animation": "^3.4.2",
|
||||
"esbuild": "^0.25.0",
|
||||
"playwright": "^1.49.0",
|
||||
"three": "^0.170.0"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>HEL-702 · 独立3D角色验证</title>
|
||||
<style>
|
||||
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a1d24; }
|
||||
#app { position: fixed; inset: 0; }
|
||||
#hud {
|
||||
position: fixed; left: 12px; top: 12px; z-index: 10;
|
||||
font: 12px/1.55 ui-monospace, Menlo, Consolas, monospace;
|
||||
color: #e8e4da; background: rgba(18, 20, 28, 0.82);
|
||||
padding: 10px 14px; border-radius: 8px; max-width: 520px;
|
||||
border: 1px solid rgba(255,255,255,0.08); white-space: pre-wrap;
|
||||
}
|
||||
#caption {
|
||||
position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 10;
|
||||
font: 15px/1.4 system-ui, sans-serif; color: #fff;
|
||||
background: rgba(0,0,0,0.55); padding: 8px 18px; border-radius: 999px;
|
||||
opacity: 0; transition: opacity .35s; pointer-events: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<div id="hud">加载中…</div>
|
||||
<div id="caption"></div>
|
||||
<script type="module" src="bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,68 +0,0 @@
|
||||
import fs from 'node:fs';
|
||||
|
||||
function parseGLB(buf) {
|
||||
if (buf.readUInt32LE(0) !== 0x46546c67) throw new Error('not GLB');
|
||||
const jsonLen = buf.readUInt32LE(12);
|
||||
return JSON.parse(buf.slice(20, 20 + jsonLen).toString('utf8'));
|
||||
}
|
||||
|
||||
const WANT_BONES = new Set(['hips','spine','chest','upperChest','neck','head',
|
||||
'leftUpperLeg','leftLowerLeg','leftFoot','rightUpperLeg','rightLowerLeg','rightFoot',
|
||||
'leftUpperArm','leftLowerArm','leftHand','rightUpperArm','rightLowerArm','rightHand']);
|
||||
|
||||
for (const file of process.argv.slice(2)) {
|
||||
const buf = fs.readFileSync(file);
|
||||
const g = parseGLB(buf);
|
||||
const vrm0 = g.extensions?.VRM;
|
||||
const vrm1 = g.extensions?.VRMC_vrm;
|
||||
const out = { file, sizeBytes: buf.byteLength, gltfVersion: g.asset?.version, generator: g.asset?.generator };
|
||||
|
||||
if (vrm1) {
|
||||
const m = vrm1.meta;
|
||||
out.standard = 'VRM1.0';
|
||||
out.meta = {
|
||||
name: m?.name, authors: m?.authors, licenseUrl: m?.licenseUrl,
|
||||
commercialUssageName: m?.commercialUssageName, modificationName: m?.modificationName,
|
||||
allowPoliticalReligious: m?.allowPoliticalReligiousName, allowAntisocialHate: m?.allowAntisocialOrHateUsageName,
|
||||
creditNotation: m?.creditNotationName, redistribution: m?.redistributionName,
|
||||
modification: m?.modificationName, allowedUserName: m?.allowedUserName,
|
||||
references: m?.references, contactInformation: m?.contactInformation,
|
||||
};
|
||||
const hb = vrm1.humanoid?.humanBones ?? {};
|
||||
const have = new Set(Array.isArray(hb) ? hb.map((b) => b.bone) : Object.keys(hb));
|
||||
out.humanoidMissing = [...WANT_BONES].filter((b) => !have.has(b));
|
||||
out.humanoidCount = have.size;
|
||||
const ex = vrm1.expressions ?? {};
|
||||
out.expressions = (Array.isArray(ex) ? ex : Object.values(ex)).map((e) => e.name);
|
||||
} else if (vrm0) {
|
||||
out.standard = 'VRM0.x';
|
||||
const m = vrm0.meta;
|
||||
out.meta = {
|
||||
title: m?.title, author: m?.author,
|
||||
allowedUserName: m?.allowedUserName, commercialUssageName: m?.commercialUssageName,
|
||||
sexualUssageName: m?.sexualUssageName, violentUssageName: m?.violentUssageName,
|
||||
licenseName: m?.licenseName, licenseUrl: m?.licenseUrl, otherLicenseUrl: m?.otherLicenseUrl,
|
||||
};
|
||||
out.humanoidMissing = [];
|
||||
out.expressions = (vrm0.blendShapeMaster?.blendShapeGroups ?? []).map((b) => b.name);
|
||||
}
|
||||
|
||||
const nodeNames = (g.nodes ?? []).map((n) => n.name);
|
||||
out.nodes = g.nodes?.length ?? 0;
|
||||
out.meshes = (g.meshes ?? []).map((m) => ({
|
||||
name: m.name,
|
||||
primitives: m.primitives.length,
|
||||
vertices: m.primitives[0]?.attributes?.POSITION ? 'y' : '?',
|
||||
skinned: !!m.primitives[0]?.attributes?.JOINTS_0,
|
||||
targets: (m.primitives[0]?.targets ?? []).length,
|
||||
}));
|
||||
out.materials = (g.materials ?? []).map((m) => ({
|
||||
name: m.name,
|
||||
type: m.extensions?.VRMC_materials_mtoon ? 'MToon' : (m.extensions?.KHR_materials_unlit ? 'unlit' : 'pbr'),
|
||||
}));
|
||||
out.textures = g.images?.length ?? 0;
|
||||
out.imageFormats = [...new Set((g.images ?? []).map((i) => i.mimeType ?? i.uri?.split('.').pop() ?? '?'))];
|
||||
const joints = g.skins?.[0]?.joints?.length ?? 0;
|
||||
out.skinJoints = joints;
|
||||
console.log(JSON.stringify(out, null, 2));
|
||||
}
|
||||
@@ -1,553 +0,0 @@
|
||||
import * as THREE from 'three';
|
||||
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
||||
import { VRMLoaderPlugin, VRMUtils } from '@pixiv/three-vrm';
|
||||
import { VRMAnimationLoaderPlugin, createVRMAnimationClip } from '@pixiv/three-vrm-animation';
|
||||
|
||||
/* ============ HEL-702 独立3D角色验证页 ============
|
||||
* 环境状态(time/weather) 与 角色状态(outfit/action/gaze) 完全分离。
|
||||
* 天气/时间切换不触碰角色骨架 —— assertPosePreserved() 可程序化验证。
|
||||
* ================================================== */
|
||||
|
||||
const params = new URLSearchParams(location.search);
|
||||
const MODEL = params.get('model') || 'twist';
|
||||
const modelFile = MODEL === 'seed' ? 'assets/Seed-san.vrm' : 'assets/VRM1_Constraint_Twist_Sample.vrm';
|
||||
|
||||
const app = {
|
||||
ready: false,
|
||||
state: { outfit: 'A', action: 'stand', time: 'day', weather: 'sunny', gaze: 'idle' },
|
||||
stats: {},
|
||||
notes: [],
|
||||
};
|
||||
|
||||
/* ---------- renderer / scene ---------- */
|
||||
const renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize(innerWidth, innerHeight);
|
||||
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
|
||||
renderer.shadowMap.enabled = true;
|
||||
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
||||
document.getElementById('app').appendChild(renderer.domElement);
|
||||
|
||||
const scene = new THREE.Scene();
|
||||
const camera = new THREE.PerspectiveCamera(30, innerWidth / innerHeight, 0.1, 50);
|
||||
const CAMS = {
|
||||
main: { pos: [1.35, 1.35, 2.6], look: [0, 0.9, 0] },
|
||||
front: { pos: [0, 1.15, 2.3], look: [0, 0.95, 0] },
|
||||
wide: { pos: [2.3, 1.7, 3.4], look: [0.1, 0.8, 0] },
|
||||
closeup: { pos: [0.75, 1.15, 1.15], look: [0.05, 1.05, 0.1] },
|
||||
};
|
||||
function setCam(name) {
|
||||
const c = CAMS[name] || CAMS.main;
|
||||
camera.position.set(...c.pos);
|
||||
camera.lookAt(...c.look);
|
||||
}
|
||||
setCam(params.get('cam') || 'main');
|
||||
|
||||
/* ---------- room ---------- */
|
||||
const room = new THREE.Group();
|
||||
scene.add(room);
|
||||
const matWall = new THREE.MeshStandardMaterial({ color: 0xcfc8bd, roughness: 0.95 });
|
||||
const matWall2 = new THREE.MeshStandardMaterial({ color: 0xb9b2a6, roughness: 0.95 });
|
||||
const matFloor = new THREE.MeshStandardMaterial({ color: 0x8a6a4e, roughness: 0.8 });
|
||||
const matWood = new THREE.MeshStandardMaterial({ color: 0xa07850, roughness: 0.7 });
|
||||
|
||||
const floor = new THREE.Mesh(new THREE.BoxGeometry(4.6, 0.08, 4.6), matFloor);
|
||||
floor.position.y = -0.04;
|
||||
floor.receiveShadow = true;
|
||||
room.add(floor);
|
||||
const wallBack = new THREE.Mesh(new THREE.BoxGeometry(4.6, 2.75, 0.08), matWall);
|
||||
wallBack.position.set(0, 1.375, -2.3);
|
||||
wallBack.receiveShadow = true;
|
||||
room.add(wallBack);
|
||||
const wallLeft = new THREE.Mesh(new THREE.BoxGeometry(0.08, 2.75, 4.6), matWall2);
|
||||
wallLeft.position.set(-2.3, 1.375, 0);
|
||||
room.add(wallLeft);
|
||||
|
||||
/* window opening in back wall: 4 boxes around a hole (x: cx±x/2) */
|
||||
const WIN = { x: 0.62, y: 1.0, cx: 0.55, cy: 1.45 };
|
||||
function wallPiece(w, h, cx, cy) {
|
||||
const m = new THREE.Mesh(new THREE.BoxGeometry(w, h, 0.08), matWall);
|
||||
m.position.set(cx, cy, -2.3);
|
||||
m.receiveShadow = true;
|
||||
room.add(m);
|
||||
}
|
||||
wallPiece(4.6, 2.75 - (WIN.cy + WIN.y / 2), 0, WIN.cy + WIN.y / 2 + (2.75 - (WIN.cy + WIN.y / 2)) / 2); // top
|
||||
wallPiece(4.6, WIN.cy - WIN.y / 2, 0, (WIN.cy - WIN.y / 2) / 2); // bottom
|
||||
wallPiece((WIN.cx - WIN.x / 2) - (-2.3), WIN.y, (-2.3 + (WIN.cx - WIN.x / 2)) / 2, WIN.cy); // left
|
||||
wallPiece(2.3 - (WIN.cx + WIN.x / 2), WIN.y, (2.3 + (WIN.cx + WIN.x / 2)) / 2, WIN.cy); // right
|
||||
/* window frame + glass */
|
||||
const frameMat = new THREE.MeshStandardMaterial({ color: 0xf0ece4, roughness: 0.5 });
|
||||
const fr1 = new THREE.Mesh(new THREE.BoxGeometry(WIN.x + 0.08, 0.05, 0.1), frameMat);
|
||||
fr1.position.set(WIN.cx, WIN.cy + WIN.y / 2, -2.28);
|
||||
const fr2 = fr1.clone(); fr2.position.y = WIN.cy - WIN.y / 2;
|
||||
const fr3 = new THREE.Mesh(new THREE.BoxGeometry(0.05, WIN.y + 0.08, 0.1), frameMat);
|
||||
fr3.position.set(WIN.cx - WIN.x / 2, WIN.cy, -2.28);
|
||||
const fr4 = fr3.clone(); fr4.position.x = WIN.cx + WIN.x / 2;
|
||||
const fr5 = new THREE.Mesh(new THREE.BoxGeometry(0.03, WIN.y, 0.09), frameMat);
|
||||
fr5.position.set(WIN.cx, WIN.cy, -2.28);
|
||||
room.add(fr1, fr2, fr3, fr4, fr5);
|
||||
const skyMat = new THREE.MeshBasicMaterial({ color: 0xbcd7f0 });
|
||||
const sky = new THREE.Mesh(new THREE.PlaneGeometry(7, 5), skyMat);
|
||||
sky.position.set(WIN.cx, WIN.cy, -2.65);
|
||||
room.add(sky);
|
||||
/* distant city silhouette (dark boxes outside window) */
|
||||
const cityMat = new THREE.MeshBasicMaterial({ color: 0x6f7f96 });
|
||||
const city = new THREE.Group();
|
||||
for (let i = 0; i < 9; i++) {
|
||||
const h = 0.5 + Math.abs(Math.sin(i * 2.7)) * 1.1;
|
||||
const b = new THREE.Mesh(new THREE.BoxGeometry(0.42, h, 0.2), cityMat);
|
||||
b.position.set(WIN.cx - 1.6 + i * 0.42, h / 2 - 0.4, -2.5);
|
||||
city.add(b);
|
||||
}
|
||||
room.add(city);
|
||||
|
||||
/* rug */
|
||||
const rug = new THREE.Mesh(new THREE.CircleGeometry(0.85, 40), new THREE.MeshStandardMaterial({ color: 0x9c4f3f, roughness: 1 }));
|
||||
rug.rotation.x = -Math.PI / 2;
|
||||
rug.position.set(-0.55, 0.005, 0.35);
|
||||
rug.receiveShadow = true;
|
||||
room.add(rug);
|
||||
|
||||
/* desk + chair + lamp (椅面高 0.46m,坐姿按它计算) */
|
||||
const chair = new THREE.Group();
|
||||
const seatY = 0.46;
|
||||
const seat = new THREE.Mesh(new THREE.BoxGeometry(0.44, 0.05, 0.44), matWood);
|
||||
seat.position.y = seatY - 0.025;
|
||||
seat.castShadow = true;
|
||||
const backrest = new THREE.Mesh(new THREE.BoxGeometry(0.44, 0.5, 0.05), matWood);
|
||||
backrest.position.set(0, seatY + 0.25, -0.2);
|
||||
backrest.castShadow = true;
|
||||
chair.add(seat, backrest);
|
||||
for (const [x, z] of [[-0.18, -0.18], [0.18, -0.18], [-0.18, 0.18], [0.18, 0.18]]) {
|
||||
const leg = new THREE.Mesh(new THREE.BoxGeometry(0.05, seatY - 0.05, 0.05), matWood);
|
||||
leg.position.set(x, (seatY - 0.05) / 2, z);
|
||||
chair.add(leg);
|
||||
}
|
||||
chair.position.set(0.62, 0, 0.1);
|
||||
chair.rotation.y = -0.5;
|
||||
room.add(chair);
|
||||
|
||||
const desk = new THREE.Group();
|
||||
const top = new THREE.Mesh(new THREE.BoxGeometry(1.1, 0.05, 0.55), matWood);
|
||||
top.position.y = 0.74;
|
||||
top.castShadow = true;
|
||||
desk.add(top);
|
||||
for (const [x, z] of [[-0.5, -0.22], [0.5, -0.22], [-0.5, 0.22], [0.5, 0.22]]) {
|
||||
const leg = new THREE.Mesh(new THREE.BoxGeometry(0.05, 0.74, 0.05), matWood);
|
||||
leg.position.set(x, 0.37, z);
|
||||
desk.add(leg);
|
||||
}
|
||||
const mug = new THREE.Mesh(new THREE.CylinderGeometry(0.045, 0.045, 0.1, 16), new THREE.MeshStandardMaterial({ color: 0xd8cfc4, roughness: 0.4 }));
|
||||
mug.position.set(0.25, 0.815, 0.06);
|
||||
desk.add(mug);
|
||||
desk.position.set(-0.85, 0, -0.75);
|
||||
desk.rotation.y = 0.35;
|
||||
room.add(desk);
|
||||
|
||||
const lampG = new THREE.Group();
|
||||
const lampStand = new THREE.Mesh(new THREE.CylinderGeometry(0.02, 0.03, 1.25, 10), new THREE.MeshStandardMaterial({ color: 0x333333, metalness: 0.7, roughness: 0.4 }));
|
||||
lampStand.position.y = 0.625;
|
||||
const lampShade = new THREE.Mesh(new THREE.ConeGeometry(0.14, 0.18, 16, 1, true), new THREE.MeshStandardMaterial({ color: 0xf5e6c8, roughness: 0.6, side: THREE.DoubleSide }));
|
||||
lampShade.position.y = 1.3;
|
||||
lampG.add(lampStand, lampShade);
|
||||
lampG.position.set(1.55, 0, -1.9);
|
||||
room.add(lampG);
|
||||
|
||||
/* book prop (read 动作时挂到右手) */
|
||||
const bookG = new THREE.Group();
|
||||
const bookCover = new THREE.Mesh(new THREE.BoxGeometry(0.16, 0.015, 0.22), new THREE.MeshStandardMaterial({ color: 0x8a3033, roughness: 0.6 }));
|
||||
const bookPage = new THREE.Mesh(new THREE.BoxGeometry(0.145, 0.012, 0.205), new THREE.MeshStandardMaterial({ color: 0xf2ecd9, roughness: 0.9 }));
|
||||
bookPage.position.y = 0.008;
|
||||
bookG.add(bookCover, bookPage);
|
||||
bookG.visible = false;
|
||||
|
||||
/* ---------- lights ---------- */
|
||||
const hemi = new THREE.HemisphereLight(0xdfe8f5, 0x5a4a3a, 0.55);
|
||||
scene.add(hemi);
|
||||
const sun = new THREE.DirectionalLight(0xfff2dd, 2.0);
|
||||
sun.position.set(3, 4, 1.5);
|
||||
sun.castShadow = true;
|
||||
sun.shadow.mapSize.set(1024, 1024);
|
||||
sun.shadow.camera.left = -3; sun.shadow.camera.right = 3;
|
||||
sun.shadow.camera.top = 3; sun.shadow.camera.bottom = -3;
|
||||
scene.add(sun);
|
||||
const lampLight = new THREE.PointLight(0xffc98a, 0, 4, 2);
|
||||
lampLight.position.set(1.55, 1.22, -1.9);
|
||||
scene.add(lampLight);
|
||||
|
||||
/* rain (outside window) */
|
||||
const RAIN_N = 500;
|
||||
const rainGeo = new THREE.BufferGeometry();
|
||||
const rainPos = new Float32Array(RAIN_N * 3);
|
||||
for (let i = 0; i < RAIN_N; i++) {
|
||||
rainPos[i * 3] = WIN.cx - 1.8 + Math.random() * 3.6;
|
||||
rainPos[i * 3 + 1] = Math.random() * 4;
|
||||
rainPos[i * 3 + 2] = -2.5 - Math.random() * 0.6;
|
||||
}
|
||||
rainGeo.setAttribute('position', new THREE.BufferAttribute(rainPos, 3));
|
||||
const rain = new THREE.Points(rainGeo, new THREE.PointsMaterial({ color: 0xaec6e8, size: 0.022, transparent: true, opacity: 0.85 }));
|
||||
rain.visible = false;
|
||||
scene.add(rain);
|
||||
|
||||
/* ---------- VRM character ---------- */
|
||||
let vrm = null;
|
||||
let mixer = null;
|
||||
let vrmaAction = null;
|
||||
let vrmaClipLen = 0;
|
||||
const rawBone = (n) => vrm?.humanoid.getRawBoneNode(n) ?? null;
|
||||
const normBone = (n) => vrm?.humanoid.getNormalizedBoneNode(n) ?? null;
|
||||
|
||||
/* outfit B: 自制占位服装(连帽衫+长裤,硬segment绑定原始骨骼) */
|
||||
const outfitB = new THREE.Group();
|
||||
const matPants = new THREE.MeshStandardMaterial({ color: 0x46618f, roughness: 0.85 });
|
||||
const matHood = new THREE.MeshStandardMaterial({ color: 0x9aa3ad, roughness: 0.9 });
|
||||
function seg(mesh, bone, pos) { mesh.position.copy(pos); mesh.castShadow = true; outfitB.add(mesh); mesh.userData.bone = bone; return mesh; }
|
||||
const B = (g, m) => new THREE.Mesh(g, m);
|
||||
seg(B(new THREE.BoxGeometry(0.34, 0.34, 0.2), matHood), 'chest', new THREE.Vector3(0, 0.02, 0)); // 衣身
|
||||
seg(B(new THREE.BoxGeometry(0.14, 0.12, 0.14), matHood), 'neck', new THREE.Vector3(0, 0.08, -0.03)); // 领口
|
||||
seg(B(new THREE.CylinderGeometry(0.055, 0.05, 0.26, 8), matHood), 'leftUpperArm', new THREE.Vector3(0, -0.1, 0)); // 袖L上
|
||||
seg(B(new THREE.CylinderGeometry(0.05, 0.045, 0.24, 8), matHood), 'leftLowerArm', new THREE.Vector3(0, -0.1, 0)); // 袖L下
|
||||
seg(B(new THREE.CylinderGeometry(0.055, 0.05, 0.26, 8), matHood), 'rightUpperArm', new THREE.Vector3(0, -0.1, 0)); // 袖R上
|
||||
seg(B(new THREE.CylinderGeometry(0.05, 0.045, 0.24, 8), matHood), 'rightLowerArm', new THREE.Vector3(0, -0.1, 0)); // 袖R下
|
||||
for (const side of ['left', 'right']) {
|
||||
seg(B(new THREE.CylinderGeometry(0.085, 0.075, 0.3, 10), matPants), side + 'UpperLeg', new THREE.Vector3(0, -0.15, 0)); // 裤大腿
|
||||
seg(B(new THREE.CylinderGeometry(0.07, 0.06, 0.3, 10), matPants), side + 'LowerLeg', new THREE.Vector3(0, -0.14, 0)); // 裤小腿
|
||||
}
|
||||
outfitB.visible = false;
|
||||
scene.add(outfitB);
|
||||
|
||||
/* ---------- 姿势系统(normalized 骨架,目标角度平滑过渡) ---------- */
|
||||
const POSES = {
|
||||
stand: {
|
||||
hips: { pos: null },
|
||||
leftShoulder: { z: 0.04 }, rightShoulder: { z: -0.04 },
|
||||
leftUpperArm: { z: -1.22, x: 0.1 }, rightUpperArm: { z: 1.22, x: 0.1 },
|
||||
leftLowerArm: { z: -0.18 }, rightLowerArm: { z: 0.18 },
|
||||
spine: { x: 0.02 }, neck: { x: 0.03 },
|
||||
},
|
||||
sit: {
|
||||
leftUpperLeg: { x: -1.45 }, rightUpperLeg: { x: -1.45 },
|
||||
leftLowerLeg: { x: 1.42 }, rightLowerLeg: { x: 1.42 },
|
||||
leftFoot: { x: -0.02 }, rightFoot: { x: -0.02 },
|
||||
spine: { x: 0.09 }, neck: { x: -0.04 },
|
||||
},
|
||||
read: {
|
||||
leftUpperLeg: { x: -1.45 }, rightUpperLeg: { x: -1.45 },
|
||||
leftLowerLeg: { x: 1.42 }, rightLowerLeg: { x: 1.42 },
|
||||
leftFoot: { x: -0.02 }, rightFoot: { x: -0.02 },
|
||||
spine: { x: 0.14 }, neck: { x: 0.22 },
|
||||
leftShoulder: { x: -0.5 }, rightShoulder: { x: -0.5 },
|
||||
leftUpperArm: { z: -0.25, y: -1.05 }, rightUpperArm: { z: 0.25, y: 1.05 },
|
||||
leftLowerArm: { y: -1.1, z: -0.3 }, rightLowerArm: { y: 1.1, z: 0.3 },
|
||||
},
|
||||
};
|
||||
const poseTargets = {}; // bone -> {quat, posOffset}
|
||||
let sitOffsetY = 0;
|
||||
let baseHipY = 0;
|
||||
|
||||
function computeTargets(name) {
|
||||
const p = POSES[name] || POSES.stand;
|
||||
for (const k of Object.keys(poseTargets)) delete poseTargets[k];
|
||||
for (const [bone, rot] of Object.entries(p)) {
|
||||
const n = normBone(bone);
|
||||
if (!n) continue;
|
||||
const q = new THREE.Quaternion();
|
||||
if (rot.x) q.multiply(new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), rot.x));
|
||||
if (rot.y) q.multiply(new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), rot.y));
|
||||
if (rot.z) q.multiply(new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 0, 1), rot.z));
|
||||
poseTargets[bone] = { quat: q };
|
||||
}
|
||||
if (name === 'sit' || name === 'read') {
|
||||
poseTargets.hips = { quat: new THREE.Quaternion(), posY: hipsRestY + (seatY + 0.055 - baseHipY) };
|
||||
} else {
|
||||
poseTargets.hips = { quat: new THREE.Quaternion(), posY: hipsRestY };
|
||||
}
|
||||
}
|
||||
|
||||
/* gaze */
|
||||
const lookTarget = new THREE.Object3D();
|
||||
scene.add(lookTarget);
|
||||
let gazeMode = 'idle';
|
||||
let gazeWanderT = 0;
|
||||
|
||||
/* ---------- HUD ---------- */
|
||||
const hud = document.getElementById('hud');
|
||||
function renderHUD() {
|
||||
const s = app.state;
|
||||
const i = renderer.info;
|
||||
hud.innerHTML = `
|
||||
<b>HEL-702 · 独立角色验证</b> · ${MODEL === 'seed' ? 'Seed-san' : 'VRM1_Constraint_Twist_Sample'}<br>
|
||||
状态: 衣=${s.outfit} 动作=${s.action} 时间=${s.time} 天气=${s.weather} 视线=${s.gaze}<br>
|
||||
draw=${i.render.calls} tri=${i.render.triangles.toLocaleString()} tex=${i.memory.textures} geo=${i.memory.geometries} fps=${app.stats.fps ?? '-'}<br>
|
||||
<span style="color:#888">${app.notes.length ? app.notes[app.notes.length - 1] : ''}</span>`;
|
||||
}
|
||||
|
||||
/* ---------- decoupling assertion ---------- */
|
||||
let poseSnapshot = null;
|
||||
function snapshotPose() {
|
||||
const names = ['hips', 'head', 'leftHand', 'rightHand', 'leftUpperLeg'];
|
||||
const out = {};
|
||||
for (const n of names) {
|
||||
const b = normBone(n);
|
||||
if (b) out[n] = b.quaternion.clone();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
app.assertPosePreserved = () => {
|
||||
if (!poseSnapshot) return { pass: null, reason: 'no snapshot' };
|
||||
let maxDelta = 0;
|
||||
for (const [n, q] of Object.entries(poseSnapshot)) {
|
||||
const b = normBone(n);
|
||||
if (b) maxDelta = Math.max(maxDelta, b.quaternion.angleTo(q));
|
||||
}
|
||||
const pass = maxDelta < 1e-4;
|
||||
app.notes.push(`环境切换后姿态偏移 = ${maxDelta.toExponential(2)} rad → ${pass ? 'PASS 未重置' : 'FAIL 被重置'}`);
|
||||
return { pass, maxDelta };
|
||||
};
|
||||
|
||||
/* ---------- state apply ---------- */
|
||||
function applyState(next) {
|
||||
Object.assign(app.state, next);
|
||||
const s = app.state;
|
||||
if (!vrm) return;
|
||||
|
||||
/* 环境: 完全不触碰 vrm 与姿势 */
|
||||
if (s.time === 'night') {
|
||||
sun.intensity = 0.04; hemi.intensity = 0.1;
|
||||
lampLight.intensity = 14; skyMat.color.set(0x0a1428); cityMat.color.set(0x1a2230);
|
||||
renderer.toneMappingExposure = 1.0;
|
||||
} else {
|
||||
sun.intensity = 2.0; hemi.intensity = 0.55;
|
||||
lampLight.intensity = 0; skyMat.color.set(0xbcd7f0); cityMat.color.set(0x6f7f96);
|
||||
renderer.toneMappingExposure = 1.0;
|
||||
}
|
||||
rain.visible = s.weather === 'rain';
|
||||
if (s.weather === 'rain') {
|
||||
if (s.time === 'night') { skyMat.color.set(0x0a1428); }
|
||||
else skyMat.color.set(0x93a8bd);
|
||||
}
|
||||
|
||||
/* 角色 */
|
||||
const garments = { Tops: false, Bottoms: false, Shoes: false };
|
||||
if (s.outfit === 'B') { garments.Tops = true; garments.Bottoms = true; }
|
||||
vrm.scene.traverse((o) => {
|
||||
if (o.isMesh) {
|
||||
const mats = Array.isArray(o.material) ? o.material : [o.material];
|
||||
for (const m of mats) {
|
||||
if (/Tops/.test(m.name)) m.visible = !garments.Tops;
|
||||
if (/Bottoms/.test(m.name)) m.visible = !garments.Bottoms;
|
||||
}
|
||||
}
|
||||
});
|
||||
outfitB.visible = s.outfit === 'B';
|
||||
|
||||
if (s.action === 'vrma') {
|
||||
if (vrmaAction) { vrmaAction.play(); computeTargets('stand'); }
|
||||
} else {
|
||||
if (vrmaAction) vrmaAction.stop();
|
||||
computeTargets(s.action);
|
||||
}
|
||||
rootTarget = ROOT_T[s.action] || ROOT_T.stand;
|
||||
bookG.visible = s.action === 'read';
|
||||
gazeMode = s.gaze;
|
||||
if (vrm.lookAt) vrm.lookAt.target = s.gaze === 'camera' ? camera : lookTarget;
|
||||
if (vrm.expressionManager) vrm.expressionManager.setValue('happy', s.gaze === 'camera' ? 0.9 : 0);
|
||||
renderHUD();
|
||||
}
|
||||
app.setState = (next) => { if (poseSnapshotForNext(next)) poseSnapshot = snapshotPose(); applyState(next); };
|
||||
function poseSnapshotForNext(next) {
|
||||
return ('time' in next) || ('weather' in next);
|
||||
}
|
||||
app.snapshotPose = () => { poseSnapshot = snapshotPose(); app.notes.push('已记录当前姿态快照'); renderHUD(); };
|
||||
|
||||
/* ---------- load ---------- */
|
||||
const t0 = performance.now();
|
||||
const loader = new GLTFLoader();
|
||||
loader.register((p) => new VRMLoaderPlugin(p));
|
||||
loader.register((p) => new VRMAnimationLoaderPlugin(p));
|
||||
const [gltf, gltfA, manifest] = await Promise.all([
|
||||
loader.loadAsync(modelFile),
|
||||
loader.loadAsync('assets/test.vrma'),
|
||||
fetch('assets/manifest.json').then((r) => r.json()),
|
||||
]);
|
||||
const loadMs = Math.round(performance.now() - t0);
|
||||
vrm = gltf.userData.vrm;
|
||||
if (!vrm) {
|
||||
console.error('[load] userData keys:', Object.keys(gltf.userData), 'extensions:', gltf.parser?.json?.extensionsUsed, gltf.parser?.json?.extensions);
|
||||
throw new Error('VRM plugin did not produce vrm from ' + modelFile);
|
||||
}
|
||||
VRMUtils.removeUnnecessaryVertices(gltf.scene);
|
||||
VRMUtils.combineSkeletons?.(gltf.scene);
|
||||
vrm.scene.traverse((o) => { if (o.isMesh) { o.castShadow = true; o.frustumCulled = false; } });
|
||||
/* VRM1 模型面朝 +Z;镜头在 +Z 侧,不旋转 */
|
||||
scene.add(vrm.scene);
|
||||
if (vrm.lookAt) vrm.lookAt.target = lookTarget;
|
||||
|
||||
/* meta (embedded license info, read at runtime) */
|
||||
const m = vrm.meta;
|
||||
app.stats.modelMeta = {
|
||||
name: m.name, authors: m.authors, licenseUrl: m.licenseUrl,
|
||||
commercialUssageName: m.commercialUssageName ?? '(未设置→按VRM PL 1.0默认)',
|
||||
modificationName: m.modificationName ?? '(未设置→按VRM PL 1.0默认)',
|
||||
allowedUserName: m.allowedUserName ?? '(未设置)',
|
||||
};
|
||||
const entry = manifest.assets.find((a) => (MODEL === 'seed' ? a.file.includes('Seed') : a.file.includes('Twist')));
|
||||
app.stats.asset = entry;
|
||||
app.stats.loadMs = loadMs;
|
||||
|
||||
/* VRMA animation */
|
||||
const vrmA = gltfA.userData.vrmAnimation;
|
||||
if (vrmA) {
|
||||
const clip = createVRMAnimationClip(vrmA, vrm);
|
||||
vrmaClipLen = clip.duration;
|
||||
mixer = new THREE.AnimationMixer(vrm.scene);
|
||||
vrmaAction = mixer.clipAction(clip);
|
||||
app.stats.vrma = { duration: clip.duration, tracks: clip.tracks.length, name: entry ? 'test.vrma' : 'test.vrma' };
|
||||
}
|
||||
|
||||
/* pose init */
|
||||
const hips = normBone('hips');
|
||||
const hipsRestY = hips ? hips.position.y : 0;
|
||||
baseHipY = hips ? hips.getWorldPosition(new THREE.Vector3()).y : 0.86;
|
||||
sitOffsetY = seatY + 0.055 - baseHipY;
|
||||
computeTargets('stand');
|
||||
|
||||
/* 书本:每帧放在两手之间并对齐角色朝向(阅读姿态可证据化:bookToHand 距离) */
|
||||
scene.add(bookG);
|
||||
const _rH = new THREE.Vector3(); const _lH = new THREE.Vector3(); const _mid = new THREE.Vector3();
|
||||
function placeBook() {
|
||||
const r = rawBone('rightHand'); const l = rawBone('leftHand');
|
||||
if (!r || !l) return;
|
||||
r.getWorldPosition(_rH); l.getWorldPosition(_lH);
|
||||
_mid.copy(_rH).add(_lH).multiplyScalar(0.5);
|
||||
bookG.position.copy(_mid).y += 0.02;
|
||||
bookG.rotation.set(-1.35, vrm.scene.rotation.y, 0.1, 'YXZ');
|
||||
}
|
||||
|
||||
/* runtime bone-binding of outfitB segments (snapshot: add() reparents) */
|
||||
for (const o of [...outfitB.children]) {
|
||||
if (o.userData.bone) {
|
||||
const b = rawBone(o.userData.bone);
|
||||
if (b) b.add(o);
|
||||
}
|
||||
}
|
||||
|
||||
/* 根节点运动目标(站立在地毯;坐下/阅读在椅子上) */
|
||||
const ROOT_T = {
|
||||
stand: { pos: new THREE.Vector3(-0.3, 0, 0.35), yaw: 0.45 },
|
||||
sit: { pos: new THREE.Vector3(0.62, 0, 0.1), yaw: -0.3 },
|
||||
read: { pos: new THREE.Vector3(0.62, 0, 0.1), yaw: -0.3 },
|
||||
vrma: { pos: new THREE.Vector3(0, 0, 0), yaw: 0 },
|
||||
};
|
||||
let rootTarget = ROOT_T.stand;
|
||||
|
||||
app.probe = () => {
|
||||
const wp = (n) => { const b = normBone(n); return b ? b.getWorldPosition(new THREE.Vector3()) : null; };
|
||||
const head = wp('head'); const hipsP = wp('hips');
|
||||
const lFoot = wp('leftFoot'); const rFoot = wp('rightFoot');
|
||||
const lKnee = wp('leftLowerLeg'); const rHandW = rawBone('rightHand') ? rawBone('rightHand').getWorldPosition(new THREE.Vector3()) : null;
|
||||
const lHandW = rawBone('leftHand') ? rawBone('leftHand').getWorldPosition(new THREE.Vector3()) : null;
|
||||
const bookW = bookG.visible ? bookG.getWorldPosition(new THREE.Vector3()) : null;
|
||||
const faceDir = new THREE.Vector3();
|
||||
const headN = normBone('head');
|
||||
if (headN) headN.getWorldDirection(faceDir);
|
||||
const toCam = head ? camera.position.clone().sub(head).normalize() : new THREE.Vector3();
|
||||
return {
|
||||
headY: +head?.y?.toFixed(3), hipsY: +hipsP?.y?.toFixed(3),
|
||||
footMinY: +Math.min(lFoot?.y ?? 9, rFoot?.y ?? 9).toFixed(3),
|
||||
kneeFwd: lKnee && hipsP ? +(lKnee.z - hipsP.z).toFixed(3) : null,
|
||||
faceAngleToCamDeg: head ? +THREE.MathUtils.radToDeg(faceDir.angleTo(toCam)).toFixed(1) : null,
|
||||
bookToRHand: bookW && rHandW ? +bookW.distanceTo(rHandW).toFixed(3) : null,
|
||||
bookToLHand: bookW && lHandW ? +bookW.distanceTo(lHandW).toFixed(3) : null,
|
||||
handDist: rHandW && lHandW ? +rHandW.distanceTo(lHandW).toFixed(3) : null,
|
||||
rHandPos: rHandW ? rHandW.toArray().map((v) => +v.toFixed(2)) : null,
|
||||
lHandPos: lHandW ? lHandW.toArray().map((v) => +v.toFixed(2)) : null,
|
||||
headPos: head ? head.toArray().map((v) => +v.toFixed(2)) : null,
|
||||
bbox: (() => { const b = new THREE.Box3().setFromObject(vrm.scene); const sz = b.getSize(new THREE.Vector3()); return sz.toArray().map((v) => +v.toFixed(3)); })(),
|
||||
eyeYaw: (() => { const la = vrm.lookAt; return la ? +THREE.MathUtils.radToDeg(la.yaw).toFixed(1) : null; })(),
|
||||
happyWeight: vrm.expressionManager ? +vrm.expressionManager.getValue('happy').toFixed(2) : null,
|
||||
rootPos: vrm.scene.position.toArray().map((v) => +v.toFixed(2)),
|
||||
rootYaw: +vrm.scene.rotation.y.toFixed(2),
|
||||
seatY, outfitBBound: outfitB.children.length === 0,
|
||||
};
|
||||
};
|
||||
|
||||
app.ready = true;
|
||||
app.notes.push(`模型加载 ${loadMs}ms · ${entry ? (entry.sizeMB + 'MB') : ''} · 授权: ${m.licenseUrl}`);
|
||||
applyState({});
|
||||
|
||||
/* ---------- loop ---------- */
|
||||
const clock = new THREE.Clock();
|
||||
let fpsAcc = 0, fpsN = 0, fpsT = 0;
|
||||
function loop() {
|
||||
requestAnimationFrame(loop);
|
||||
const dt = Math.min(clock.getDelta(), 0.05);
|
||||
const t = clock.elapsedTime;
|
||||
|
||||
/* root motion: 站位↔椅子 平滑移动 */
|
||||
if (vrm) {
|
||||
const k = 1 - Math.exp(-dt * 3.2);
|
||||
vrm.scene.position.lerp(rootTarget.pos, k);
|
||||
let dy = rootTarget.yaw - vrm.scene.rotation.y;
|
||||
dy = Math.atan2(Math.sin(dy), Math.cos(dy));
|
||||
vrm.scene.rotation.y += dy * k;
|
||||
}
|
||||
|
||||
/* pose easing toward targets (动作自然过渡) */
|
||||
if (vrm && app.state.action !== 'vrma') {
|
||||
const k = 1 - Math.exp(-dt * 5.5);
|
||||
for (const [bone, tgt] of Object.entries(poseTargets)) {
|
||||
const n = normBone(bone);
|
||||
if (!n) continue;
|
||||
n.quaternion.slerp(tgt.quat, k);
|
||||
if (tgt.posY !== undefined && bone === 'hips') n.position.y = THREE.MathUtils.lerp(n.position.y, tgt.posY, k);
|
||||
}
|
||||
/* breathing + micro sway on stand */
|
||||
const chest = normBone('chest');
|
||||
if (chest && (app.state.action === 'stand')) {
|
||||
chest.rotation.x = 0.02 * Math.sin(t * 1.7);
|
||||
}
|
||||
}
|
||||
if (app.state.action === 'read') placeBook();
|
||||
if (mixer && app.state.action === 'vrma') mixer.update(dt);
|
||||
if (vrm) vrm.update(dt);
|
||||
|
||||
/* gaze wander */
|
||||
if (gazeMode === 'idle') {
|
||||
gazeWanderT += dt;
|
||||
lookTarget.position.set(0.35 * Math.sin(t * 0.31), 1.15 + 0.12 * Math.sin(t * 0.21), 1.3);
|
||||
} else {
|
||||
lookTarget.position.copy(camera.position);
|
||||
}
|
||||
|
||||
/* rain fall */
|
||||
if (rain.visible) {
|
||||
const pos = rain.geometry.attributes.position;
|
||||
for (let i = 0; i < RAIN_N; i++) {
|
||||
let y = pos.getY(i) - dt * (2.6 + (i % 7) * 0.2);
|
||||
if (y < 0) y = 4;
|
||||
pos.setY(i, y);
|
||||
}
|
||||
pos.needsUpdate = true;
|
||||
}
|
||||
|
||||
renderer.render(scene, camera);
|
||||
|
||||
fpsAcc += dt; fpsN++; fpsT += dt;
|
||||
if (fpsT > 0.5) {
|
||||
app.stats.fps = Math.round(fpsN / fpsAcc);
|
||||
fpsAcc = 0; fpsN = 0; fpsT = 0;
|
||||
app.stats.info = {
|
||||
calls: renderer.info.render.calls,
|
||||
triangles: renderer.info.render.triangles,
|
||||
textures: renderer.info.memory.textures,
|
||||
geometries: renderer.info.memory.geometries,
|
||||
};
|
||||
if (performance) {
|
||||
if (performance.memory) app.stats.heapMB = Math.round(performance.memory.usedJSHeapSize / 1e6);
|
||||
}
|
||||
renderHUD();
|
||||
}
|
||||
}
|
||||
loop();
|
||||
window.__app = app;
|
||||
window.__stats = app.stats;
|
||||
@@ -0,0 +1,7 @@
|
||||
node_modules/
|
||||
dist/
|
||||
public/assets/*
|
||||
!public/assets/manifest.json
|
||||
evidence/*
|
||||
!evidence/.gitkeep
|
||||
__pycache__/
|
||||
@@ -0,0 +1,55 @@
|
||||
HEL-711 最小动态校对小样,基于 main `1e9b08a`。仅在 `samples/bedroom` 内工作;不连接人格、记忆、天气或语音。采用 HEL-708 的环境/人物/交谈分层边界,以及 CG-001~026 的当前需求。旧演示不变。
|
||||
|
||||
## 本地复核
|
||||
|
||||
1. 将本卡附件 `HEL-711-review-bundle.zip` 中的 `public/assets` 解压到此目录对应位置。
|
||||
2. `npm ci --ignore-scripts --no-audit --no-fund`,沿用旧前端分支的 package.json/package-lock.json/tsconfig.json,无新依赖。
|
||||
3. `npm run build`(包含严格 TypeScript 检查)。
|
||||
4. `npm run dev -- --port 5173`,本机浏览器打开终端输出的地址。
|
||||
5. `python3 tools/browser_check.py` 使用已安装的 Playwright/Chromium,自动启停本机测试服务并保存证据。此运行机需要给该命令设置 `LD_LIBRARY_PATH=/home/xiaomo/pwlibs/root/usr/lib/x86_64-linux-gnu`,复用了已有浏览器库,未安装系统依赖。
|
||||
|
||||
素材不进 Git,缺失时页面明确提示;manifest 在 Git 中保存来源、原图 SHA256、坐标、编码和问题。附件内含完整 assets、已构建 dist、浏览器连续录屏、原始试片、透明试片、分层校对图及生成工作流/日志。
|
||||
|
||||
## 代码与边界
|
||||
|
||||
- `src/main.ts`:一个持久 video 元素驱动透明 canvas;环境按钮只改环境亮度,不重建/seek 视频。人物、前景遮挡、接触阴影独立开关;静态近景不替代真实交谈。
|
||||
- `src/tokens.css`:原样复用旧前端唯一 token 表。`style.css` 为独立工程校对台,无第二套同类组件。
|
||||
- `tools/extract_layers.py`:读取现有 SAM vit-b 模型的原始 modeling API,避免可选 predictor 的 OpenCV 依赖;不伪造 cv2,不下载。原图 RGB 保留,只生成 alpha;封闭孔洞填充、0.65px 羽化。
|
||||
- `tools/contact_layers.py`:从原入景图提取毯子前景,另建可关闭的暂定接触阴影;未宣称物理阴影校准完成。
|
||||
- `tools/generate_once.py`:原 ComfyUI venv + 原生 Wan 节点,单片段、离线、自定义节点禁用。临时服务器仅监听回环 18189,finally 终止自己启动的精确 PID。不修改现有服务、系统 Python、驱动或模型路径配置。
|
||||
- `tools/matte_video.py`:49 帧逐帧 SAM 分割,原有 PyAV 编码 VP9 alpha。原始视频未抠像的背景不用于浏览器人物合成。
|
||||
- `tools/browser_check.py`:真实 Chromium 检查、三种视口截图和可下载连续录屏。页面隐藏的事件处理做了合成 visibilitychange 检查;真实系统切后台/锁屏仍待体验环境手测。
|
||||
|
||||
## 素材处理命令
|
||||
|
||||
处理目录:`.12:/media/lucian/Downloads/ComfyUI/output/hel711-task`,输入复制到其 `assets`,脚本放此目录;没有改变现有项目输入。原图由 Multica 鉴权 attachment download 获取。运行时使用原 `/media/lucian/Downloads/ComfyUI/venv/bin/python`。
|
||||
|
||||
```bash
|
||||
python extract_layers.py assets \
|
||||
--sam-source /media/lucian/Downloads/ComfyUI/custom_nodes/was-node-suite-comfyui/repos/SAM/segment_anything \
|
||||
--checkpoint /media/lucian/Downloads/ComfyUI/models/sams/sam_vit_b_01ec64.pth
|
||||
python generate_once.py
|
||||
python matte_video.py
|
||||
```
|
||||
|
||||
回传处理后的素材到本地 `public/assets`,运行 `python3 tools/contact_layers.py`。手工蒙版和坐标均保留在脚本中。`workflow.json` 是本次实际运行的请求,最终脚本仅补了目录创建/日志关闭等清理逻辑;日志和 history 可交叉核对。执行新试片前必须重新检查显存和端口;禁止停止已有服务腾资源。
|
||||
|
||||
## 当前实测与未通过项
|
||||
|
||||
当前结果见 `REPORT.md`,属于可审核候选,不代表 D1–D6 全部通过。图层是真实独立合成;没有用重生成整幅图代替分层。近景仍用已确认 v2 静态方向图;没有真人语音或口型。
|
||||
|
||||
## HEL-712 返工复现
|
||||
|
||||
本轮只补原动作的真实回程,并处理书本/手部蒙版;环境、机位、比例、UI token 与静态近景不变。完整返工包中的 `public/assets` 替换旧素材后执行同一构建/浏览器检查。
|
||||
|
||||
已有 ComfyUI 环境中,保留原片在 `output/hel711-task/reading_00001_.webm`、原透明片在同目录 `reading-alpha.webm`:
|
||||
|
||||
```bash
|
||||
python generate_return.py
|
||||
python stabilize_loop.py
|
||||
python measure_loop.py
|
||||
```
|
||||
|
||||
脚本放在 `output/hel712-task` 并附同目录 `extract_layers.py`。生成器只用已有原生 `WanFirstLastFrameToVideo` 节点与原有权重,以原片 f48、f0 为两端,seed 712,只生成一条49帧回程。服务器仍仅临时监听回环18189;主程序收齐结果后停止精确子进程。`stabilize_loop.py` 读取原49帧 alpha,新增49帧按书本/衣袖补充分割提示;只在原512坐标 y175–330 对动作对齐的5帧有符号距离去掉最大/最小值后取均值稳定,RGB不做时域融合,原发丝区域不重新分割。原始两段按顺序拼成98帧,接点48→49、97→0,无倒放/淡化/冻结/短窗口裁切。
|
||||
|
||||
`measure_loop.py` 输出固定坐标口径的逐对差异、蒙版统计、动作补偿残差、接头与手部证据图;数值不替代目验。`browser_check.py` 先在真实Chromium完整播放至少3周期,再做原交互与三视口复测。真实后台/锁屏及Safari/iOS仍未测。
|
||||
@@ -0,0 +1,52 @@
|
||||
HEL-712:原阅读动作循环与书本/手部蒙版返工候选,交总工复审,不部署。
|
||||
|
||||
## 实现
|
||||
|
||||
沿用原人物、米色开衫、深灰长裤、卧室、机位与552px人物落点。现有 Wan2.2 原生首尾帧条件节点,使用原片 f48→f0,seed 712,实际生成一条49帧抬头回程。原49帧向前播放,随后49帧真实回程,98帧/16fps/6.125秒,内部接点48→49,跨周期97→0。没有倒放、冻结、静态摆动、遮脸淡化或短窗口裁切。
|
||||
|
||||
原49帧 alpha 不重新分割;新增49帧补书本/衣袖正点,保留连通人物,去掉分离的沙发碎点。两段仅在原512px坐标 y175:330(输出552px坐标189:356)稳定蒙版:TV-L1对齐前后各2帧,有符号距离去掉最高/最低值,再取均值,限制到当前轮廓6px不确定区域,首尾8行回接原蒙版。只处理alpha,RGB不做时间平均;原发丝区域保持原alpha。原始源片与透明片逐帧映射见manifest/stabilization.json。
|
||||
|
||||
第一次新增回程直接套原分割提示时,会漏掉书本/衣袖;该版已拒绝,`before-crops.png` 保留实证。补充分割提示后才进入最终蒙版稳定。共生成一条视频,没有批量换装或动作试片。第一次稳定使用中值共识,接头alpha变化仍偏集中;最终使用去极值均值,缓和了两个分段蒙版的多数票切换。
|
||||
|
||||
## 同口径差异与边缘统计
|
||||
|
||||
本报告独立固定口径:RGB头部框为512px源坐标 x230:340、y50:180;蒙版缩到512px、alpha>127,边界用二值侵蚀差,书本/手部带为全部x、y175:330。与HEL-710采用的框/缩放细节不同,所以这里原接头22.30不直接与审核卡29.5混算;下列前后全部由同一脚本重算。完整逐对数据见 `evidence/metrics.json`,覆盖全部98个相邻对(包括末→首)。
|
||||
|
||||
| 头部RGB绝对差 /255 | 最小 | 中位 | P95 | 最大 |
|
||||
|---|---:|---:|---:|---:|
|
||||
| 原49帧普通相邻 | 0.36 | 1.73 | 4.97 | 5.75 |
|
||||
| 新98帧普通相邻(排除两接头) | 0.24 | 1.65 | 5.47 | 8.30 |
|
||||
|
||||
原f48→f0:22.30;新内部f48→49:3.66;新跨周期f97→0:5.22。两个接头落在普通相邻变化范围内。接头前后整帧、头部放大与98帧序列均附;连续录屏为实际浏览器播放,未用离线合成冒充。
|
||||
|
||||
| 蒙版指标 | 稳定前 | 最终稳定后 |
|
||||
|---|---:|---:|
|
||||
| 原49帧带内边界像素范围 | 510–794 | 509–604 |
|
||||
| 原49帧最差相邻边界变化 | 255 | 75 |
|
||||
| 原49帧相邻alpha开关最大像素 | 771 | 300 |
|
||||
| 全98帧边界像素范围 | 504–794 | 503–604 |
|
||||
| 全98对最差边界变化(含循环) | 261 | 75 |
|
||||
| 全98对alpha开关P95 / 最大像素 | 505.05 / 988 | 142.55 / 300 |
|
||||
| 内部 / 跨周期接头alpha开关像素 | 988 / 528 | 195 / 193 |
|
||||
| 动作补偿后alpha开关P95 / 最大 | 503.25 / 988 | 152.75 / 300 |
|
||||
|
||||
动作补偿使用同一源RGB光流对齐前后蒙版;可见减少的是分割开关,不靠抹掉真实运动。人物内部透明片与源RGB编码误差逐帧中位1.89、最大2.10/255;无RGB时间混合。带外alpha逐数组一致为true。重点帧可见书本/指尖与袖口保持,未见新增吞手或RGB拖影;仍需总工以连续视频独立确认。没有把数值降低当作人体解剖或身份认证。
|
||||
|
||||
## 验证
|
||||
|
||||
- 来源包SHA256:60/60核对一致。
|
||||
- `npm ci --ignore-scripts --no-audit --no-fund`:沿用锁文件,无新依赖。
|
||||
- `npm run build`:严格TypeScript检查和Vite构建通过;原JS/CSS逻辑保持,返工通过素材和工具落地。
|
||||
- `ruff check src tests samples/bedroom/tools`:通过。
|
||||
- `PYTHONPATH=src python3 -m pytest -q`:78通过。
|
||||
- `LD_LIBRARY_PATH=/home/xiaomo/pwlibs/root/usr/lib/x86_64-linux-gnu python3 tools/browser_check.py`:真实Chromium通过。最终视频先完整播放3周期,记录循环时间约6.28、12.42、18.56秒;此段全部图层显示,之后再执行交互测试。
|
||||
- VP9 alpha背景0/人物255;环境切换currentTime 0.905816→0.905816,source不变;图层开关、静态近景进退且播放继续、手动暂停、合成visibility暂停/恢复、减少动效切静态、缺片回退通过;1600×900、1280×800、390×844无横溢,人脸在画面内;pageerror=0。
|
||||
- 真实后台/锁屏、Safari/iOS未测;近景仅静态,未增加口型、语音或后台生活功能。手机构图、沙发几何、重打光与近景润色保持原记录。
|
||||
|
||||
## 文件与运行边界
|
||||
|
||||
修改 `tools/extract_layers.py`(可选补充提示)、新增 `tools/generate_return.py`、`stabilize_loop.py`、`measure_loop.py`,扩展 `tools/browser_check.py` 的连续三周期验证,更新manifest/README/本报告。没有改CSS、主题、核心服务或部署配置。
|
||||
|
||||
分支继续 `hel-711-layered-bedroom`,基于原444ee56;最终提交与PR head核对写入附件 `DELIVERY.json` 及任务完成评论。素材不进Git。完整包包含源码、构建产物、manifest、SHA256SUMS、原始前程/回程、整周期源片、透明片、逐帧前后alpha、生成请求/节点/history/server日志、浏览器连续录屏、三视口及接头/手部证据、复现说明。
|
||||
|
||||
严格校验了.12已确认SSH指纹。临时ComfyUI仅回环18189、精确PID600329,生成请求成功后已停止。CPU蒙版任务均前台收齐,没有遗留生成任务、没有新增依赖/模型/付费接口;ASR/TTS及18080原演示保持运行。未推main、未合并、未部署。
|
||||
@@ -0,0 +1,38 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>卧室分层校对 · HEL-711</title></head>
|
||||
<body>
|
||||
<main>
|
||||
<header><h1>卧室分层校对</h1><p>工程小样 · 手动光照演示 · 近景仅静态参考,未接语音或口型</p></header>
|
||||
<div id="stage" role="img" aria-label="固定机位卧室人物合成">
|
||||
<div id="frame">
|
||||
<img id="environment" src="./assets/environment.png" alt="无人高层卧室">
|
||||
<img id="shadow" src="./assets/contact-shadow.png" alt="" class="layer">
|
||||
<img id="person" src="./assets/person.png" alt="阅读人物透明层" class="layer">
|
||||
<canvas id="motion" width="552" height="552" hidden></canvas>
|
||||
<img id="occlusion" src="./assets/occlusion.png" alt="" class="layer">
|
||||
<img id="mask" src="./assets/person-mask.png" alt="人物蒙版" class="layer" hidden>
|
||||
<img id="talk" src="./assets/talk-reference.png" alt="交谈静态近景参考" class="layer" hidden>
|
||||
</div>
|
||||
</div>
|
||||
<video id="source" muted playsinline loop preload="metadata" hidden></video>
|
||||
<section aria-label="校对控制">
|
||||
<fieldset><legend>图层开关</legend>
|
||||
<label><input id="show-person" type="checkbox" checked>人物</label>
|
||||
<label><input id="show-shadow" type="checkbox" checked>接触阴影</label>
|
||||
<label><input id="show-occlusion" type="checkbox" checked>前景毯子</label>
|
||||
<label><input id="show-mask" type="checkbox">仅看人物蒙版</label>
|
||||
</fieldset>
|
||||
<div class="controls">
|
||||
<button id="lighting" type="button" aria-pressed="false">光照演示:原始</button>
|
||||
<button id="play" type="button" disabled>读取动作素材</button>
|
||||
<button id="closeup" type="button" aria-pressed="false">进入静态近景</button>
|
||||
</div>
|
||||
<p id="status" role="status">读取素材清单…</p>
|
||||
<output id="time">动作位置:未载入</output>
|
||||
<p id="fallback" role="alert" hidden></p>
|
||||
<p>人物、房间和近景来自已确认的 v2 参考。图层独立不等于几何、发丝与循环已经通过验收。</p>
|
||||
</section>
|
||||
</main>
|
||||
<script type="module" src="./src/main.ts"></script>
|
||||
</body></html>
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "cybergril-rain-room",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --host 127.0.0.1",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build": "tsc --noEmit && vite build",
|
||||
"preview": "vite preview --host 127.0.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"pixi.js": "^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "~5.9.3",
|
||||
"vite": "^5.4.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
{
|
||||
"schema": "hel712-review-1",
|
||||
"status": "review_candidate",
|
||||
"reference_sha256": {
|
||||
"reference.png": "226d7922e042e22e4b8a8241a7cf6f7aea50c301029978e4ca26cad9b3d56359",
|
||||
"environment.png": "b5d4771eb010dc1d0a41d1b698e45edaa45d2f90bb441378bc32cf5c812e76a2",
|
||||
"talk-reference.png": "0ae9b1a1cb9c590ab89a81ce4efd25de843a600ff227c184663db23e9e9c16b3"
|
||||
},
|
||||
"camera": {
|
||||
"canvas": [
|
||||
1672,
|
||||
941
|
||||
],
|
||||
"generation_crop": [
|
||||
1120,
|
||||
200,
|
||||
552,
|
||||
552
|
||||
],
|
||||
"person_anchor": [
|
||||
1390,
|
||||
530
|
||||
],
|
||||
"coordinate_units": "source pixels, top left origin",
|
||||
"transform": "none; crop reinserted into original position",
|
||||
"clothing": "v2 cream cardigan, charcoal trousers"
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"file": "environment.png",
|
||||
"source": "approved 02-v2 original",
|
||||
"alpha": false
|
||||
},
|
||||
{
|
||||
"file": "contact-shadow.png",
|
||||
"source": "engineered ellipse 65/255, 12px blur, not physically calibrated",
|
||||
"alpha": true
|
||||
},
|
||||
{
|
||||
"file": "person.png",
|
||||
"source": "original 03-v2 RGB + existing SAM vit-b alpha; enclosed mask holes filled",
|
||||
"alpha": true
|
||||
},
|
||||
{
|
||||
"file": "occlusion.png",
|
||||
"source": "03-v2 blanket pixels, hand-authored polygon matte",
|
||||
"alpha": true
|
||||
}
|
||||
],
|
||||
"motion": {
|
||||
"status": "真实回程与书本手部蒙版返工候选,待复审",
|
||||
"file": "reading-alpha.webm",
|
||||
"alpha": true,
|
||||
"maskFile": null,
|
||||
"original": "loop-source.webm",
|
||||
"generator": "installed ComfyUI native Wan2.2 high/low 14B fp8 + installed LightX2V 4-step LoRAs",
|
||||
"seed": 711,
|
||||
"dimensions": [
|
||||
552,
|
||||
552
|
||||
],
|
||||
"generation_dimensions": [
|
||||
512,
|
||||
512
|
||||
],
|
||||
"frames": 98,
|
||||
"fps": 16,
|
||||
"duration_seconds": 6.125,
|
||||
"codec": "VP9 yuva420p / WebM",
|
||||
"matting": "original 49 alpha retained outside hand/book band; added return frames use book/sleeve foreground points + connected subject; y175:330 (512 source) uses TV-L1 aligned 5-frame trimmed signed-distance mean within 6px uncertainty band",
|
||||
"start_pose": "seated holding open book, head slightly tilted toward camera",
|
||||
"end_pose": "generated return to the original relaxed camera-facing pose",
|
||||
"loop": "forward 0–48 + real generated return 49–97; joins 48→49 and 97→0, no reverse/fade/freeze",
|
||||
"cut_point": "no subwindow trimming",
|
||||
"return_seed": 712,
|
||||
"source_map": [
|
||||
{
|
||||
"frames": [
|
||||
0,
|
||||
48
|
||||
],
|
||||
"file": "reading_00001_.webm",
|
||||
"source_frames": [
|
||||
0,
|
||||
48
|
||||
]
|
||||
},
|
||||
{
|
||||
"frames": [
|
||||
49,
|
||||
97
|
||||
],
|
||||
"file": "return_00001_.webm",
|
||||
"source_frames": [
|
||||
0,
|
||||
48
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"closeup": {
|
||||
"file": "talk-reference.png",
|
||||
"type": "static_reference_only",
|
||||
"identity_verified": false,
|
||||
"lipsync": false,
|
||||
"source": "approved v2 static direction reference"
|
||||
},
|
||||
"known_issues": [
|
||||
"Original empty/occupied sofa and pillow geometry differs; residual contact geometry needs art review.",
|
||||
"Book and fingers are small; hand anatomy/identity not certified.",
|
||||
"Manual environment dimming changes background only; subject relighting not implemented.",
|
||||
"Static near-shot is a generated reference; cross-shot face continuity not certified.",
|
||||
"No real weather, speech, lipsync or life-state integration.",
|
||||
"Loop joins and stabilized hand/book edges are a HEL-712 candidate pending independent re-review."
|
||||
],
|
||||
"files": {
|
||||
"talk-reference.png": {
|
||||
"bytes": 2246098,
|
||||
"sha256": "0ae9b1a1cb9c590ab89a81ce4efd25de843a600ff227c184663db23e9e9c16b3"
|
||||
},
|
||||
"reading-alpha.webm": {
|
||||
"bytes": 1971817,
|
||||
"sha256": "9b9b95fff6c047c68ea66d14eba1ca896a80107b7c5b531c326bfac8bdc90b76"
|
||||
},
|
||||
"person.png": {
|
||||
"bytes": 2522355,
|
||||
"sha256": "a904f4081069ba97019d3c679d8dd59102118560471f8d6337f7b29d60380f24"
|
||||
},
|
||||
"composite.png": {
|
||||
"bytes": 2576324,
|
||||
"sha256": "4354716558858d0e9ac9a4c4a025d77f4042a0e106f10fc37e500c7157e77456"
|
||||
},
|
||||
"person-mask.png": {
|
||||
"bytes": 7264,
|
||||
"sha256": "7569160b3c87ebf1d5bb66792ed6d2db6b41fde006fad0473e7db5337d18b0f7"
|
||||
},
|
||||
"environment.png": {
|
||||
"bytes": 2442707,
|
||||
"sha256": "b5d4771eb010dc1d0a41d1b698e45edaa45d2f90bb441378bc32cf5c812e76a2"
|
||||
},
|
||||
"occlusion-mask.png": {
|
||||
"bytes": 4838,
|
||||
"sha256": "dc22d1823a02df4fa5f3bf484f157c49b270f100185c0a35b3c31f28880dd3f0"
|
||||
},
|
||||
"generation-input.png": {
|
||||
"bytes": 508812,
|
||||
"sha256": "f3922903fb28c5940a2e272b70be6e33dc094039b4e275724cf3ff1aa4af1584"
|
||||
},
|
||||
"occlusion.png": {
|
||||
"bytes": 2522991,
|
||||
"sha256": "5f0f4aa7ae90ad863f694365eaa93d7d7558841ecca08c95d415731450226c4f"
|
||||
},
|
||||
"reference.png": {
|
||||
"bytes": 2384917,
|
||||
"sha256": "226d7922e042e22e4b8a8241a7cf6f7aea50c301029978e4ca26cad9b3d56359"
|
||||
},
|
||||
"contact-shadow.png": {
|
||||
"bytes": 16144,
|
||||
"sha256": "948f88c1298638158f9a21ffe107bf403106dcf6e58c72a3d6e738fe0c7cc003"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
import './style.css';
|
||||
|
||||
type Manifest = {
|
||||
motion: { status: string; file: string | null; alpha: boolean; maskFile: string | null };
|
||||
};
|
||||
const get = <T extends HTMLElement>(id: string) => document.getElementById(id) as T;
|
||||
const video = get<HTMLVideoElement>('source');
|
||||
const canvas = get<HTMLCanvasElement>('motion');
|
||||
const context = canvas.getContext('2d')!;
|
||||
const play = get<HTMLButtonElement>('play');
|
||||
const person = get<HTMLImageElement>('person');
|
||||
const status = get('status');
|
||||
const reduced = matchMedia('(prefers-reduced-motion: reduce)');
|
||||
const missingImages = new Set<string>();
|
||||
let ready = false;
|
||||
let wantsPlay = false;
|
||||
let near = false;
|
||||
let failed = false;
|
||||
let frameHandle = 0;
|
||||
|
||||
function fallback(message: string) {
|
||||
const node = get('fallback');
|
||||
node.hidden = false;
|
||||
node.textContent = message;
|
||||
}
|
||||
|
||||
for (const image of document.querySelectorAll<HTMLImageElement>('#frame img')) {
|
||||
image.addEventListener('error', () => {
|
||||
missingImages.add(image.id);
|
||||
image.hidden = true;
|
||||
fallback(`素材缺失:${image.id}。请解压任务素材包到 public/assets;当前内容不能作为验收结果。`);
|
||||
});
|
||||
}
|
||||
|
||||
function visibility() {
|
||||
const visible = get<HTMLInputElement>('show-person').checked;
|
||||
const maskOnly = get<HTMLInputElement>('show-mask').checked;
|
||||
const activeMotion = ready && !failed && !reduced.matches;
|
||||
person.hidden = !visible || maskOnly || near || activeMotion;
|
||||
canvas.hidden = !visible || maskOnly || near || !activeMotion;
|
||||
get('environment').hidden = maskOnly;
|
||||
get('mask').hidden = !maskOnly || near;
|
||||
get('shadow').hidden = !visible || maskOnly || near || !get<HTMLInputElement>('show-shadow').checked;
|
||||
get('occlusion').hidden = !visible || maskOnly || near || !get<HTMLInputElement>('show-occlusion').checked;
|
||||
get('talk').hidden = !near;
|
||||
for (const id of missingImages) get(id).hidden = true;
|
||||
}
|
||||
|
||||
function paint() {
|
||||
if (video.readyState >= 2) {
|
||||
context.clearRect(0, 0, canvas.width, canvas.height);
|
||||
context.globalCompositeOperation = 'source-over';
|
||||
context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
||||
|
||||
}
|
||||
get('time').textContent = ready
|
||||
? `动作位置:${video.currentTime.toFixed(2)} / ${Number.isFinite(video.duration) ? video.duration.toFixed(2) : '…'} 秒`
|
||||
: '动作位置:未载入';
|
||||
}
|
||||
|
||||
function draw() {
|
||||
paint();
|
||||
if (!video.paused && !document.hidden) frameHandle = requestAnimationFrame(draw);
|
||||
}
|
||||
|
||||
async function syncPlayback() {
|
||||
cancelAnimationFrame(frameHandle);
|
||||
const run = wantsPlay && ready && !failed && !document.hidden && !reduced.matches;
|
||||
if (run) {
|
||||
try {
|
||||
await video.play();
|
||||
draw();
|
||||
} catch {
|
||||
wantsPlay = false;
|
||||
video.pause();
|
||||
fallback('浏览器未允许播放;请点击播放重试。');
|
||||
}
|
||||
} else { video.pause(); paint(); }
|
||||
play.textContent = ready ? (video.paused ? '播放真实试片' : '暂停真实试片') : '真实动作尚不可用';
|
||||
visibility();
|
||||
}
|
||||
|
||||
function layout() {
|
||||
const stage = get('frame');
|
||||
const scale = Math.min(stage.clientWidth / 1672, stage.clientHeight / 941);
|
||||
const left = (stage.clientWidth - 1672 * scale) / 2;
|
||||
const top = (stage.clientHeight - 941 * scale) / 2;
|
||||
Object.assign(canvas.style, { left: `${left + 1120 * scale}px`, top: `${top + 200 * scale}px`,
|
||||
width: `${552 * scale}px`, height: `${552 * scale}px` });
|
||||
}
|
||||
new ResizeObserver(layout).observe(get('frame'));
|
||||
for (const input of document.querySelectorAll('input')) input.addEventListener('change', visibility);
|
||||
get('lighting').addEventListener('click', () => {
|
||||
const button = get<HTMLButtonElement>('lighting');
|
||||
const dim = button.getAttribute('aria-pressed') !== 'true';
|
||||
button.setAttribute('aria-pressed', String(dim));
|
||||
button.textContent = `光照演示:${dim ? '环境减光' : '原始'}`;
|
||||
get('environment').style.setProperty('--demo-environment-brightness', dim ? '0.65' : '1');
|
||||
// No source assignment, load(), currentTime mutation or player recreation here.
|
||||
});
|
||||
get('closeup').addEventListener('click', () => {
|
||||
near = !near;
|
||||
const button = get<HTMLButtonElement>('closeup');
|
||||
button.setAttribute('aria-pressed', String(near));
|
||||
button.textContent = near ? '退出静态近景' : '进入静态近景';
|
||||
visibility();
|
||||
});
|
||||
play.addEventListener('click', () => { wantsPlay = !wantsPlay; void syncPlayback(); });
|
||||
document.addEventListener('visibilitychange', () => { void syncPlayback(); });
|
||||
reduced.addEventListener('change', () => {
|
||||
if (reduced.matches) wantsPlay = false;
|
||||
void syncPlayback();
|
||||
});
|
||||
video.addEventListener('error', () => {
|
||||
failed = true; ready = false; wantsPlay = false; play.disabled = true;
|
||||
fallback('动作素材缺失或解码失败,回退静态人物;未通过动态验证。');
|
||||
void syncPlayback();
|
||||
});
|
||||
|
||||
async function init() {
|
||||
try {
|
||||
const response = await fetch('./assets/manifest.json');
|
||||
if (!response.ok) throw new Error('manifest');
|
||||
const manifest: Manifest = await response.json();
|
||||
const motion = manifest.motion;
|
||||
if (!motion.file || !motion.alpha) {
|
||||
status.textContent = '静态分层可校对;无合格的透明动作素材,动态验收未通过。';
|
||||
play.disabled = true; play.textContent = '真实动作尚不可用'; return;
|
||||
}
|
||||
video.src = `./assets/${motion.file}`;
|
||||
video.addEventListener('loadeddata', () => {
|
||||
ready = true; play.disabled = false;
|
||||
status.textContent = `真实生成试片 · ${motion.status} · 循环切点与身份一致性以检查报告为准`;
|
||||
paint(); void syncPlayback();
|
||||
}, { once: true });
|
||||
} catch {
|
||||
fallback('素材清单不可用;保留静态分层校对。');
|
||||
play.textContent = '真实动作尚不可用';
|
||||
}
|
||||
}
|
||||
visibility(); layout(); void init();
|
||||
@@ -0,0 +1,22 @@
|
||||
@import './tokens.css';
|
||||
* { box-sizing: border-box; }
|
||||
[hidden] { display: none !important; }
|
||||
body { margin: 0; background: var(--scene-night-deep); color: var(--ink-primary); font: var(--fs-body) var(--font-sans); }
|
||||
main { max-width: 1600px; margin: auto; }
|
||||
header, section { padding: var(--space-4) var(--space-6); }
|
||||
h1 { font-size: var(--fs-title); margin: 0; }
|
||||
p { color: var(--ink-secondary); line-height: 1.5; }
|
||||
#stage { position: relative; overflow: hidden; height: min(60vh, 640px); background: var(--glass-bg-strong); }
|
||||
#frame { position: absolute; width: 100%; height: 100%; }
|
||||
#environment, .layer { position: absolute; width: 100%; height: 100%; object-fit: contain; }
|
||||
#environment { filter: brightness(var(--demo-environment-brightness, 1)); }
|
||||
#motion { position: absolute; }
|
||||
fieldset { border: 1px solid var(--glass-border); border-radius: var(--r-control); padding: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-4); }
|
||||
label, button { cursor: pointer; }
|
||||
.controls { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
|
||||
button { color: var(--ink-primary); background: var(--glass-bg-strong); border: 1px solid var(--glass-highlight); border-radius: var(--r-control); padding: var(--space-3) var(--space-4); font: inherit; }
|
||||
button[aria-pressed=true] { border-color: var(--accent); }
|
||||
button:disabled { color: var(--ink-disabled); cursor: default; }
|
||||
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
output { font-variant-numeric: tabular-nums; color: var(--accent); }
|
||||
@media (max-width: 600px) { header, section { padding: var(--space-3); } #stage { height: 38vh; } }
|
||||
@@ -0,0 +1,73 @@
|
||||
/* Reused verbatim from hel-700-rain-room; no alternative product theme. */
|
||||
:root {
|
||||
--scene-night-deep:#16233c;
|
||||
--scene-city-blue:#305481;
|
||||
--scene-city-mid:#5a76a2;
|
||||
--scene-tower:#2b456b;
|
||||
--scene-glass-blue:#718fc2;
|
||||
--scene-amber:#e8a45c;
|
||||
--scene-amber-soft:#f2c894;
|
||||
--scene-wood:#59361d;
|
||||
--scene-cream:#e8d9c8;
|
||||
--scene-blanket:#362928;
|
||||
--ink-primary:#f2efe9;
|
||||
--ink-secondary:rgba(242,239,233,.64);
|
||||
--ink-tertiary:rgba(242,239,233,.4);
|
||||
--ink-disabled:rgba(242,239,233,.28);
|
||||
--accent:#e8a45c;
|
||||
--accent-hover:#f2b879;
|
||||
--accent-pressed:#c9853f;
|
||||
--accent-ink:#1a1208;
|
||||
--glass-bg:rgba(14,18,30,.55);
|
||||
--glass-bg-strong:rgba(14,18,30,.72);
|
||||
--glass-border:rgba(255,255,255,.08);
|
||||
--glass-highlight:rgba(255,255,255,.14);
|
||||
--bubble-user:rgba(120,144,180,.2);
|
||||
--bubble-user-border:rgba(255,255,255,.07);
|
||||
--bubble-her:rgba(255,255,255,.06);
|
||||
--bubble-failed:rgba(200,90,80,.14);
|
||||
--state-danger:#e07a6a;
|
||||
--font-sans:"PingFang SC","HarmonyOS Sans SC","MiSans","Source Han Sans SC",system-ui,-apple-system,sans-serif;
|
||||
--fs-caption:12px;
|
||||
--fs-small:13px;
|
||||
--fs-body:14px;
|
||||
--fs-chat:15px;
|
||||
--fs-nav:15px;
|
||||
--fs-title:20px;
|
||||
--fs-brand:16px;
|
||||
--fs-time:13px;
|
||||
--space-1:4px;
|
||||
--space-2:8px;
|
||||
--space-3:12px;
|
||||
--space-4:16px;
|
||||
--space-5:20px;
|
||||
--space-6:24px;
|
||||
--space-8:32px;
|
||||
--space-10:40px;
|
||||
--r-panel:24px;
|
||||
--r-bubble:16px;
|
||||
--r-card:16px;
|
||||
--r-control:12px;
|
||||
--r-pill:999px;
|
||||
--shadow-panel:0 24px 80px rgba(0,0,0,.45);
|
||||
--shadow-pop:0 8px 24px rgba(0,0,0,.35);
|
||||
--glow-accent:0 0 12px rgba(232,164,92,.45);
|
||||
--glass-blur:blur(28px) saturate(1.2);
|
||||
--z-scene-far:0;
|
||||
--z-scene-rain:1;
|
||||
--z-scene-near:2;
|
||||
--z-caption:10;
|
||||
--z-nav:10;
|
||||
--z-topbar:20;
|
||||
--z-panel:30;
|
||||
--z-toast:40;
|
||||
--ease-out:cubic-bezier(.23,1,.32,1);
|
||||
--ease-in-out:cubic-bezier(.77,0,.175,1);
|
||||
--ease-drawer:cubic-bezier(.32,.72,0,1);
|
||||
--lamp-opacity:.12;
|
||||
--panel-width:clamp(360px,30vw,460px);
|
||||
--panel-top:64px;
|
||||
--panel-inset:24px;
|
||||
--scene-height:330px;
|
||||
--drawer-height:30dvh;
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
"""Foreground Chromium interaction checks, screenshots and downloadable recording."""
|
||||
import functools
|
||||
import http.server
|
||||
import json
|
||||
import threading
|
||||
from pathlib import Path
|
||||
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
EVIDENCE = ROOT / 'evidence'
|
||||
|
||||
|
||||
class Quiet(http.server.SimpleHTTPRequestHandler):
|
||||
def log_message(self, *_args):
|
||||
pass
|
||||
|
||||
|
||||
def main():
|
||||
EVIDENCE.mkdir(exist_ok=True)
|
||||
handler = functools.partial(Quiet, directory=str(ROOT / 'dist'))
|
||||
server = http.server.ThreadingHTTPServer(('127.0.0.1', 0), handler)
|
||||
thread = threading.Thread(target=server.serve_forever)
|
||||
thread.start()
|
||||
results = {}
|
||||
try:
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch()
|
||||
url = f'http://127.0.0.1:{server.server_port}'
|
||||
context = browser.new_context(viewport={'width': 1280, 'height': 800},
|
||||
record_video_dir=str(EVIDENCE),
|
||||
record_video_size={'width': 1280, 'height': 800})
|
||||
page = context.new_page()
|
||||
errors = []
|
||||
page.on('pageerror', lambda error: errors.append(str(error)))
|
||||
page.goto(url)
|
||||
page.wait_for_function('!document.querySelector("#play").disabled')
|
||||
assert page.locator('#source').evaluate('(v) => v.paused')
|
||||
page.click('#play')
|
||||
# Keep every layer visible for three full cycles before interaction checks.
|
||||
duration = page.locator('#source').evaluate('(v) => v.duration')
|
||||
page.evaluate("""() => {
|
||||
window.observedLoops = []; window.lastVideoTime = 0;
|
||||
const v = document.querySelector('#source');
|
||||
v.addEventListener('timeupdate', () => {
|
||||
if (v.currentTime < window.lastVideoTime) window.observedLoops.push(performance.now());
|
||||
window.lastVideoTime = v.currentTime;
|
||||
});
|
||||
}""")
|
||||
page.wait_for_timeout((duration * 3 + 0.8) * 1000)
|
||||
observed = page.evaluate('window.observedLoops')
|
||||
assert len(observed) >= 3, observed
|
||||
results['continuous_three_cycles'] = {'duration': duration, 'wraps_ms': observed}
|
||||
page.wait_for_timeout(800)
|
||||
alpha = page.locator('#motion').evaluate('(c) => {const x=c.getContext("2d"); return [x.getImageData(0,0,1,1).data[3], x.getImageData(300,220,1,1).data[3]]}')
|
||||
assert alpha[0] == 0 and alpha[1] > 240, alpha
|
||||
results['vp9_alpha_decoded_by_chromium'] = alpha
|
||||
page.wait_for_function('document.querySelector("#source").currentTime > 0.9 && document.querySelector("#source").currentTime < 1.4')
|
||||
positions = page.evaluate('''() => {
|
||||
const video=document.querySelector('#source'); const before=video.currentTime;
|
||||
const source=video.currentSrc; document.querySelector('#lighting').click();
|
||||
return {before, after:video.currentTime, sourcePreserved: source===video.currentSrc};
|
||||
}''')
|
||||
assert positions['before'] == positions['after'] and positions['sourcePreserved']
|
||||
results['environment_toggle_no_seek'] = positions
|
||||
page.wait_for_timeout(650)
|
||||
assert page.locator('#source').evaluate('(v) => !v.paused')
|
||||
page.click('#show-person')
|
||||
assert page.locator('#motion').is_hidden() and page.locator('#person').is_hidden()
|
||||
page.wait_for_timeout(600)
|
||||
page.screenshot(path=str(EVIDENCE / 'environment-only.png'))
|
||||
page.click('#show-person')
|
||||
page.click('#show-occlusion')
|
||||
assert page.locator('#occlusion').is_hidden()
|
||||
page.click('#show-occlusion')
|
||||
page.click('#show-shadow')
|
||||
assert page.locator('#shadow').is_hidden()
|
||||
page.click('#show-shadow')
|
||||
page.click('#show-mask')
|
||||
assert page.locator('#mask').is_visible() and page.locator('#environment').is_hidden()
|
||||
page.wait_for_timeout(500)
|
||||
page.click('#show-mask')
|
||||
results['independent_layers'] = True
|
||||
page.click('#closeup')
|
||||
assert page.locator('#talk').is_visible()
|
||||
assert page.locator('#source').evaluate('(v) => !v.paused')
|
||||
page.wait_for_timeout(700)
|
||||
page.screenshot(path=str(EVIDENCE / 'static-near.png'))
|
||||
page.click('#closeup')
|
||||
assert page.locator('#talk').is_hidden()
|
||||
page.wait_for_timeout(6400) # Includes the forward and generated return.
|
||||
results['near_is_static_player_continues'] = True
|
||||
page.click('#play')
|
||||
t = page.locator('#source').evaluate('(v) => v.currentTime')
|
||||
page.wait_for_timeout(250)
|
||||
assert page.locator('#source').evaluate('(v) => v.currentTime') == t
|
||||
results['manual_pause'] = True
|
||||
# Chromium lifecycle API freezes the page after making it hidden.
|
||||
session = context.new_cdp_session(page)
|
||||
session.send('Page.setWebLifecycleState', {'state': 'active'})
|
||||
# Visibility handler unit probe. Browser screenshot/recording checks above are real.
|
||||
page.click('#play')
|
||||
page.evaluate('''() => {
|
||||
Object.defineProperty(document, 'hidden', {configurable:true, get:()=>true});
|
||||
document.dispatchEvent(new Event('visibilitychange'));
|
||||
}''')
|
||||
assert page.locator('#source').evaluate('(v) => v.paused')
|
||||
page.evaluate('''() => {
|
||||
delete document.hidden; document.dispatchEvent(new Event('visibilitychange'));
|
||||
}''')
|
||||
page.wait_for_function('!document.querySelector("#source").paused')
|
||||
results['visibility_pause_resume_handler_synthetic_event'] = True
|
||||
for width, height in [(1600, 900), (1280, 800), (390, 844)]:
|
||||
page.set_viewport_size({'width': width, 'height': height})
|
||||
page.wait_for_timeout(180)
|
||||
bounds = page.evaluate('''() => {
|
||||
const r=document.querySelector('#motion').getBoundingClientRect();
|
||||
const s=document.querySelector('#stage').getBoundingClientRect();
|
||||
return {faceX:r.x+305/552*r.width, faceY:r.y+135/552*r.height,
|
||||
stage:{left:s.left,right:s.right,top:s.top,bottom:s.bottom},
|
||||
scroll:document.documentElement.scrollWidth, width:innerWidth};
|
||||
}''')
|
||||
assert bounds['scroll'] <= width
|
||||
assert bounds['stage']['left'] <= bounds['faceX'] <= bounds['stage']['right']
|
||||
assert bounds['stage']['top'] <= bounds['faceY'] <= bounds['stage']['bottom']
|
||||
page.screenshot(path=str(EVIDENCE / f'viewport-{width}x{height}.png'))
|
||||
results[f'viewport_{width}x{height}'] = bounds
|
||||
page.emulate_media(reduced_motion='reduce')
|
||||
page.wait_for_timeout(100)
|
||||
assert page.locator('#source').evaluate('(v) => v.paused')
|
||||
assert page.locator('#person').is_visible() and page.locator('#motion').is_hidden()
|
||||
results['reduced_motion_static_fallback'] = True
|
||||
page.emulate_media(reduced_motion='no-preference')
|
||||
assert page.locator('#source').evaluate('(v) => v.paused')
|
||||
video_path = Path(page.video.path())
|
||||
context.close()
|
||||
video_path.rename(EVIDENCE / 'browser-continuous.webm')
|
||||
missing = browser.new_page()
|
||||
missing.route('**/reading-alpha.webm', lambda route: route.abort())
|
||||
missing.goto(url)
|
||||
missing.wait_for_function('!document.querySelector("#fallback").hidden')
|
||||
assert missing.locator('#person').is_visible()
|
||||
assert missing.locator('#play').is_disabled()
|
||||
results['missing_motion_static_fallback'] = True
|
||||
missing.close()
|
||||
assert not errors, errors
|
||||
results['page_errors'] = errors
|
||||
browser.close()
|
||||
finally:
|
||||
server.shutdown()
|
||||
thread.join()
|
||||
server.server_close()
|
||||
(EVIDENCE / 'browser-results.json').write_text(json.dumps(results, ensure_ascii=False, indent=2))
|
||||
print(json.dumps(results, ensure_ascii=False, indent=2))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,33 @@
|
||||
"""Reproduce the separately switchable foreground and provisional contact shadow."""
|
||||
from pathlib import Path
|
||||
|
||||
from PIL import Image, ImageDraw, ImageFilter
|
||||
|
||||
|
||||
def main():
|
||||
assets = Path(__file__).resolve().parents[1] / 'public/assets'
|
||||
source = Image.open(assets / 'reference.png').convert('RGBA')
|
||||
mask = Image.new('L', source.size)
|
||||
ImageDraw.Draw(mask).polygon([
|
||||
(1240, 582), (1282, 566), (1316, 556), (1360, 552), (1403, 532),
|
||||
(1438, 526), (1486, 514), (1517, 521), (1539, 544), (1559, 556),
|
||||
(1565, 634), (1520, 707), (1407, 747), (1260, 703), (1227, 650),
|
||||
], fill=255)
|
||||
mask = mask.filter(ImageFilter.GaussianBlur(1))
|
||||
source.putalpha(mask)
|
||||
source.save(assets / 'occlusion.png')
|
||||
mask.save(assets / 'occlusion-mask.png')
|
||||
mask = Image.new('L', source.size)
|
||||
ImageDraw.Draw(mask).ellipse((1230, 511, 1512, 595), fill=65)
|
||||
mask = mask.filter(ImageFilter.GaussianBlur(12))
|
||||
shadow = Image.new('RGBA', source.size, (44, 28, 20, 0))
|
||||
shadow.putalpha(mask)
|
||||
shadow.save(assets / 'contact-shadow.png')
|
||||
composite = Image.open(assets / 'environment.png').convert('RGBA')
|
||||
for name in ['contact-shadow.png', 'person.png', 'occlusion.png']:
|
||||
composite = Image.alpha_composite(composite, Image.open(assets / name))
|
||||
composite.save(assets / 'composite.png')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,79 @@
|
||||
"""Use installed SAM modeling modules directly; no predictor/OpenCV dependency.
|
||||
|
||||
Run in the existing ComfyUI venv. No downloads or dependency changes.
|
||||
"""
|
||||
import argparse
|
||||
import importlib
|
||||
import sys
|
||||
import types
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from PIL import Image, ImageChops, ImageDraw, ImageFilter
|
||||
|
||||
|
||||
def load_sam(source: Path, checkpoint: Path):
|
||||
# The optional predictor package imports cv2. We only use the original model API.
|
||||
package = types.ModuleType("hel711_sam")
|
||||
package.__path__ = [str(source)]
|
||||
sys.modules[package.__name__] = package
|
||||
builder = importlib.import_module("hel711_sam.build_sam")
|
||||
return builder.build_sam_vit_b(str(checkpoint)).eval()
|
||||
|
||||
|
||||
def segment(model, image, extra_positive=()):
|
||||
width, height = image.size
|
||||
scale = 1024 / max(width, height)
|
||||
size = (round(width * scale), round(height * scale))
|
||||
tensor = torch.from_numpy(np.array(image.resize(size))).permute(2, 0, 1).to(model.device)
|
||||
# Crop coordinate system: fixed right-hand seat, 552 x 552.
|
||||
points = torch.tensor([[[305, 140], [300, 245], [200, 300], [307, 301],
|
||||
[80, 100], [450, 400], [330, 450]]], dtype=torch.float)
|
||||
if extra_positive:
|
||||
extra = torch.tensor([extra_positive], dtype=torch.float)
|
||||
points = torch.cat((points, extra), dim=1)
|
||||
points = (points * scale).to(model.device)
|
||||
labels = torch.tensor([[1, 1, 1, 1, 0, 0, 0]], device=model.device)
|
||||
if extra_positive:
|
||||
labels = torch.cat((labels, torch.ones((1, len(extra_positive)), device=model.device)), dim=1)
|
||||
box = torch.tensor([[100, 60, 420, 380]], dtype=torch.float, device=model.device) * scale
|
||||
with torch.inference_mode():
|
||||
result = model([dict(image=tensor, original_size=(height, width),
|
||||
point_coords=points, point_labels=labels, boxes=box)],
|
||||
multimask_output=False)[0]
|
||||
mask = result['masks'][0, 0].cpu().numpy().astype(np.uint8) * 255
|
||||
mask = Image.fromarray(mask)
|
||||
# The book/knit texture produces enclosed SAM holes. Fill enclosed holes only.
|
||||
exterior = mask.copy()
|
||||
ImageDraw.floodfill(exterior, (0, 0), 255)
|
||||
mask = ImageChops.lighter(mask, ImageChops.invert(exterior))
|
||||
return mask.filter(ImageFilter.GaussianBlur(0.65))
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('assets', type=Path)
|
||||
parser.add_argument('--sam-source', type=Path, required=True)
|
||||
parser.add_argument('--checkpoint', type=Path, required=True)
|
||||
args = parser.parse_args()
|
||||
torch.set_num_threads(8)
|
||||
model = load_sam(args.sam_source, args.checkpoint)
|
||||
source = Image.open(args.assets / 'reference.png').convert('RGB')
|
||||
region = (1120, 200, 1672, 752)
|
||||
crop = source.crop(region)
|
||||
mask = segment(model, crop)
|
||||
full_mask = Image.new('L', source.size)
|
||||
full_mask.paste(mask, region[:2])
|
||||
full_mask.save(args.assets / 'person-mask.png')
|
||||
layer = source.convert('RGBA')
|
||||
layer.putalpha(full_mask)
|
||||
layer.save(args.assets / 'person.png')
|
||||
crop.save(args.assets / 'generation-input.png')
|
||||
environment = Image.open(args.assets / 'environment.png').convert('RGBA')
|
||||
Image.alpha_composite(environment, layer).save(args.assets / 'composite.png')
|
||||
print('Saved original-pixel person layer, SAM mask, crop and real composite.', flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,141 @@
|
||||
"""One foreground job using the installed ComfyUI native Wan nodes.
|
||||
|
||||
Owns and stops its exact server PID in finally. Does not modify the installation.
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path('/media/lucian/Downloads/ComfyUI')
|
||||
TASK = ROOT / 'output/hel711-task'
|
||||
URL = 'http://127.0.0.1:18189'
|
||||
|
||||
|
||||
def request(path, payload=None):
|
||||
data = None if payload is None else json.dumps(payload).encode()
|
||||
req = urllib.request.Request(URL + path, data=data,
|
||||
headers={'Content-Type': 'application/json'})
|
||||
with urllib.request.urlopen(req, timeout=20) as response:
|
||||
return json.load(response)
|
||||
|
||||
|
||||
def graph():
|
||||
nodes = {}
|
||||
|
||||
def add(key, kind, **inputs):
|
||||
nodes[str(key)] = dict(class_type=kind, inputs=inputs)
|
||||
|
||||
for key, mode in [(1, 'high'), (2, 'low')]:
|
||||
add(key, 'UNETLoader', unet_name=f'wan2.2_i2v_{mode}_noise_14B_fp8_scaled.safetensors',
|
||||
weight_dtype='default')
|
||||
add(key + 2, 'LoraLoaderModelOnly', model=[str(key), 0],
|
||||
lora_name=f'wan2.2_i2v_lightx2v_4steps_lora_v1_{mode}_noise.safetensors',
|
||||
strength_model=1.0)
|
||||
add(key + 4, 'ModelSamplingSD3', model=[str(key + 2), 0], shift=5.0)
|
||||
add(7, 'CLIPLoader', clip_name='umt5_xxl_fp8_e4m3fn_scaled.safetensors',
|
||||
type='wan', device='cpu')
|
||||
add(8, 'VAELoader', vae_name='wan_2.1_vae.safetensors')
|
||||
add(9, 'LoadImage', image='generation-input.png')
|
||||
add(10, 'CLIPTextEncode', clip=['7', 0], text=(
|
||||
'Locked off camera, photorealistic young adult woman with short dark hair, '
|
||||
'cream cardigan and dark trousers seated on the same sofa in the same bedroom. '
|
||||
'She quietly reads the book in her hands, slowly lowers her gaze to the page '
|
||||
'then gently raises her head a little. Small natural eye blink and breathing. '
|
||||
'Her hands keep holding the book. Fixed seat position, stationary room and furniture.'))
|
||||
add(11, 'CLIPTextEncode', clip=['7', 0],
|
||||
text='camera movement, zoom, changing face, changing clothes, standing up, '
|
||||
'extra fingers, distorted hands, deformed face, moving furniture, subtitles')
|
||||
add(12, 'WanImageToVideo', positive=['10', 0], negative=['11', 0], vae=['8', 0],
|
||||
width=512, height=512, length=49, batch_size=1, start_image=['9', 0])
|
||||
add(13, 'KSamplerAdvanced', model=['5', 0], add_noise='enable', noise_seed=711,
|
||||
steps=4, cfg=1.0, sampler_name='euler', scheduler='simple',
|
||||
positive=['12', 0], negative=['12', 1], latent_image=['12', 2],
|
||||
start_at_step=0, end_at_step=2, return_with_leftover_noise='enable')
|
||||
add(14, 'KSamplerAdvanced', model=['6', 0], add_noise='disable', noise_seed=711,
|
||||
steps=4, cfg=1.0, sampler_name='euler', scheduler='simple',
|
||||
positive=['12', 0], negative=['12', 1], latent_image=['13', 0],
|
||||
start_at_step=2, end_at_step=4, return_with_leftover_noise='disable')
|
||||
add(15, 'VAEDecode', samples=['14', 0], vae=['8', 0])
|
||||
add(16, 'SaveWEBM', images=['15', 0], codec='vp9', fps=16.0,
|
||||
filename_prefix='reading', crf=20.0)
|
||||
return nodes
|
||||
|
||||
|
||||
def main():
|
||||
for name in ['user', 'temp']:
|
||||
(TASK / name).mkdir(exist_ok=True)
|
||||
os.environ['HF_HUB_OFFLINE'] = '1'
|
||||
os.environ['TRANSFORMERS_OFFLINE'] = '1'
|
||||
command = [str(ROOT / 'venv/bin/python'), str(ROOT / 'main.py'),
|
||||
'--listen', '127.0.0.1', '--port', '18189', '--disable-all-custom-nodes',
|
||||
'--offline', '--disable-manager-ui', '--disable-assets',
|
||||
'--reserve-vram', '8', '--disable-dynamic-vram',
|
||||
'--input-directory', str(TASK / 'assets'),
|
||||
'--output-directory', str(TASK), '--user-directory', str(TASK / 'user'),
|
||||
'--temp-directory', str(TASK / 'temp'), '--database-url', 'sqlite:///:memory:']
|
||||
# Refuse to attach to an unrelated listener.
|
||||
import socket
|
||||
with socket.socket() as sock:
|
||||
if sock.connect_ex(('127.0.0.1', 18189)) == 0:
|
||||
raise RuntimeError('Task port already occupied; no process started')
|
||||
with open(TASK / 'server.log', 'w') as log:
|
||||
server = subprocess.Popen(command, cwd=ROOT, stdout=log, stderr=subprocess.STDOUT)
|
||||
(TASK / 'process.json').write_text(json.dumps(dict(pid=server.pid, command=command)))
|
||||
try:
|
||||
deadline = time.monotonic() + 90
|
||||
while True:
|
||||
if server.poll() is not None:
|
||||
raise RuntimeError(f'ComfyUI exited: {server.returncode}; see server.log')
|
||||
try:
|
||||
info = request('/object_info')
|
||||
break
|
||||
except (OSError, urllib.error.URLError):
|
||||
if time.monotonic() > deadline:
|
||||
raise TimeoutError('Startup exceeded 90 seconds') from None
|
||||
time.sleep(1)
|
||||
workflow = graph()
|
||||
(TASK / 'workflow.json').write_text(json.dumps(workflow, indent=2))
|
||||
required = {n['class_type']: info.get(n['class_type']) for n in workflow.values()}
|
||||
(TASK / 'nodes.json').write_text(json.dumps(required, indent=2))
|
||||
if any(v is None for v in required.values()):
|
||||
raise RuntimeError('Required native node unavailable; see nodes.json')
|
||||
result = request('/prompt', {'prompt': workflow})
|
||||
(TASK / 'submission.json').write_text(json.dumps(result))
|
||||
prompt_id = result['prompt_id']
|
||||
print(f'Generating one clip: {prompt_id}; owned server PID {server.pid}', flush=True)
|
||||
deadline = time.monotonic() + 2400
|
||||
last_report = 0
|
||||
while time.monotonic() < deadline:
|
||||
history = request('/history/' + prompt_id)
|
||||
if prompt_id in history:
|
||||
(TASK / 'history.json').write_text(json.dumps(history, indent=2))
|
||||
print(json.dumps(history[prompt_id]['status']), flush=True)
|
||||
if history[prompt_id]['status']['status_str'] != 'success':
|
||||
raise RuntimeError('Generation failed; see history.json')
|
||||
break
|
||||
if time.monotonic() - last_report > 30:
|
||||
print('Single generation still active; existing services untouched.', flush=True)
|
||||
last_report = time.monotonic()
|
||||
time.sleep(3)
|
||||
else:
|
||||
request('/interrupt', {})
|
||||
raise TimeoutError('Single generation exceeded 40 minutes')
|
||||
except urllib.error.HTTPError as error:
|
||||
(TASK / 'api-error.json').write_bytes(error.read())
|
||||
raise
|
||||
finally:
|
||||
server.terminate()
|
||||
try:
|
||||
server.wait(timeout=20)
|
||||
except subprocess.TimeoutExpired:
|
||||
server.kill()
|
||||
server.wait()
|
||||
print(f'Stopped owned server PID {server.pid}', flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,149 @@
|
||||
"""Generate one conditioned return, from original frame 48 back to frame 0.
|
||||
|
||||
Owns and stops its exact server PID in finally. Does not modify the installation.
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path('/media/lucian/Downloads/ComfyUI')
|
||||
TASK = ROOT / 'output/hel712-task'
|
||||
URL = 'http://127.0.0.1:18189'
|
||||
|
||||
|
||||
def request(path, payload=None):
|
||||
data = None if payload is None else json.dumps(payload).encode()
|
||||
req = urllib.request.Request(URL + path, data=data,
|
||||
headers={'Content-Type': 'application/json'})
|
||||
with urllib.request.urlopen(req, timeout=20) as response:
|
||||
return json.load(response)
|
||||
|
||||
|
||||
def graph():
|
||||
nodes = {}
|
||||
|
||||
def add(key, kind, **inputs):
|
||||
nodes[str(key)] = dict(class_type=kind, inputs=inputs)
|
||||
|
||||
for key, mode in [(1, 'high'), (2, 'low')]:
|
||||
add(key, 'UNETLoader', unet_name=f'wan2.2_i2v_{mode}_noise_14B_fp8_scaled.safetensors',
|
||||
weight_dtype='default')
|
||||
add(key + 2, 'LoraLoaderModelOnly', model=[str(key), 0],
|
||||
lora_name=f'wan2.2_i2v_lightx2v_4steps_lora_v1_{mode}_noise.safetensors',
|
||||
strength_model=1.0)
|
||||
add(key + 4, 'ModelSamplingSD3', model=[str(key + 2), 0], shift=5.0)
|
||||
add(7, 'CLIPLoader', clip_name='umt5_xxl_fp8_e4m3fn_scaled.safetensors',
|
||||
type='wan', device='cpu')
|
||||
add(8, 'VAELoader', vae_name='wan_2.1_vae.safetensors')
|
||||
add(9, 'LoadImage', image='return-start.png')
|
||||
add(17, 'LoadImage', image='return-end.png')
|
||||
add(10, 'CLIPTextEncode', clip=['7', 0], text=(
|
||||
'Locked off camera, photorealistic young adult woman with short dark hair, '
|
||||
'cream cardigan and dark trousers seated on the same sofa in the same bedroom. '
|
||||
'She slowly and smoothly raises her head from looking down at the book, '
|
||||
'returning to the exact relaxed head pose and eye direction in the final reference. '
|
||||
'Her hands keep holding the open book without moving it. Natural continuous breathing. '
|
||||
'Fixed seat position, stationary room and furniture, identical face and outfit.'))
|
||||
add(11, 'CLIPTextEncode', clip=['7', 0],
|
||||
text='camera movement, zoom, changing face, changing clothes, standing up, '
|
||||
'extra fingers, distorted hands, deformed face, moving furniture, subtitles')
|
||||
add(12, 'WanFirstLastFrameToVideo', positive=['10', 0], negative=['11', 0], vae=['8', 0],
|
||||
width=512, height=512, length=49, batch_size=1, start_image=['9', 0], end_image=['17', 0])
|
||||
add(13, 'KSamplerAdvanced', model=['5', 0], add_noise='enable', noise_seed=712,
|
||||
steps=4, cfg=1.0, sampler_name='euler', scheduler='simple',
|
||||
positive=['12', 0], negative=['12', 1], latent_image=['12', 2],
|
||||
start_at_step=0, end_at_step=2, return_with_leftover_noise='enable')
|
||||
add(14, 'KSamplerAdvanced', model=['6', 0], add_noise='disable', noise_seed=712,
|
||||
steps=4, cfg=1.0, sampler_name='euler', scheduler='simple',
|
||||
positive=['12', 0], negative=['12', 1], latent_image=['13', 0],
|
||||
start_at_step=2, end_at_step=4, return_with_leftover_noise='disable')
|
||||
add(15, 'VAEDecode', samples=['14', 0], vae=['8', 0])
|
||||
add(16, 'SaveWEBM', images=['15', 0], codec='vp9', fps=16.0,
|
||||
filename_prefix='return', crf=20.0)
|
||||
return nodes
|
||||
|
||||
|
||||
def main():
|
||||
import av
|
||||
(TASK / 'assets').mkdir(parents=True, exist_ok=True)
|
||||
with av.open(str(ROOT / 'output/hel711-task/reading_00001_.webm')) as source:
|
||||
frames = [frame.to_image() for frame in source.decode(video=0)]
|
||||
frames[-1].save(TASK / 'assets/return-start.png')
|
||||
frames[0].save(TASK / 'assets/return-end.png')
|
||||
for name in ['user', 'temp']:
|
||||
(TASK / name).mkdir(exist_ok=True)
|
||||
os.environ['HF_HUB_OFFLINE'] = '1'
|
||||
os.environ['TRANSFORMERS_OFFLINE'] = '1'
|
||||
command = [str(ROOT / 'venv/bin/python'), str(ROOT / 'main.py'),
|
||||
'--listen', '127.0.0.1', '--port', '18189', '--disable-all-custom-nodes',
|
||||
'--offline', '--disable-manager-ui', '--disable-assets',
|
||||
'--reserve-vram', '8', '--disable-dynamic-vram',
|
||||
'--input-directory', str(TASK / 'assets'),
|
||||
'--output-directory', str(TASK), '--user-directory', str(TASK / 'user'),
|
||||
'--temp-directory', str(TASK / 'temp'), '--database-url', 'sqlite:///:memory:']
|
||||
# Refuse to attach to an unrelated listener.
|
||||
import socket
|
||||
with socket.socket() as sock:
|
||||
if sock.connect_ex(('127.0.0.1', 18189)) == 0:
|
||||
raise RuntimeError('Task port already occupied; no process started')
|
||||
with open(TASK / 'server.log', 'w') as log:
|
||||
server = subprocess.Popen(command, cwd=ROOT, stdout=log, stderr=subprocess.STDOUT)
|
||||
(TASK / 'process.json').write_text(json.dumps(dict(pid=server.pid, command=command)))
|
||||
try:
|
||||
deadline = time.monotonic() + 90
|
||||
while True:
|
||||
if server.poll() is not None:
|
||||
raise RuntimeError(f'ComfyUI exited: {server.returncode}; see server.log')
|
||||
try:
|
||||
info = request('/object_info')
|
||||
break
|
||||
except (OSError, urllib.error.URLError):
|
||||
if time.monotonic() > deadline:
|
||||
raise TimeoutError('Startup exceeded 90 seconds') from None
|
||||
time.sleep(1)
|
||||
workflow = graph()
|
||||
(TASK / 'workflow.json').write_text(json.dumps(workflow, indent=2))
|
||||
required = {n['class_type']: info.get(n['class_type']) for n in workflow.values()}
|
||||
(TASK / 'nodes.json').write_text(json.dumps(required, indent=2))
|
||||
if any(v is None for v in required.values()):
|
||||
raise RuntimeError('Required native node unavailable; see nodes.json')
|
||||
result = request('/prompt', {'prompt': workflow})
|
||||
(TASK / 'submission.json').write_text(json.dumps(result))
|
||||
prompt_id = result['prompt_id']
|
||||
print(f'Generating one clip: {prompt_id}; owned server PID {server.pid}', flush=True)
|
||||
deadline = time.monotonic() + 2400
|
||||
last_report = 0
|
||||
while time.monotonic() < deadline:
|
||||
history = request('/history/' + prompt_id)
|
||||
if prompt_id in history:
|
||||
(TASK / 'history.json').write_text(json.dumps(history, indent=2))
|
||||
print(json.dumps(history[prompt_id]['status']), flush=True)
|
||||
if history[prompt_id]['status']['status_str'] != 'success':
|
||||
raise RuntimeError('Generation failed; see history.json')
|
||||
break
|
||||
if time.monotonic() - last_report > 30:
|
||||
print('Single generation still active; existing services untouched.', flush=True)
|
||||
last_report = time.monotonic()
|
||||
time.sleep(3)
|
||||
else:
|
||||
request('/interrupt', {})
|
||||
raise TimeoutError('Single generation exceeded 40 minutes')
|
||||
except urllib.error.HTTPError as error:
|
||||
(TASK / 'api-error.json').write_bytes(error.read())
|
||||
raise
|
||||
finally:
|
||||
server.terminate()
|
||||
try:
|
||||
server.wait(timeout=20)
|
||||
except subprocess.TimeoutExpired:
|
||||
server.kill()
|
||||
server.wait()
|
||||
print(f'Stopped owned server PID {server.pid}', flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,59 @@
|
||||
"""Per-frame real SAM segmentation, then VP9 alpha encoding with existing PyAV."""
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import av
|
||||
import numpy as np
|
||||
import torch
|
||||
from extract_layers import load_sam, segment
|
||||
from PIL import Image
|
||||
|
||||
ROOT = Path('/media/lucian/Downloads/ComfyUI')
|
||||
TASK = ROOT / 'output/hel711-task'
|
||||
|
||||
|
||||
def main():
|
||||
torch.set_num_threads(8)
|
||||
model = load_sam(
|
||||
ROOT / 'custom_nodes/was-node-suite-comfyui/repos/SAM/segment_anything',
|
||||
ROOT / 'models/sams/sam_vit_b_01ec64.pth').to('cuda')
|
||||
output = av.open(str(TASK / 'reading-alpha.webm'), 'w')
|
||||
stream = output.add_stream('libvpx-vp9', rate=16)
|
||||
stream.width = 552
|
||||
stream.height = 552
|
||||
stream.pix_fmt = 'yuva420p'
|
||||
stream.options = {'crf': '20', 'b': '0', 'auto-alt-ref': '0'}
|
||||
metrics = []
|
||||
previews = []
|
||||
source = av.open(str(TASK / 'reading_00001_.webm'))
|
||||
previous = None
|
||||
first = None
|
||||
for index, decoded in enumerate(source.decode(video=0)):
|
||||
image = decoded.to_image().resize((552, 552), Image.Resampling.LANCZOS)
|
||||
mask = segment(model, image)
|
||||
frame = image.convert('RGBA')
|
||||
frame.putalpha(mask)
|
||||
pixels = np.array(image).astype(float)
|
||||
if first is None:
|
||||
first = pixels
|
||||
metrics.append(dict(frame=index, mask_pixels=int((np.array(mask) > 127).sum()),
|
||||
mean_absolute_rgb_change=0 if previous is None else float(np.abs(pixels-previous).mean())))
|
||||
previous = pixels
|
||||
if index in [0, 16, 32, 48]:
|
||||
previews.append(frame)
|
||||
frame.save(TASK / f'matted-{index:02}.png')
|
||||
for packet in stream.encode(av.VideoFrame.from_ndarray(np.array(frame), format='rgba')):
|
||||
output.mux(packet)
|
||||
if index % 16 == 0:
|
||||
print(f'Matted frame {index}', flush=True)
|
||||
for packet in stream.encode():
|
||||
output.mux(packet)
|
||||
output.close()
|
||||
source.close()
|
||||
(TASK / 'frame-metrics.json').write_text(json.dumps(dict(
|
||||
frames=metrics, loop_rgb_difference=float(np.abs(previous-first).mean()),
|
||||
interpretation='Real generated frames; RGB differences alone are not proof of valid anatomy or identity.'), indent=2))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,106 @@
|
||||
"""Measure all joins and before/after hand mattes; export reviewable frame evidence."""
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import av
|
||||
import numpy as np
|
||||
from PIL import Image, ImageDraw
|
||||
from scipy.ndimage import binary_erosion, map_coordinates
|
||||
from skimage.color import rgb2gray
|
||||
from skimage.registration import optical_flow_tvl1
|
||||
|
||||
TASK = Path('/media/lucian/Downloads/ComfyUI/output/hel712-task')
|
||||
|
||||
|
||||
def summary(values):
|
||||
a = np.array(values)
|
||||
return dict(min=float(a.min()), median=float(np.median(a)),
|
||||
p95=float(np.percentile(a, 95)), max=float(a.max()))
|
||||
|
||||
|
||||
def panel(images, labels, path, size=(256, 256), columns=6):
|
||||
width, height = size
|
||||
board = Image.new('RGB', (columns*width, ((len(images)+columns-1)//columns)*(height+22)), '#202020')
|
||||
draw = ImageDraw.Draw(board)
|
||||
for i, (image, label) in enumerate(zip(images, labels, strict=True)):
|
||||
x, y = i % columns*width, i // columns*(height+22)
|
||||
board.paste(image.resize(size), (x, y))
|
||||
draw.text((x+3, y+height+3), label, fill='white')
|
||||
board.save(path)
|
||||
|
||||
|
||||
def main():
|
||||
data = np.load(TASK/'segmentation-v2.npz')
|
||||
mattes = np.load(TASK/'mattes.npz')
|
||||
rgb = data['images']
|
||||
# All measurement uses 512px source coordinates. The head box is fixed for both clips.
|
||||
images = [np.array(Image.fromarray(x).resize((512,512))) for x in rgb]
|
||||
before, after = [[np.array(Image.fromarray(x).resize((512,512))) > 127
|
||||
for x in mattes[key]] for key in ['before','after']]
|
||||
head = [x[50:180,230:340].astype(float) for x in images]
|
||||
pairs = [(i, i+1) for i in range(97)] + [(97,0)]
|
||||
head_diff = [float(np.abs(head[a]-head[b]).mean()) for a,b in pairs]
|
||||
ordinary = [d for i,d in enumerate(head_diff) if i not in [48,97]]
|
||||
report = {'coordinates':'512x512, head x230:340 y50:180, book/hand all x y175:330',
|
||||
'original_head_adjacent':summary(head_diff[:48]),
|
||||
'original_head_seam':float(np.abs(head[48]-head[0]).mean()),
|
||||
'loop_ordinary_head':summary(ordinary),
|
||||
'joins':[{'pair':[48,49],'head_mae':head_diff[48]},
|
||||
{'pair':[97,0],'head_mae':head_diff[97]}],
|
||||
'head_mae_all_pairs':head_diff}
|
||||
for name, masks in [('before',before),('after',after)]:
|
||||
edge = [int((m & ~binary_erosion(m))[175:330].sum()) for m in masks]
|
||||
switches = [int((masks[a]^masks[b])[175:330].sum()) for a,b in pairs]
|
||||
report[name] = {'boundary_pixels': edge, 'switch_pixels':switches,
|
||||
'original49_boundary':summary(edge[:49]),
|
||||
'original49_boundary_jump':summary(np.abs(np.diff(edge[:49]))),
|
||||
'original49_switch':summary(switches[:48]),
|
||||
'all_boundary':summary(edge), 'all_boundary_jump':summary(np.abs(np.diff(edge + [edge[0]]))),
|
||||
'all_switch':summary(switches),
|
||||
'joins_switch':[switches[48],switches[97]]}
|
||||
# Warp both alpha candidates with the same image motion. Residuals separate
|
||||
# mask switching from unaligned silhouette motion (not an anatomy metric).
|
||||
compensated = {'before':[], 'after':[]}
|
||||
rows, cols = np.meshgrid(np.arange(155), np.arange(512), indexing='ij')
|
||||
for a,b in pairs:
|
||||
flow = optical_flow_tvl1(rgb2gray(images[a][175:330]).astype(np.float32),
|
||||
rgb2gray(images[b][175:330]).astype(np.float32),
|
||||
num_warp=3, num_iter=5)
|
||||
for name,masks in [('before',before),('after',after)]:
|
||||
warped = map_coordinates(masks[b][175:330].astype(float),
|
||||
[rows+flow[0],cols+flow[1]], order=1, mode='nearest')>0.5
|
||||
compensated[name].append(int((masks[a][175:330]^warped).sum()))
|
||||
report['flow_compensated_switch']={k:{'all':summary(v), 'original49':summary(v[:48]),'per_pair':v}
|
||||
for k,v in compensated.items()}
|
||||
# Raw interior stays paired with alpha output; encoding error is reported separately.
|
||||
with av.open(str(TASK/'reading-alpha.webm')) as src:
|
||||
decoder=av.CodecContext.create('libvpx-vp9','r')
|
||||
decoded=[f.to_ndarray(format='rgba') for p in src.demux(video=0) for f in decoder.decode(p)]
|
||||
report['alpha_rgb_interior_mae']=summary([
|
||||
float(np.abs(out[:,:,:3].astype(float)-im).mean(axis=2)[m>250].mean())
|
||||
for out,im,m in zip(decoded,rgb,mattes['after'],strict=True)])
|
||||
(TASK/'metrics.json').write_text(json.dumps(report,indent=2))
|
||||
print(json.dumps({k:v for k,v in report.items() if k not in ['before','after','head_mae_all_pairs','flow_compensated_switch']},indent=2))
|
||||
print(json.dumps({k:{x:y for x,y in v.items() if not isinstance(y,list)} for k,v in report.items() if k in ['before','after']},indent=2))
|
||||
ids=[46,47,48,49,50,51,94,95,96,97,0,1]
|
||||
panel([Image.fromarray(images[i]) for i in ids], [f'frame {i}' for i in ids],TASK/'join-frames.png')
|
||||
panel([Image.fromarray(images[i][50:180,230:340]) for i in ids], [f'head {i}' for i in ids],TASK/'join-heads.png',size=(220,260))
|
||||
ids=[0,8,16,24,32,40,47,48,49,56,64,72,80,88,96,97]
|
||||
crops=[]
|
||||
labels=[]
|
||||
for i in ids:
|
||||
for name,masks in [('before',mattes['before']),('after',mattes['after'])]:
|
||||
rgba=np.dstack((rgb[i],masks[i]))
|
||||
bg=Image.new('RGBA',(552,552),'#557788')
|
||||
bg.alpha_composite(Image.fromarray(rgba))
|
||||
crops.append(bg.convert('RGB').crop((90,189,430,356)))
|
||||
labels.append(f'{name} {i}')
|
||||
panel(crops,labels,TASK/'hand-before-after.png',size=(340,167),columns=4)
|
||||
panel([Image.fromarray(mattes['after'][i]).convert('RGB').crop((90,189,430,356)) for i in ids],
|
||||
[f'alpha {i}' for i in ids],TASK/'hand-mattes.png',size=(340,167),columns=4)
|
||||
panel([Image.fromarray(images[i]) for i in range(98)], [str(i) for i in range(98)],
|
||||
TASK/'all-frames.png',size=(170,170),columns=14)
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
main()
|
||||
@@ -0,0 +1,146 @@
|
||||
"""Assemble the generated forward/return clips and stabilize only the hand/book matte.
|
||||
|
||||
Run with the existing ComfyUI environment; no models or dependencies are fetched.
|
||||
Optical flow aligns neighbouring masks; only alpha changes, never source RGB.
|
||||
"""
|
||||
import json
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from pathlib import Path
|
||||
|
||||
import av
|
||||
import numpy as np
|
||||
import torch
|
||||
from extract_layers import load_sam, segment
|
||||
from PIL import Image
|
||||
from scipy.ndimage import distance_transform_edt, gaussian_filter, label, map_coordinates
|
||||
from skimage.color import rgb2gray
|
||||
from skimage.registration import optical_flow_tvl1
|
||||
|
||||
ROOT = Path('/media/lucian/Downloads/ComfyUI')
|
||||
TASK = ROOT / 'output/hel712-task'
|
||||
BASE = ROOT / 'output/hel711-task'
|
||||
Y0, Y1 = round(175 * 552 / 512), round(330 * 552 / 512)
|
||||
|
||||
|
||||
def decode_alpha(path):
|
||||
with av.open(str(path)) as source:
|
||||
decoder = av.CodecContext.create('libvpx-vp9', 'r')
|
||||
return [f.to_ndarray(format='rgba') for p in source.demux(video=0)
|
||||
for f in decoder.decode(p)]
|
||||
|
||||
|
||||
def encode(path, frames, alpha):
|
||||
with av.open(str(path), 'w') as output:
|
||||
stream = output.add_stream('libvpx-vp9', rate=16)
|
||||
stream.width = stream.height = frames[0].shape[0]
|
||||
stream.pix_fmt = 'yuva420p' if alpha else 'yuv420p'
|
||||
stream.options = {'crf': '10', 'b': '0', 'auto-alt-ref': '0'}
|
||||
for frame in frames:
|
||||
for packet in stream.encode(av.VideoFrame.from_ndarray(
|
||||
frame, format='rgba' if alpha else 'rgb24')):
|
||||
output.mux(packet)
|
||||
for packet in stream.encode():
|
||||
output.mux(packet)
|
||||
|
||||
|
||||
def signed(mask):
|
||||
binary = mask > 127
|
||||
return distance_transform_edt(binary) - distance_transform_edt(~binary)
|
||||
|
||||
|
||||
def stabilize(images, masks):
|
||||
# Padding supplies flow context, but edits are restricted to the specified band.
|
||||
top, bottom = Y0 - 24, Y1 + 24
|
||||
gray = [rgb2gray(im[top:bottom]).astype(np.float32) for im in images]
|
||||
distances = [signed(m[top:bottom]) for m in masks]
|
||||
rows, cols = np.meshgrid(np.arange(bottom-top), np.arange(552), indexing='ij')
|
||||
def one(i):
|
||||
mask = masks[i]
|
||||
aligned = [distances[i]]
|
||||
for offset in [-2, -1, 1, 2]:
|
||||
j = (i + offset) % len(masks)
|
||||
flow = optical_flow_tvl1(gray[i], gray[j], attachment=15,
|
||||
num_warp=5, num_iter=10)
|
||||
aligned.append(map_coordinates(distances[j], [rows+flow[0], cols+flow[1]],
|
||||
order=1, mode='nearest'))
|
||||
# Trim the most extreme masks; averaging the remaining three signed
|
||||
# distances also avoids a majority-vote jump at the two clip joins.
|
||||
consensus = np.sort(aligned, axis=0)[1:-1].mean(axis=0)
|
||||
# A narrow spatial regularization removes single-pixel segmentation teeth.
|
||||
stable = gaussian_filter(consensus, 0.65)
|
||||
current = distances[i]
|
||||
stable = np.where(np.abs(current) <= 6, stable, current)
|
||||
alpha = np.clip(127.5 + stable * 127.5, 0, 255)
|
||||
# Blend the first/last 8 rows back to the unchanged matte.
|
||||
weight = np.ones(Y1-Y0)
|
||||
weight[:8] = np.linspace(0, 1, 8)
|
||||
weight[-8:] = np.linspace(1, 0, 8)
|
||||
new = mask.copy()
|
||||
roi = alpha[Y0-top:Y1-top]
|
||||
new[Y0:Y1] = np.rint(roi*weight[:, None] + mask[Y0:Y1]*(1-weight[:, None])).astype(np.uint8)
|
||||
return new, int(np.count_nonzero((new>127) != (mask>127)))
|
||||
|
||||
output, changes = [], []
|
||||
with ThreadPoolExecutor(max_workers=4) as executor:
|
||||
for i, (mask, change) in enumerate(executor.map(one, range(len(masks)))):
|
||||
output.append(mask)
|
||||
changes.append(change)
|
||||
if i % 8 == 0:
|
||||
print(f'Flow-aligned matte {i}/{len(masks)}', flush=True)
|
||||
return output, changes
|
||||
|
||||
|
||||
def main():
|
||||
torch.set_num_threads(8)
|
||||
cache = TASK / 'segmentation-v2.npz'
|
||||
if cache.exists():
|
||||
data = np.load(cache)
|
||||
images, masks = list(data['images']), list(data['masks'])
|
||||
else:
|
||||
# Preserve original matte outside the hand/book band without rerunning it.
|
||||
original = decode_alpha(BASE / 'reading-alpha.webm')
|
||||
with av.open(str(BASE / 'reading_00001_.webm')) as source:
|
||||
images = [np.array(f.to_image().resize((552, 552), Image.Resampling.LANCZOS))
|
||||
for f in source.decode(video=0)]
|
||||
masks = [f[:, :, 3] for f in original]
|
||||
model = load_sam(ROOT / 'custom_nodes/was-node-suite-comfyui/repos/SAM/segment_anything',
|
||||
ROOT / 'models/sams/sam_vit_b_01ec64.pth').to('cuda')
|
||||
with av.open(str(TASK / 'return_00001_.webm')) as source:
|
||||
for i, frame in enumerate(source.decode(video=0)):
|
||||
image = frame.to_image().resize((552, 552), Image.Resampling.LANCZOS)
|
||||
images.append(np.array(image))
|
||||
alpha = np.array(segment(model, image, extra_positive=(
|
||||
(245, 258), (280, 275), (360, 245), (365, 295))))
|
||||
components, count = label(alpha > 127)
|
||||
sizes = np.bincount(components.ravel())
|
||||
sizes[0] = 0
|
||||
keep = components == sizes.argmax()
|
||||
# Retain feather next to the connected subject; discard isolated sofa specks.
|
||||
from scipy.ndimage import binary_dilation
|
||||
alpha[~binary_dilation(keep, iterations=3)] = 0
|
||||
masks.append(alpha)
|
||||
if i % 8 == 0:
|
||||
print(f'Segmented return frame {i}', flush=True)
|
||||
np.savez_compressed(cache, images=np.array(images), masks=np.array(masks))
|
||||
del model
|
||||
torch.cuda.empty_cache()
|
||||
stable, changes = stabilize(images, masks)
|
||||
np.savez_compressed(TASK / 'mattes.npz', before=np.array(masks), after=np.array(stable))
|
||||
encode(TASK / 'loop-source.webm', images, False)
|
||||
frames = [np.dstack((rgb, a)) for rgb, a in zip(images, stable, strict=True)]
|
||||
encode(TASK / 'reading-alpha.webm', frames, True)
|
||||
(TASK / 'stabilization.json').write_text(json.dumps({
|
||||
'frames': len(images), 'fps': 16, 'join_pairs': [[48,49],[97,0]],
|
||||
'source_map': [{'frames':[0,48], 'source':'reading_00001_.webm'},
|
||||
{'frames':[49,97], 'source':'return_00001_.webm'}],
|
||||
'band_512': [175,330], 'band_552': [Y0,Y1],
|
||||
'flow': 'TV-L1, four neighbours, cyclic trimmed signed-distance mean, 6px uncertainty band',
|
||||
'changed_binary_pixels_per_frame': changes,
|
||||
'rgb': 'Original RGB retained; no temporal RGB blending or frame replacement',
|
||||
'outside_band_unchanged': all(np.array_equal(a[:Y0],b[:Y0]) and np.array_equal(a[Y1:],b[Y1:])
|
||||
for a,b in zip(masks,stable,strict=True))}, indent=2))
|
||||
print('Encoded 98-frame forward/return candidate, not yet accepted.', flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"lib": [
|
||||
"ES2022",
|
||||
"DOM",
|
||||
"DOM.Iterable"
|
||||
],
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
||||