Files
photoai/scripts/copy-ort-wasm.mjs
T
koriweb 3e73967c7b darktable-inspired reskin + metadata/collections, map, easy mode, select/export
UI overhaul to a darktable tone-and-manner and a set of features adapted from
darktable's proven patterns (reimplemented in our Electron/TS stack; no GPL code).

Design reskin:
- Dark neutral-gray palette + amber accent, flat/squared corners, no card shadows,
  compact darktable-style top bar (logo + pipe-separated view tabs), denser 15px base
- Done via design tokens (Tailwind slate/brand/radius/shadow remap) — minimal churn

Metadata & collections (Phase A/B):
- exifr now captures GPS + camera; asset table ALTER-migrated (gpsLat/gpsLon/camera,
  metaVersion backfill on re-index)
- Collection facet bar (year timeline / camera / color-label) filters the grid

Map & relation finder (Phase C):
- Leaflet + online OSM map tab; geotagged photos as markers
- relationService: related photos by place (GPS<1km) + time (+/-2d) + CLIP similarity

Easy mode (Phase D):
- easyMode setting (menu / onboarding); scales the whole UI (rem) + bigger thumbnails
  + large icon nav with plain labels (4050 accessibility)

Library usability:
- Video thumbnails (representative frame capture in the inference worker)
- Media filter (All / Photos / Videos) to separate them
- Clearer culling labels ("Good shots" / "To cull") + explanation tooltip
- Multi-select tiles -> Export selected to a folder (copy, best-cut extraction) and
  Delete to Recycle Bin (shell.trashItem) behind a confirm dialog
- ONNX Runtime wasm bundled locally (offline) via copy-ort-wasm + asarUnpack

Docs: DARKTABLE_REVIEW (feasibility + roadmap A->D). All typecheck/tests/build green;
boot smoke verified each phase.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 19:22:19 +09:00

42 lines
1.4 KiB
JavaScript

// transformers.js의 ONNX Runtime WASM을 public/ort 로 복사 → 오프라인 동작(CDN 불필요).
// postinstall 및 빌드 전에 실행. (wasm은 용량이 커 git에는 올리지 않음 — gitignore)
import { readdir, mkdir, copyFile, access } from 'node:fs/promises'
import { constants } from 'node:fs'
import { join, dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
const SRC = join(__dirname, '..', 'node_modules', '@huggingface', 'transformers', 'dist')
const DEST = join(__dirname, '..', 'public', 'ort')
async function exists(p) {
try {
await access(p, constants.F_OK)
return true
} catch {
return false
}
}
async function main() {
if (!(await exists(SRC))) {
console.warn('transformers dist 없음 — ORT wasm 복사 건너뜀:', SRC)
return
}
await mkdir(DEST, { recursive: true })
const files = await readdir(SRC)
// ORT 런타임 파일(wasm + 로더 mjs)만 복사
const targets = files.filter((f) => /ort-.*\.(wasm|mjs)$/.test(f))
let n = 0
for (const f of targets) {
await copyFile(join(SRC, f), join(DEST, f))
n++
}
console.log(`ORT wasm 복사 완료: ${n}개 → ${DEST}`)
}
main().catch((e) => {
console.error('ORT 복사 오류:', e.message)
// 빌드를 막지 않도록 실패해도 통과 (CDN 폴백 가능)
})