config
Source: config.js:14
Centralised configuration constants for Ghostmaxxing. Lives in one place so that URLs, detector thresholds, and recording defaults can be changed without touching engine code. All values here are static and module-load-time resolvable; runtime-mutable state belongs in state.js.
Why a separate module: keeps testable engines free of hard-coded URLs (which makes them mockable) and concentrates the network surface in one file so the upgrade path to npm + bundler is mechanical.
Other
MODEL_URLS
Public CDN URLs for the face-api.js model shards (TinyFaceDetector + the landmarks / recognition / age-gender heads). These point at the canonical face-api.js-models mirror, which serves the same weights for both the unmaintained original library and the @vladmandic fork in use here.
- See:
- scripts/main.js – `loadModels()` reads these and calls `faceapi.nets.*.loadFromUri()`.
THUMBNAIL_MAX_ENTRIES
Maximum number of face thumbnails retained in the dedicated localStorage thumbnail store. When the limit is exceeded, the oldest thumbnail entry is evicted (FIFO by savedAt).
THUMBNAIL_MARGIN_RATIO
Extra margin ratio applied around the detected face box before thumbnail cropping. The margin is computed from the shortest side of the box.
THUMBNAIL_OUTPUT_SIZE
Output thumbnail size in pixels (square canvas, width and height).
THUMBNAIL_JPEG_QUALITY
JPEG quality used when exporting captured face thumbnails.
MEDIAPIPE_TASKS_VISION_URL
Root CDN URL for the @mediapipe/tasks-vision package. Used as a base for dynamic ES-module imports of FaceLandmarker and ImageEmbedder.
- See:
- scripts/engine-3d.js – `loadMobileNet()` does `await import(MEDIAPIPE_TASKS_VISION_URL)`.
- scripts/mediapipe-loop.js – uses the same package for face landmarks.
MEDIAPIPE_WASM_URL
URL of the MediaPipe WASM blob loaded by FilesetResolver.forVisionTasks(). The path must match the package version of MEDIAPIPE_TASKS_VISION_URL to avoid runtime version mismatch errors.
- See:
- scripts/engine-3d.js
- scripts/mediapipe-loop.js
MEDIAPIPE_FACE_LANDMARKER_URL
URL of the MediaPipe FaceLandmarker .task bundle (float16, 478 landmarks). Hosted by Google's mediapipe-models storage.
- See:
- scripts/mediapipe-loop.js – passed to `FaceLandmarker.createFromOptions()`.
MEDIAPIPE_IMAGE_EMBEDDER_URL
URL of the MediaPipe ImageEmbedder model bundle (MobileNetV3 Small, float32). Produces the embedding vector consumed by the 3D recognition pipeline.
- See:
- scripts/engine-3d.js – passed to `ImageEmbedder.createFromOptions()`.
DETECTOR_OPTIONS
Pre-built TinyFaceDetector options reused across every face-api detection call so the inference parameters stay consistent between the live loop, the efficacy composite, and the save/find pipelines. scoreThreshold is the minimum confidence for a face to be reported; inputSize is the square input dimension fed to the detector (larger = more accurate, slower).
- See:
- scripts/engine.js – `detectFaceInCam`, `runEffectPass`, `compositeAndDetect`.
RECORDING_CONFIG
Defaults for the in-app one-second video recording feature. Mode selects between a direct browser download and an HTTP POST to a backend endpoint; the upload contract is documented inline so the backend implementer doesn't need to read the recording code.
- See:
- scripts/camera.js – `recordOneSecond()` reads `mode`, `uploadEndpoint`, `durationMs`.