@moveris/shared 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +97 -23
- package/dist/index.mjs +95 -23
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
type Verdict = 'live' | 'fake';
|
|
2
|
-
|
|
2
|
+
interface ModelEntry {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
min_frames: number;
|
|
7
|
+
deprecated: boolean;
|
|
8
|
+
}
|
|
9
|
+
type ModelsResponse = ModelEntry[];
|
|
10
|
+
type FastCheckModel = '10' | '50' | '250' | 'hybrid-v2-10' | 'hybrid-v2-30' | 'hybrid-v2-50' | 'hybrid-v2-60' | 'hybrid-v2-90' | 'hybrid-v2-100' | 'hybrid-v2-125' | 'hybrid-v2-150' | 'hybrid-v2-250' | 'mixed-10' | 'mixed-30' | 'mixed-60' | 'mixed-90' | 'mixed-120' | 'mixed-150' | 'mixed-250' | 'mixed-10-v2' | 'mixed-30-v2' | 'mixed-60-v2' | 'mixed-90-v2' | 'mixed-120-v2' | (string & object);
|
|
3
11
|
type StreamingStatus = 'buffering' | 'complete';
|
|
4
12
|
type FrameSource = 'media' | 'live';
|
|
5
13
|
type JobStatus = 'queued' | 'processing' | 'complete' | 'failed';
|
|
@@ -172,6 +180,7 @@ interface ModelConfig {
|
|
|
172
180
|
minFrames: number;
|
|
173
181
|
recommendedFrames: number;
|
|
174
182
|
description: string;
|
|
183
|
+
deprecated: boolean;
|
|
175
184
|
}
|
|
176
185
|
declare const MODEL_CONFIGS: Record<FastCheckModel, ModelConfig>;
|
|
177
186
|
interface HybridModelConfig {
|
|
@@ -184,6 +193,8 @@ interface HybridModelConfig {
|
|
|
184
193
|
declare const HYBRID_MODEL_CONFIGS: Record<string, HybridModelConfig>;
|
|
185
194
|
declare function getMinFramesForModel(model: FastCheckModel): number;
|
|
186
195
|
declare function hasEnoughFrames(model: FastCheckModel, frameCount: number): boolean;
|
|
196
|
+
declare function isDeprecatedModel(model: FastCheckModel): boolean;
|
|
197
|
+
declare function getActiveModels(): ModelConfig[];
|
|
187
198
|
|
|
188
199
|
interface Frame {
|
|
189
200
|
index: number;
|
|
@@ -450,6 +461,7 @@ declare class LivenessClient {
|
|
|
450
461
|
private static extractCodeFromText;
|
|
451
462
|
private requestWithRetry;
|
|
452
463
|
health(): Promise<HealthResponse>;
|
|
464
|
+
getModels(): Promise<ModelEntry[]>;
|
|
453
465
|
queueStats(): Promise<QueueStatsResponse>;
|
|
454
466
|
fastCheck(frames: CapturedFrame[], options?: {
|
|
455
467
|
sessionId?: string;
|
|
@@ -546,6 +558,7 @@ declare const API_ENDPOINTS: {
|
|
|
546
558
|
declare const DEFAULT_ENDPOINT: "https://api.moveris.com";
|
|
547
559
|
declare const API_PATHS: {
|
|
548
560
|
readonly health: "/health";
|
|
561
|
+
readonly models: "/api/v1/models";
|
|
549
562
|
readonly fastCheck: "/api/v1/fast-check";
|
|
550
563
|
readonly fastCheckCrops: "/api/v1/fast-check-crops";
|
|
551
564
|
readonly fastCheckStream: "/api/v1/fast-check-stream";
|
|
@@ -749,4 +762,4 @@ declare function analyzeEyeRegionContrast(pixels: Uint8Array | Uint8ClampedArray
|
|
|
749
762
|
declare function detectSpecularHighlights(pixels: Uint8Array | Uint8ClampedArray, threshold?: number): number;
|
|
750
763
|
declare function checkEyeRegionQuality(pixels: Uint8Array | Uint8ClampedArray, thresholds?: EyeQualityThresholds): EyeRegionQuality;
|
|
751
764
|
|
|
752
|
-
export { ALIGNMENT_THRESHOLD_CAPTURE, ALIGNMENT_THRESHOLD_GOOD, ALIGNMENT_THRESHOLD_PERFECT, ALIGNMENT_THRESHOLD_POOR, API_ENDPOINTS, API_ERROR_CODES, API_PATHS, AUTH_CONFIG, type ApiErrorCode, BACKLIT_RATIO_THRESHOLD, BLUR_THRESHOLD_MOBILE, BaseFrameCollector, type BlurAnalysis, type CaptureQualityState, type CapturedFrame, type CropData, DEFAULT_BLUR_THRESHOLD, DEFAULT_ENDPOINT, DEFAULT_FACE_DETECTION_TIERS, DEFAULT_GAZE_THRESHOLDS, DEFAULT_HAND_OCCLUSION_CONFIG, DEFAULT_LIVENESS_CONFIG, DEFAULT_LOCALE, DEFAULT_OVAL_REGION, DEFAULT_STABILIZER_CONFIG, DEFAULT_STATUS_MESSAGES, type DetectionResult, type DetectionSummary, type DetectorConfig, ERROR_MESSAGES, ERROR_MESSAGES_ES, ES_LOCALE, EYE_LANDMARK_INDICES, EYE_QUALITY_THRESHOLDS, type ErrorResponse, type EyeQualityThresholds, type EyeRegionBounds, type EyeRegionQuality, type EyeRegionsBounds, FACE_CENTER_VERTICAL_OFFSET, FACE_CROP_OUTPUT_SIZE, FEEDBACK_MESSAGES, FRAME_BUFFER_CONFIG, FRAME_CONFIG, type FaceAlignmentResult, type FaceBoundingBox, type FaceDetectionTiers, type FaceInOvalResult, type FaceLandmarkPoint, type FaceVisibilityResult, type FastCheckCropsRequest, type FastCheckModel, type FastCheckRequest, type FastCheckResponse, type FastCheckStreamRequest, type FastCheckStreamResponse, type FeedbackLocale, type FeedbackMessageKey, type Frame, FrameBuffer, type FrameData, type FrameQualityResult, FrameQueue, type FrameSource, GOOD_ALIGNMENT, type GazeThresholds, HIGH_ALIGNMENT, HYBRID_MODEL_CONFIGS, type HandOcclusionConfig, type HeadPose, type HealthResponse, type Hybrid150CheckRequest, type Hybrid50CheckRequest, type HybridCheckRequest, type HybridCheckResponse, type HybridFrameData, type HybridModelConfig, IDEAL_CROP_MULTIPLIER, type JobStatus, type JobStatusResponse, LANDMARK_INDEX, LANDMARK_MAX_BOUND, LANDMARK_MIN_BOUND, LOW_LIGHT_THRESHOLD, type LandmarkValidationResult, type LightingAnalysis, LivenessApiError, type LivenessCallbacks, LivenessClient, type LivenessClientConfig, type LivenessConfig, type LivenessResult, type LivenessState, MAX_CROP_MULTIPLIER, MAX_FACE_PERCENTAGE_IN_CROP, MAX_FACE_RATIO, MIN_CAPTURE_ALIGNMENT, MIN_CROP_MULTIPLIER, MIN_FACE_BOTTOM_MARGIN, MIN_FACE_RATIO, MIN_FACE_SIDE_MARGIN, MIN_FACE_TOP_MARGIN, MIN_LANDMARK_COUNT, MODEL_CONFIGS, type ModelConfig, type ModelType, OVAL_GUIDE_COLORS, OVAL_GUIDE_STYLES, type OnErrorCallback, type OnFrameCapturedCallback, type OnProgressCallback, type OnResultCallback, type OnStateChangeCallback, type OvalGuideState, type OvalRegion, type QueueStatsResponse, RETRY_CONFIG, type RetryOptions, type StabilizationProgress, type StabilizationResult, type StabilizerConfig, type StatusMessageKey, type StreamingStatus, TARGET_FACE_PERCENTAGE_IN_CROP, type Verdict, type VerifyRequest, type VerifyResponse, type VideoFrameMetadata, analyzeBlur, analyzeEyeRegionBrightness, analyzeEyeRegionContrast, analyzeLighting, calculateAdaptiveCropMultiplier, calculateBrightness, calculateFaceAlignment, calculateFaceCropRegion, canCaptureFrame, checkEyeRegionQuality, checkFrameQuality, decodeBase64, detectSpecularHighlights, encodeBase64, generateSessionId, getApiErrorMessage, getCaptureQualityFeedback, getEyeRegionBounds, getFeedbackMessage, getMinFramesForModel, getOvalGuideState, getStatusMessage, hasEnoughFrames, isFaceCropFullyInFrame, isFaceFullyVisible, isFaceInOval, isRetryableError, retryWithBackoff, rgbaToGrayscale, sleep, toFrameData, toHybridFrameData, toLivenessResult, toLivenessResultFromStream, validateApiKey, validateFaceLandmarks, validateFrameCount, validateFrameData, validateFrameIndex, validateTimestamp, validateUUID, validateUrl };
|
|
765
|
+
export { ALIGNMENT_THRESHOLD_CAPTURE, ALIGNMENT_THRESHOLD_GOOD, ALIGNMENT_THRESHOLD_PERFECT, ALIGNMENT_THRESHOLD_POOR, API_ENDPOINTS, API_ERROR_CODES, API_PATHS, AUTH_CONFIG, type ApiErrorCode, BACKLIT_RATIO_THRESHOLD, BLUR_THRESHOLD_MOBILE, BaseFrameCollector, type BlurAnalysis, type CaptureQualityState, type CapturedFrame, type CropData, DEFAULT_BLUR_THRESHOLD, DEFAULT_ENDPOINT, DEFAULT_FACE_DETECTION_TIERS, DEFAULT_GAZE_THRESHOLDS, DEFAULT_HAND_OCCLUSION_CONFIG, DEFAULT_LIVENESS_CONFIG, DEFAULT_LOCALE, DEFAULT_OVAL_REGION, DEFAULT_STABILIZER_CONFIG, DEFAULT_STATUS_MESSAGES, type DetectionResult, type DetectionSummary, type DetectorConfig, ERROR_MESSAGES, ERROR_MESSAGES_ES, ES_LOCALE, EYE_LANDMARK_INDICES, EYE_QUALITY_THRESHOLDS, type ErrorResponse, type EyeQualityThresholds, type EyeRegionBounds, type EyeRegionQuality, type EyeRegionsBounds, FACE_CENTER_VERTICAL_OFFSET, FACE_CROP_OUTPUT_SIZE, FEEDBACK_MESSAGES, FRAME_BUFFER_CONFIG, FRAME_CONFIG, type FaceAlignmentResult, type FaceBoundingBox, type FaceDetectionTiers, type FaceInOvalResult, type FaceLandmarkPoint, type FaceVisibilityResult, type FastCheckCropsRequest, type FastCheckModel, type FastCheckRequest, type FastCheckResponse, type FastCheckStreamRequest, type FastCheckStreamResponse, type FeedbackLocale, type FeedbackMessageKey, type Frame, FrameBuffer, type FrameData, type FrameQualityResult, FrameQueue, type FrameSource, GOOD_ALIGNMENT, type GazeThresholds, HIGH_ALIGNMENT, HYBRID_MODEL_CONFIGS, type HandOcclusionConfig, type HeadPose, type HealthResponse, type Hybrid150CheckRequest, type Hybrid50CheckRequest, type HybridCheckRequest, type HybridCheckResponse, type HybridFrameData, type HybridModelConfig, IDEAL_CROP_MULTIPLIER, type JobStatus, type JobStatusResponse, LANDMARK_INDEX, LANDMARK_MAX_BOUND, LANDMARK_MIN_BOUND, LOW_LIGHT_THRESHOLD, type LandmarkValidationResult, type LightingAnalysis, LivenessApiError, type LivenessCallbacks, LivenessClient, type LivenessClientConfig, type LivenessConfig, type LivenessResult, type LivenessState, MAX_CROP_MULTIPLIER, MAX_FACE_PERCENTAGE_IN_CROP, MAX_FACE_RATIO, MIN_CAPTURE_ALIGNMENT, MIN_CROP_MULTIPLIER, MIN_FACE_BOTTOM_MARGIN, MIN_FACE_RATIO, MIN_FACE_SIDE_MARGIN, MIN_FACE_TOP_MARGIN, MIN_LANDMARK_COUNT, MODEL_CONFIGS, type ModelConfig, type ModelEntry, type ModelType, type ModelsResponse, OVAL_GUIDE_COLORS, OVAL_GUIDE_STYLES, type OnErrorCallback, type OnFrameCapturedCallback, type OnProgressCallback, type OnResultCallback, type OnStateChangeCallback, type OvalGuideState, type OvalRegion, type QueueStatsResponse, RETRY_CONFIG, type RetryOptions, type StabilizationProgress, type StabilizationResult, type StabilizerConfig, type StatusMessageKey, type StreamingStatus, TARGET_FACE_PERCENTAGE_IN_CROP, type Verdict, type VerifyRequest, type VerifyResponse, type VideoFrameMetadata, analyzeBlur, analyzeEyeRegionBrightness, analyzeEyeRegionContrast, analyzeLighting, calculateAdaptiveCropMultiplier, calculateBrightness, calculateFaceAlignment, calculateFaceCropRegion, canCaptureFrame, checkEyeRegionQuality, checkFrameQuality, decodeBase64, detectSpecularHighlights, encodeBase64, generateSessionId, getActiveModels, getApiErrorMessage, getCaptureQualityFeedback, getEyeRegionBounds, getFeedbackMessage, getMinFramesForModel, getOvalGuideState, getStatusMessage, hasEnoughFrames, isDeprecatedModel, isFaceCropFullyInFrame, isFaceFullyVisible, isFaceInOval, isRetryableError, retryWithBackoff, rgbaToGrayscale, sleep, toFrameData, toHybridFrameData, toLivenessResult, toLivenessResultFromStream, validateApiKey, validateFaceLandmarks, validateFrameCount, validateFrameData, validateFrameIndex, validateTimestamp, validateUUID, validateUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
type Verdict = 'live' | 'fake';
|
|
2
|
-
|
|
2
|
+
interface ModelEntry {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
min_frames: number;
|
|
7
|
+
deprecated: boolean;
|
|
8
|
+
}
|
|
9
|
+
type ModelsResponse = ModelEntry[];
|
|
10
|
+
type FastCheckModel = '10' | '50' | '250' | 'hybrid-v2-10' | 'hybrid-v2-30' | 'hybrid-v2-50' | 'hybrid-v2-60' | 'hybrid-v2-90' | 'hybrid-v2-100' | 'hybrid-v2-125' | 'hybrid-v2-150' | 'hybrid-v2-250' | 'mixed-10' | 'mixed-30' | 'mixed-60' | 'mixed-90' | 'mixed-120' | 'mixed-150' | 'mixed-250' | 'mixed-10-v2' | 'mixed-30-v2' | 'mixed-60-v2' | 'mixed-90-v2' | 'mixed-120-v2' | (string & object);
|
|
3
11
|
type StreamingStatus = 'buffering' | 'complete';
|
|
4
12
|
type FrameSource = 'media' | 'live';
|
|
5
13
|
type JobStatus = 'queued' | 'processing' | 'complete' | 'failed';
|
|
@@ -172,6 +180,7 @@ interface ModelConfig {
|
|
|
172
180
|
minFrames: number;
|
|
173
181
|
recommendedFrames: number;
|
|
174
182
|
description: string;
|
|
183
|
+
deprecated: boolean;
|
|
175
184
|
}
|
|
176
185
|
declare const MODEL_CONFIGS: Record<FastCheckModel, ModelConfig>;
|
|
177
186
|
interface HybridModelConfig {
|
|
@@ -184,6 +193,8 @@ interface HybridModelConfig {
|
|
|
184
193
|
declare const HYBRID_MODEL_CONFIGS: Record<string, HybridModelConfig>;
|
|
185
194
|
declare function getMinFramesForModel(model: FastCheckModel): number;
|
|
186
195
|
declare function hasEnoughFrames(model: FastCheckModel, frameCount: number): boolean;
|
|
196
|
+
declare function isDeprecatedModel(model: FastCheckModel): boolean;
|
|
197
|
+
declare function getActiveModels(): ModelConfig[];
|
|
187
198
|
|
|
188
199
|
interface Frame {
|
|
189
200
|
index: number;
|
|
@@ -450,6 +461,7 @@ declare class LivenessClient {
|
|
|
450
461
|
private static extractCodeFromText;
|
|
451
462
|
private requestWithRetry;
|
|
452
463
|
health(): Promise<HealthResponse>;
|
|
464
|
+
getModels(): Promise<ModelEntry[]>;
|
|
453
465
|
queueStats(): Promise<QueueStatsResponse>;
|
|
454
466
|
fastCheck(frames: CapturedFrame[], options?: {
|
|
455
467
|
sessionId?: string;
|
|
@@ -546,6 +558,7 @@ declare const API_ENDPOINTS: {
|
|
|
546
558
|
declare const DEFAULT_ENDPOINT: "https://api.moveris.com";
|
|
547
559
|
declare const API_PATHS: {
|
|
548
560
|
readonly health: "/health";
|
|
561
|
+
readonly models: "/api/v1/models";
|
|
549
562
|
readonly fastCheck: "/api/v1/fast-check";
|
|
550
563
|
readonly fastCheckCrops: "/api/v1/fast-check-crops";
|
|
551
564
|
readonly fastCheckStream: "/api/v1/fast-check-stream";
|
|
@@ -749,4 +762,4 @@ declare function analyzeEyeRegionContrast(pixels: Uint8Array | Uint8ClampedArray
|
|
|
749
762
|
declare function detectSpecularHighlights(pixels: Uint8Array | Uint8ClampedArray, threshold?: number): number;
|
|
750
763
|
declare function checkEyeRegionQuality(pixels: Uint8Array | Uint8ClampedArray, thresholds?: EyeQualityThresholds): EyeRegionQuality;
|
|
751
764
|
|
|
752
|
-
export { ALIGNMENT_THRESHOLD_CAPTURE, ALIGNMENT_THRESHOLD_GOOD, ALIGNMENT_THRESHOLD_PERFECT, ALIGNMENT_THRESHOLD_POOR, API_ENDPOINTS, API_ERROR_CODES, API_PATHS, AUTH_CONFIG, type ApiErrorCode, BACKLIT_RATIO_THRESHOLD, BLUR_THRESHOLD_MOBILE, BaseFrameCollector, type BlurAnalysis, type CaptureQualityState, type CapturedFrame, type CropData, DEFAULT_BLUR_THRESHOLD, DEFAULT_ENDPOINT, DEFAULT_FACE_DETECTION_TIERS, DEFAULT_GAZE_THRESHOLDS, DEFAULT_HAND_OCCLUSION_CONFIG, DEFAULT_LIVENESS_CONFIG, DEFAULT_LOCALE, DEFAULT_OVAL_REGION, DEFAULT_STABILIZER_CONFIG, DEFAULT_STATUS_MESSAGES, type DetectionResult, type DetectionSummary, type DetectorConfig, ERROR_MESSAGES, ERROR_MESSAGES_ES, ES_LOCALE, EYE_LANDMARK_INDICES, EYE_QUALITY_THRESHOLDS, type ErrorResponse, type EyeQualityThresholds, type EyeRegionBounds, type EyeRegionQuality, type EyeRegionsBounds, FACE_CENTER_VERTICAL_OFFSET, FACE_CROP_OUTPUT_SIZE, FEEDBACK_MESSAGES, FRAME_BUFFER_CONFIG, FRAME_CONFIG, type FaceAlignmentResult, type FaceBoundingBox, type FaceDetectionTiers, type FaceInOvalResult, type FaceLandmarkPoint, type FaceVisibilityResult, type FastCheckCropsRequest, type FastCheckModel, type FastCheckRequest, type FastCheckResponse, type FastCheckStreamRequest, type FastCheckStreamResponse, type FeedbackLocale, type FeedbackMessageKey, type Frame, FrameBuffer, type FrameData, type FrameQualityResult, FrameQueue, type FrameSource, GOOD_ALIGNMENT, type GazeThresholds, HIGH_ALIGNMENT, HYBRID_MODEL_CONFIGS, type HandOcclusionConfig, type HeadPose, type HealthResponse, type Hybrid150CheckRequest, type Hybrid50CheckRequest, type HybridCheckRequest, type HybridCheckResponse, type HybridFrameData, type HybridModelConfig, IDEAL_CROP_MULTIPLIER, type JobStatus, type JobStatusResponse, LANDMARK_INDEX, LANDMARK_MAX_BOUND, LANDMARK_MIN_BOUND, LOW_LIGHT_THRESHOLD, type LandmarkValidationResult, type LightingAnalysis, LivenessApiError, type LivenessCallbacks, LivenessClient, type LivenessClientConfig, type LivenessConfig, type LivenessResult, type LivenessState, MAX_CROP_MULTIPLIER, MAX_FACE_PERCENTAGE_IN_CROP, MAX_FACE_RATIO, MIN_CAPTURE_ALIGNMENT, MIN_CROP_MULTIPLIER, MIN_FACE_BOTTOM_MARGIN, MIN_FACE_RATIO, MIN_FACE_SIDE_MARGIN, MIN_FACE_TOP_MARGIN, MIN_LANDMARK_COUNT, MODEL_CONFIGS, type ModelConfig, type ModelType, OVAL_GUIDE_COLORS, OVAL_GUIDE_STYLES, type OnErrorCallback, type OnFrameCapturedCallback, type OnProgressCallback, type OnResultCallback, type OnStateChangeCallback, type OvalGuideState, type OvalRegion, type QueueStatsResponse, RETRY_CONFIG, type RetryOptions, type StabilizationProgress, type StabilizationResult, type StabilizerConfig, type StatusMessageKey, type StreamingStatus, TARGET_FACE_PERCENTAGE_IN_CROP, type Verdict, type VerifyRequest, type VerifyResponse, type VideoFrameMetadata, analyzeBlur, analyzeEyeRegionBrightness, analyzeEyeRegionContrast, analyzeLighting, calculateAdaptiveCropMultiplier, calculateBrightness, calculateFaceAlignment, calculateFaceCropRegion, canCaptureFrame, checkEyeRegionQuality, checkFrameQuality, decodeBase64, detectSpecularHighlights, encodeBase64, generateSessionId, getApiErrorMessage, getCaptureQualityFeedback, getEyeRegionBounds, getFeedbackMessage, getMinFramesForModel, getOvalGuideState, getStatusMessage, hasEnoughFrames, isFaceCropFullyInFrame, isFaceFullyVisible, isFaceInOval, isRetryableError, retryWithBackoff, rgbaToGrayscale, sleep, toFrameData, toHybridFrameData, toLivenessResult, toLivenessResultFromStream, validateApiKey, validateFaceLandmarks, validateFrameCount, validateFrameData, validateFrameIndex, validateTimestamp, validateUUID, validateUrl };
|
|
765
|
+
export { ALIGNMENT_THRESHOLD_CAPTURE, ALIGNMENT_THRESHOLD_GOOD, ALIGNMENT_THRESHOLD_PERFECT, ALIGNMENT_THRESHOLD_POOR, API_ENDPOINTS, API_ERROR_CODES, API_PATHS, AUTH_CONFIG, type ApiErrorCode, BACKLIT_RATIO_THRESHOLD, BLUR_THRESHOLD_MOBILE, BaseFrameCollector, type BlurAnalysis, type CaptureQualityState, type CapturedFrame, type CropData, DEFAULT_BLUR_THRESHOLD, DEFAULT_ENDPOINT, DEFAULT_FACE_DETECTION_TIERS, DEFAULT_GAZE_THRESHOLDS, DEFAULT_HAND_OCCLUSION_CONFIG, DEFAULT_LIVENESS_CONFIG, DEFAULT_LOCALE, DEFAULT_OVAL_REGION, DEFAULT_STABILIZER_CONFIG, DEFAULT_STATUS_MESSAGES, type DetectionResult, type DetectionSummary, type DetectorConfig, ERROR_MESSAGES, ERROR_MESSAGES_ES, ES_LOCALE, EYE_LANDMARK_INDICES, EYE_QUALITY_THRESHOLDS, type ErrorResponse, type EyeQualityThresholds, type EyeRegionBounds, type EyeRegionQuality, type EyeRegionsBounds, FACE_CENTER_VERTICAL_OFFSET, FACE_CROP_OUTPUT_SIZE, FEEDBACK_MESSAGES, FRAME_BUFFER_CONFIG, FRAME_CONFIG, type FaceAlignmentResult, type FaceBoundingBox, type FaceDetectionTiers, type FaceInOvalResult, type FaceLandmarkPoint, type FaceVisibilityResult, type FastCheckCropsRequest, type FastCheckModel, type FastCheckRequest, type FastCheckResponse, type FastCheckStreamRequest, type FastCheckStreamResponse, type FeedbackLocale, type FeedbackMessageKey, type Frame, FrameBuffer, type FrameData, type FrameQualityResult, FrameQueue, type FrameSource, GOOD_ALIGNMENT, type GazeThresholds, HIGH_ALIGNMENT, HYBRID_MODEL_CONFIGS, type HandOcclusionConfig, type HeadPose, type HealthResponse, type Hybrid150CheckRequest, type Hybrid50CheckRequest, type HybridCheckRequest, type HybridCheckResponse, type HybridFrameData, type HybridModelConfig, IDEAL_CROP_MULTIPLIER, type JobStatus, type JobStatusResponse, LANDMARK_INDEX, LANDMARK_MAX_BOUND, LANDMARK_MIN_BOUND, LOW_LIGHT_THRESHOLD, type LandmarkValidationResult, type LightingAnalysis, LivenessApiError, type LivenessCallbacks, LivenessClient, type LivenessClientConfig, type LivenessConfig, type LivenessResult, type LivenessState, MAX_CROP_MULTIPLIER, MAX_FACE_PERCENTAGE_IN_CROP, MAX_FACE_RATIO, MIN_CAPTURE_ALIGNMENT, MIN_CROP_MULTIPLIER, MIN_FACE_BOTTOM_MARGIN, MIN_FACE_RATIO, MIN_FACE_SIDE_MARGIN, MIN_FACE_TOP_MARGIN, MIN_LANDMARK_COUNT, MODEL_CONFIGS, type ModelConfig, type ModelEntry, type ModelType, type ModelsResponse, OVAL_GUIDE_COLORS, OVAL_GUIDE_STYLES, type OnErrorCallback, type OnFrameCapturedCallback, type OnProgressCallback, type OnResultCallback, type OnStateChangeCallback, type OvalGuideState, type OvalRegion, type QueueStatsResponse, RETRY_CONFIG, type RetryOptions, type StabilizationProgress, type StabilizationResult, type StabilizerConfig, type StatusMessageKey, type StreamingStatus, TARGET_FACE_PERCENTAGE_IN_CROP, type Verdict, type VerifyRequest, type VerifyResponse, type VideoFrameMetadata, analyzeBlur, analyzeEyeRegionBrightness, analyzeEyeRegionContrast, analyzeLighting, calculateAdaptiveCropMultiplier, calculateBrightness, calculateFaceAlignment, calculateFaceCropRegion, canCaptureFrame, checkEyeRegionQuality, checkFrameQuality, decodeBase64, detectSpecularHighlights, encodeBase64, generateSessionId, getActiveModels, getApiErrorMessage, getCaptureQualityFeedback, getEyeRegionBounds, getFeedbackMessage, getMinFramesForModel, getOvalGuideState, getStatusMessage, hasEnoughFrames, isDeprecatedModel, isFaceCropFullyInFrame, isFaceFullyVisible, isFaceInOval, isRetryableError, retryWithBackoff, rgbaToGrayscale, sleep, toFrameData, toHybridFrameData, toLivenessResult, toLivenessResultFromStream, validateApiKey, validateFaceLandmarks, validateFrameCount, validateFrameData, validateFrameIndex, validateTimestamp, validateUUID, validateUrl };
|
package/dist/index.js
CHANGED
|
@@ -93,6 +93,7 @@ __export(index_exports, {
|
|
|
93
93
|
detectSpecularHighlights: () => detectSpecularHighlights,
|
|
94
94
|
encodeBase64: () => encodeBase64,
|
|
95
95
|
generateSessionId: () => generateSessionId,
|
|
96
|
+
getActiveModels: () => getActiveModels,
|
|
96
97
|
getApiErrorMessage: () => getApiErrorMessage,
|
|
97
98
|
getCaptureQualityFeedback: () => getCaptureQualityFeedback,
|
|
98
99
|
getEyeRegionBounds: () => getEyeRegionBounds,
|
|
@@ -101,6 +102,7 @@ __export(index_exports, {
|
|
|
101
102
|
getOvalGuideState: () => getOvalGuideState,
|
|
102
103
|
getStatusMessage: () => getStatusMessage,
|
|
103
104
|
hasEnoughFrames: () => hasEnoughFrames,
|
|
105
|
+
isDeprecatedModel: () => isDeprecatedModel,
|
|
104
106
|
isFaceCropFullyInFrame: () => isFaceCropFullyInFrame,
|
|
105
107
|
isFaceFullyVisible: () => isFaceFullyVisible,
|
|
106
108
|
isFaceInOval: () => isFaceInOval,
|
|
@@ -132,6 +134,7 @@ var API_ENDPOINTS = {
|
|
|
132
134
|
var DEFAULT_ENDPOINT = API_ENDPOINTS.production;
|
|
133
135
|
var API_PATHS = {
|
|
134
136
|
health: "/health",
|
|
137
|
+
models: "/api/v1/models",
|
|
135
138
|
fastCheck: "/api/v1/fast-check",
|
|
136
139
|
fastCheckCrops: "/api/v1/fast-check-crops",
|
|
137
140
|
fastCheckStream: "/api/v1/fast-check-stream",
|
|
@@ -419,6 +422,14 @@ var LivenessClient = class _LivenessClient {
|
|
|
419
422
|
async health() {
|
|
420
423
|
return this.request(API_PATHS.health);
|
|
421
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
* Fetch the full model registry from the API.
|
|
427
|
+
* Includes all models with their deprecated status.
|
|
428
|
+
* Use this instead of the local MODEL_CONFIGS for a live list.
|
|
429
|
+
*/
|
|
430
|
+
async getModels() {
|
|
431
|
+
return this.request(API_PATHS.models);
|
|
432
|
+
}
|
|
422
433
|
/**
|
|
423
434
|
* Get queue statistics
|
|
424
435
|
*/
|
|
@@ -868,117 +879,172 @@ var MODEL_CONFIGS = {
|
|
|
868
879
|
type: "10",
|
|
869
880
|
minFrames: 10,
|
|
870
881
|
recommendedFrames: 10,
|
|
871
|
-
description: "Fast model - 10 frames, quick verification"
|
|
882
|
+
description: "Fast model - 10 frames, quick verification",
|
|
883
|
+
deprecated: false
|
|
872
884
|
},
|
|
873
885
|
"50": {
|
|
874
886
|
type: "50",
|
|
875
887
|
minFrames: 50,
|
|
876
888
|
recommendedFrames: 50,
|
|
877
|
-
description: "Balanced model - 50 frames, good accuracy"
|
|
889
|
+
description: "Balanced model - 50 frames, good accuracy",
|
|
890
|
+
deprecated: false
|
|
878
891
|
},
|
|
879
892
|
"250": {
|
|
880
893
|
type: "250",
|
|
881
894
|
minFrames: 250,
|
|
882
895
|
recommendedFrames: 250,
|
|
883
|
-
description: "High-accuracy model - 250 frames, best accuracy"
|
|
896
|
+
description: "High-accuracy model - 250 frames, best accuracy",
|
|
897
|
+
deprecated: false
|
|
884
898
|
},
|
|
885
899
|
// Hybrid V2 models with physiological features
|
|
886
900
|
"hybrid-v2-10": {
|
|
887
901
|
type: "hybrid-v2-10",
|
|
888
902
|
minFrames: 10,
|
|
889
903
|
recommendedFrames: 10,
|
|
890
|
-
description: "Hybrid V2 10-frame model with physio features"
|
|
904
|
+
description: "Hybrid V2 10-frame model with physio features",
|
|
905
|
+
deprecated: false
|
|
891
906
|
},
|
|
892
907
|
"hybrid-v2-30": {
|
|
893
908
|
type: "hybrid-v2-30",
|
|
894
909
|
minFrames: 30,
|
|
895
910
|
recommendedFrames: 30,
|
|
896
|
-
description: "Hybrid V2 30-frame model with physio features"
|
|
911
|
+
description: "Hybrid V2 30-frame model with physio features",
|
|
912
|
+
deprecated: false
|
|
897
913
|
},
|
|
898
914
|
"hybrid-v2-50": {
|
|
899
915
|
type: "hybrid-v2-50",
|
|
900
916
|
minFrames: 50,
|
|
901
917
|
recommendedFrames: 50,
|
|
902
|
-
description: "Hybrid V2 50-frame model with physio features"
|
|
918
|
+
description: "Hybrid V2 50-frame model with physio features",
|
|
919
|
+
deprecated: false
|
|
903
920
|
},
|
|
904
921
|
"hybrid-v2-60": {
|
|
905
922
|
type: "hybrid-v2-60",
|
|
906
923
|
minFrames: 60,
|
|
907
924
|
recommendedFrames: 60,
|
|
908
|
-
description: "Hybrid V2 60-frame model with physio features"
|
|
925
|
+
description: "Hybrid V2 60-frame model with physio features",
|
|
926
|
+
deprecated: false
|
|
909
927
|
},
|
|
910
928
|
"hybrid-v2-90": {
|
|
911
929
|
type: "hybrid-v2-90",
|
|
912
930
|
minFrames: 90,
|
|
913
931
|
recommendedFrames: 90,
|
|
914
|
-
description: "Hybrid V2 90-frame model with physio features"
|
|
932
|
+
description: "Hybrid V2 90-frame model with physio features",
|
|
933
|
+
deprecated: false
|
|
915
934
|
},
|
|
916
935
|
"hybrid-v2-100": {
|
|
917
936
|
type: "hybrid-v2-100",
|
|
918
937
|
minFrames: 100,
|
|
919
938
|
recommendedFrames: 100,
|
|
920
|
-
description: "Hybrid V2 100-frame model with physio features"
|
|
939
|
+
description: "Hybrid V2 100-frame model with physio features",
|
|
940
|
+
deprecated: false
|
|
921
941
|
},
|
|
922
942
|
"hybrid-v2-125": {
|
|
923
943
|
type: "hybrid-v2-125",
|
|
924
944
|
minFrames: 125,
|
|
925
945
|
recommendedFrames: 125,
|
|
926
|
-
description: "Hybrid V2 125-frame model with physio features"
|
|
946
|
+
description: "Hybrid V2 125-frame model with physio features",
|
|
947
|
+
deprecated: false
|
|
927
948
|
},
|
|
928
949
|
"hybrid-v2-150": {
|
|
929
950
|
type: "hybrid-v2-150",
|
|
930
951
|
minFrames: 150,
|
|
931
952
|
recommendedFrames: 150,
|
|
932
|
-
description: "Hybrid V2 150-frame model with physio features"
|
|
953
|
+
description: "Hybrid V2 150-frame model with physio features",
|
|
954
|
+
deprecated: false
|
|
933
955
|
},
|
|
934
956
|
"hybrid-v2-250": {
|
|
935
957
|
type: "hybrid-v2-250",
|
|
936
958
|
minFrames: 250,
|
|
937
959
|
recommendedFrames: 250,
|
|
938
|
-
description: "Hybrid V2 250-frame model with physio features"
|
|
960
|
+
description: "Hybrid V2 250-frame model with physio features",
|
|
961
|
+
deprecated: false
|
|
939
962
|
},
|
|
940
|
-
// Mixed models
|
|
963
|
+
// Mixed V1 models — deprecated, use mixed-*-v2 equivalents instead
|
|
941
964
|
"mixed-10": {
|
|
942
965
|
type: "mixed-10",
|
|
943
966
|
minFrames: 10,
|
|
944
967
|
recommendedFrames: 10,
|
|
945
|
-
description: "Mixed 10-frame model"
|
|
968
|
+
description: "Mixed 10-frame model",
|
|
969
|
+
deprecated: true
|
|
946
970
|
},
|
|
947
971
|
"mixed-30": {
|
|
948
972
|
type: "mixed-30",
|
|
949
973
|
minFrames: 30,
|
|
950
974
|
recommendedFrames: 30,
|
|
951
|
-
description: "Mixed 30-frame model"
|
|
975
|
+
description: "Mixed 30-frame model",
|
|
976
|
+
deprecated: true
|
|
952
977
|
},
|
|
953
978
|
"mixed-60": {
|
|
954
979
|
type: "mixed-60",
|
|
955
980
|
minFrames: 60,
|
|
956
981
|
recommendedFrames: 60,
|
|
957
|
-
description: "Mixed 60-frame model"
|
|
982
|
+
description: "Mixed 60-frame model",
|
|
983
|
+
deprecated: true
|
|
958
984
|
},
|
|
959
985
|
"mixed-90": {
|
|
960
986
|
type: "mixed-90",
|
|
961
987
|
minFrames: 90,
|
|
962
988
|
recommendedFrames: 90,
|
|
963
|
-
description: "Mixed 90-frame model"
|
|
989
|
+
description: "Mixed 90-frame model",
|
|
990
|
+
deprecated: true
|
|
964
991
|
},
|
|
965
992
|
"mixed-120": {
|
|
966
993
|
type: "mixed-120",
|
|
967
994
|
minFrames: 120,
|
|
968
995
|
recommendedFrames: 120,
|
|
969
|
-
description: "Mixed 120-frame model"
|
|
996
|
+
description: "Mixed 120-frame model",
|
|
997
|
+
deprecated: true
|
|
970
998
|
},
|
|
971
999
|
"mixed-150": {
|
|
972
1000
|
type: "mixed-150",
|
|
973
1001
|
minFrames: 150,
|
|
974
1002
|
recommendedFrames: 150,
|
|
975
|
-
description: "Mixed 150-frame model"
|
|
1003
|
+
description: "Mixed 150-frame model",
|
|
1004
|
+
deprecated: true
|
|
976
1005
|
},
|
|
977
1006
|
"mixed-250": {
|
|
978
1007
|
type: "mixed-250",
|
|
979
1008
|
minFrames: 250,
|
|
980
1009
|
recommendedFrames: 250,
|
|
981
|
-
description: "Mixed 250-frame model"
|
|
1010
|
+
description: "Mixed 250-frame model",
|
|
1011
|
+
deprecated: true
|
|
1012
|
+
},
|
|
1013
|
+
// Mixed V2 models (exp_042 checkpoints — EER: 4.0% / AUC: 0.991 at 30f)
|
|
1014
|
+
"mixed-10-v2": {
|
|
1015
|
+
type: "mixed-10-v2",
|
|
1016
|
+
minFrames: 10,
|
|
1017
|
+
recommendedFrames: 10,
|
|
1018
|
+
description: "Mixed V2 10-frame model",
|
|
1019
|
+
deprecated: false
|
|
1020
|
+
},
|
|
1021
|
+
"mixed-30-v2": {
|
|
1022
|
+
type: "mixed-30-v2",
|
|
1023
|
+
minFrames: 30,
|
|
1024
|
+
recommendedFrames: 30,
|
|
1025
|
+
description: "Mixed V2 30-frame model (recommended \u2014 95.7% balanced accuracy)",
|
|
1026
|
+
deprecated: false
|
|
1027
|
+
},
|
|
1028
|
+
"mixed-60-v2": {
|
|
1029
|
+
type: "mixed-60-v2",
|
|
1030
|
+
minFrames: 60,
|
|
1031
|
+
recommendedFrames: 60,
|
|
1032
|
+
description: "Mixed V2 60-frame model",
|
|
1033
|
+
deprecated: false
|
|
1034
|
+
},
|
|
1035
|
+
"mixed-90-v2": {
|
|
1036
|
+
type: "mixed-90-v2",
|
|
1037
|
+
minFrames: 90,
|
|
1038
|
+
recommendedFrames: 90,
|
|
1039
|
+
description: "Mixed V2 90-frame model",
|
|
1040
|
+
deprecated: false
|
|
1041
|
+
},
|
|
1042
|
+
"mixed-120-v2": {
|
|
1043
|
+
type: "mixed-120-v2",
|
|
1044
|
+
minFrames: 120,
|
|
1045
|
+
recommendedFrames: 120,
|
|
1046
|
+
description: "Mixed V2 120-frame model",
|
|
1047
|
+
deprecated: false
|
|
982
1048
|
}
|
|
983
1049
|
};
|
|
984
1050
|
var HYBRID_MODEL_CONFIGS = {
|
|
@@ -998,10 +1064,16 @@ var HYBRID_MODEL_CONFIGS = {
|
|
|
998
1064
|
}
|
|
999
1065
|
};
|
|
1000
1066
|
function getMinFramesForModel(model) {
|
|
1001
|
-
return MODEL_CONFIGS[model]
|
|
1067
|
+
return MODEL_CONFIGS[model]?.minFrames ?? 10;
|
|
1002
1068
|
}
|
|
1003
1069
|
function hasEnoughFrames(model, frameCount) {
|
|
1004
|
-
return frameCount >=
|
|
1070
|
+
return frameCount >= getMinFramesForModel(model);
|
|
1071
|
+
}
|
|
1072
|
+
function isDeprecatedModel(model) {
|
|
1073
|
+
return MODEL_CONFIGS[model]?.deprecated ?? false;
|
|
1074
|
+
}
|
|
1075
|
+
function getActiveModels() {
|
|
1076
|
+
return Object.values(MODEL_CONFIGS).filter((c) => !c.deprecated);
|
|
1005
1077
|
}
|
|
1006
1078
|
|
|
1007
1079
|
// src/types/detectors.ts
|
|
@@ -1314,7 +1386,7 @@ function validateTimestamp(timestamp) {
|
|
|
1314
1386
|
}
|
|
1315
1387
|
function validateFrameCount(model, frameCount) {
|
|
1316
1388
|
const config = MODEL_CONFIGS[model];
|
|
1317
|
-
const required = config
|
|
1389
|
+
const required = config?.minFrames ?? 10;
|
|
1318
1390
|
return {
|
|
1319
1391
|
valid: frameCount >= required,
|
|
1320
1392
|
required,
|
|
@@ -1907,6 +1979,7 @@ function checkEyeRegionQuality(pixels, thresholds = EYE_QUALITY_THRESHOLDS) {
|
|
|
1907
1979
|
detectSpecularHighlights,
|
|
1908
1980
|
encodeBase64,
|
|
1909
1981
|
generateSessionId,
|
|
1982
|
+
getActiveModels,
|
|
1910
1983
|
getApiErrorMessage,
|
|
1911
1984
|
getCaptureQualityFeedback,
|
|
1912
1985
|
getEyeRegionBounds,
|
|
@@ -1915,6 +1988,7 @@ function checkEyeRegionQuality(pixels, thresholds = EYE_QUALITY_THRESHOLDS) {
|
|
|
1915
1988
|
getOvalGuideState,
|
|
1916
1989
|
getStatusMessage,
|
|
1917
1990
|
hasEnoughFrames,
|
|
1991
|
+
isDeprecatedModel,
|
|
1918
1992
|
isFaceCropFullyInFrame,
|
|
1919
1993
|
isFaceFullyVisible,
|
|
1920
1994
|
isFaceInOval,
|
package/dist/index.mjs
CHANGED
|
@@ -7,6 +7,7 @@ var API_ENDPOINTS = {
|
|
|
7
7
|
var DEFAULT_ENDPOINT = API_ENDPOINTS.production;
|
|
8
8
|
var API_PATHS = {
|
|
9
9
|
health: "/health",
|
|
10
|
+
models: "/api/v1/models",
|
|
10
11
|
fastCheck: "/api/v1/fast-check",
|
|
11
12
|
fastCheckCrops: "/api/v1/fast-check-crops",
|
|
12
13
|
fastCheckStream: "/api/v1/fast-check-stream",
|
|
@@ -294,6 +295,14 @@ var LivenessClient = class _LivenessClient {
|
|
|
294
295
|
async health() {
|
|
295
296
|
return this.request(API_PATHS.health);
|
|
296
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* Fetch the full model registry from the API.
|
|
300
|
+
* Includes all models with their deprecated status.
|
|
301
|
+
* Use this instead of the local MODEL_CONFIGS for a live list.
|
|
302
|
+
*/
|
|
303
|
+
async getModels() {
|
|
304
|
+
return this.request(API_PATHS.models);
|
|
305
|
+
}
|
|
297
306
|
/**
|
|
298
307
|
* Get queue statistics
|
|
299
308
|
*/
|
|
@@ -743,117 +752,172 @@ var MODEL_CONFIGS = {
|
|
|
743
752
|
type: "10",
|
|
744
753
|
minFrames: 10,
|
|
745
754
|
recommendedFrames: 10,
|
|
746
|
-
description: "Fast model - 10 frames, quick verification"
|
|
755
|
+
description: "Fast model - 10 frames, quick verification",
|
|
756
|
+
deprecated: false
|
|
747
757
|
},
|
|
748
758
|
"50": {
|
|
749
759
|
type: "50",
|
|
750
760
|
minFrames: 50,
|
|
751
761
|
recommendedFrames: 50,
|
|
752
|
-
description: "Balanced model - 50 frames, good accuracy"
|
|
762
|
+
description: "Balanced model - 50 frames, good accuracy",
|
|
763
|
+
deprecated: false
|
|
753
764
|
},
|
|
754
765
|
"250": {
|
|
755
766
|
type: "250",
|
|
756
767
|
minFrames: 250,
|
|
757
768
|
recommendedFrames: 250,
|
|
758
|
-
description: "High-accuracy model - 250 frames, best accuracy"
|
|
769
|
+
description: "High-accuracy model - 250 frames, best accuracy",
|
|
770
|
+
deprecated: false
|
|
759
771
|
},
|
|
760
772
|
// Hybrid V2 models with physiological features
|
|
761
773
|
"hybrid-v2-10": {
|
|
762
774
|
type: "hybrid-v2-10",
|
|
763
775
|
minFrames: 10,
|
|
764
776
|
recommendedFrames: 10,
|
|
765
|
-
description: "Hybrid V2 10-frame model with physio features"
|
|
777
|
+
description: "Hybrid V2 10-frame model with physio features",
|
|
778
|
+
deprecated: false
|
|
766
779
|
},
|
|
767
780
|
"hybrid-v2-30": {
|
|
768
781
|
type: "hybrid-v2-30",
|
|
769
782
|
minFrames: 30,
|
|
770
783
|
recommendedFrames: 30,
|
|
771
|
-
description: "Hybrid V2 30-frame model with physio features"
|
|
784
|
+
description: "Hybrid V2 30-frame model with physio features",
|
|
785
|
+
deprecated: false
|
|
772
786
|
},
|
|
773
787
|
"hybrid-v2-50": {
|
|
774
788
|
type: "hybrid-v2-50",
|
|
775
789
|
minFrames: 50,
|
|
776
790
|
recommendedFrames: 50,
|
|
777
|
-
description: "Hybrid V2 50-frame model with physio features"
|
|
791
|
+
description: "Hybrid V2 50-frame model with physio features",
|
|
792
|
+
deprecated: false
|
|
778
793
|
},
|
|
779
794
|
"hybrid-v2-60": {
|
|
780
795
|
type: "hybrid-v2-60",
|
|
781
796
|
minFrames: 60,
|
|
782
797
|
recommendedFrames: 60,
|
|
783
|
-
description: "Hybrid V2 60-frame model with physio features"
|
|
798
|
+
description: "Hybrid V2 60-frame model with physio features",
|
|
799
|
+
deprecated: false
|
|
784
800
|
},
|
|
785
801
|
"hybrid-v2-90": {
|
|
786
802
|
type: "hybrid-v2-90",
|
|
787
803
|
minFrames: 90,
|
|
788
804
|
recommendedFrames: 90,
|
|
789
|
-
description: "Hybrid V2 90-frame model with physio features"
|
|
805
|
+
description: "Hybrid V2 90-frame model with physio features",
|
|
806
|
+
deprecated: false
|
|
790
807
|
},
|
|
791
808
|
"hybrid-v2-100": {
|
|
792
809
|
type: "hybrid-v2-100",
|
|
793
810
|
minFrames: 100,
|
|
794
811
|
recommendedFrames: 100,
|
|
795
|
-
description: "Hybrid V2 100-frame model with physio features"
|
|
812
|
+
description: "Hybrid V2 100-frame model with physio features",
|
|
813
|
+
deprecated: false
|
|
796
814
|
},
|
|
797
815
|
"hybrid-v2-125": {
|
|
798
816
|
type: "hybrid-v2-125",
|
|
799
817
|
minFrames: 125,
|
|
800
818
|
recommendedFrames: 125,
|
|
801
|
-
description: "Hybrid V2 125-frame model with physio features"
|
|
819
|
+
description: "Hybrid V2 125-frame model with physio features",
|
|
820
|
+
deprecated: false
|
|
802
821
|
},
|
|
803
822
|
"hybrid-v2-150": {
|
|
804
823
|
type: "hybrid-v2-150",
|
|
805
824
|
minFrames: 150,
|
|
806
825
|
recommendedFrames: 150,
|
|
807
|
-
description: "Hybrid V2 150-frame model with physio features"
|
|
826
|
+
description: "Hybrid V2 150-frame model with physio features",
|
|
827
|
+
deprecated: false
|
|
808
828
|
},
|
|
809
829
|
"hybrid-v2-250": {
|
|
810
830
|
type: "hybrid-v2-250",
|
|
811
831
|
minFrames: 250,
|
|
812
832
|
recommendedFrames: 250,
|
|
813
|
-
description: "Hybrid V2 250-frame model with physio features"
|
|
833
|
+
description: "Hybrid V2 250-frame model with physio features",
|
|
834
|
+
deprecated: false
|
|
814
835
|
},
|
|
815
|
-
// Mixed models
|
|
836
|
+
// Mixed V1 models — deprecated, use mixed-*-v2 equivalents instead
|
|
816
837
|
"mixed-10": {
|
|
817
838
|
type: "mixed-10",
|
|
818
839
|
minFrames: 10,
|
|
819
840
|
recommendedFrames: 10,
|
|
820
|
-
description: "Mixed 10-frame model"
|
|
841
|
+
description: "Mixed 10-frame model",
|
|
842
|
+
deprecated: true
|
|
821
843
|
},
|
|
822
844
|
"mixed-30": {
|
|
823
845
|
type: "mixed-30",
|
|
824
846
|
minFrames: 30,
|
|
825
847
|
recommendedFrames: 30,
|
|
826
|
-
description: "Mixed 30-frame model"
|
|
848
|
+
description: "Mixed 30-frame model",
|
|
849
|
+
deprecated: true
|
|
827
850
|
},
|
|
828
851
|
"mixed-60": {
|
|
829
852
|
type: "mixed-60",
|
|
830
853
|
minFrames: 60,
|
|
831
854
|
recommendedFrames: 60,
|
|
832
|
-
description: "Mixed 60-frame model"
|
|
855
|
+
description: "Mixed 60-frame model",
|
|
856
|
+
deprecated: true
|
|
833
857
|
},
|
|
834
858
|
"mixed-90": {
|
|
835
859
|
type: "mixed-90",
|
|
836
860
|
minFrames: 90,
|
|
837
861
|
recommendedFrames: 90,
|
|
838
|
-
description: "Mixed 90-frame model"
|
|
862
|
+
description: "Mixed 90-frame model",
|
|
863
|
+
deprecated: true
|
|
839
864
|
},
|
|
840
865
|
"mixed-120": {
|
|
841
866
|
type: "mixed-120",
|
|
842
867
|
minFrames: 120,
|
|
843
868
|
recommendedFrames: 120,
|
|
844
|
-
description: "Mixed 120-frame model"
|
|
869
|
+
description: "Mixed 120-frame model",
|
|
870
|
+
deprecated: true
|
|
845
871
|
},
|
|
846
872
|
"mixed-150": {
|
|
847
873
|
type: "mixed-150",
|
|
848
874
|
minFrames: 150,
|
|
849
875
|
recommendedFrames: 150,
|
|
850
|
-
description: "Mixed 150-frame model"
|
|
876
|
+
description: "Mixed 150-frame model",
|
|
877
|
+
deprecated: true
|
|
851
878
|
},
|
|
852
879
|
"mixed-250": {
|
|
853
880
|
type: "mixed-250",
|
|
854
881
|
minFrames: 250,
|
|
855
882
|
recommendedFrames: 250,
|
|
856
|
-
description: "Mixed 250-frame model"
|
|
883
|
+
description: "Mixed 250-frame model",
|
|
884
|
+
deprecated: true
|
|
885
|
+
},
|
|
886
|
+
// Mixed V2 models (exp_042 checkpoints — EER: 4.0% / AUC: 0.991 at 30f)
|
|
887
|
+
"mixed-10-v2": {
|
|
888
|
+
type: "mixed-10-v2",
|
|
889
|
+
minFrames: 10,
|
|
890
|
+
recommendedFrames: 10,
|
|
891
|
+
description: "Mixed V2 10-frame model",
|
|
892
|
+
deprecated: false
|
|
893
|
+
},
|
|
894
|
+
"mixed-30-v2": {
|
|
895
|
+
type: "mixed-30-v2",
|
|
896
|
+
minFrames: 30,
|
|
897
|
+
recommendedFrames: 30,
|
|
898
|
+
description: "Mixed V2 30-frame model (recommended \u2014 95.7% balanced accuracy)",
|
|
899
|
+
deprecated: false
|
|
900
|
+
},
|
|
901
|
+
"mixed-60-v2": {
|
|
902
|
+
type: "mixed-60-v2",
|
|
903
|
+
minFrames: 60,
|
|
904
|
+
recommendedFrames: 60,
|
|
905
|
+
description: "Mixed V2 60-frame model",
|
|
906
|
+
deprecated: false
|
|
907
|
+
},
|
|
908
|
+
"mixed-90-v2": {
|
|
909
|
+
type: "mixed-90-v2",
|
|
910
|
+
minFrames: 90,
|
|
911
|
+
recommendedFrames: 90,
|
|
912
|
+
description: "Mixed V2 90-frame model",
|
|
913
|
+
deprecated: false
|
|
914
|
+
},
|
|
915
|
+
"mixed-120-v2": {
|
|
916
|
+
type: "mixed-120-v2",
|
|
917
|
+
minFrames: 120,
|
|
918
|
+
recommendedFrames: 120,
|
|
919
|
+
description: "Mixed V2 120-frame model",
|
|
920
|
+
deprecated: false
|
|
857
921
|
}
|
|
858
922
|
};
|
|
859
923
|
var HYBRID_MODEL_CONFIGS = {
|
|
@@ -873,10 +937,16 @@ var HYBRID_MODEL_CONFIGS = {
|
|
|
873
937
|
}
|
|
874
938
|
};
|
|
875
939
|
function getMinFramesForModel(model) {
|
|
876
|
-
return MODEL_CONFIGS[model]
|
|
940
|
+
return MODEL_CONFIGS[model]?.minFrames ?? 10;
|
|
877
941
|
}
|
|
878
942
|
function hasEnoughFrames(model, frameCount) {
|
|
879
|
-
return frameCount >=
|
|
943
|
+
return frameCount >= getMinFramesForModel(model);
|
|
944
|
+
}
|
|
945
|
+
function isDeprecatedModel(model) {
|
|
946
|
+
return MODEL_CONFIGS[model]?.deprecated ?? false;
|
|
947
|
+
}
|
|
948
|
+
function getActiveModels() {
|
|
949
|
+
return Object.values(MODEL_CONFIGS).filter((c) => !c.deprecated);
|
|
880
950
|
}
|
|
881
951
|
|
|
882
952
|
// src/types/detectors.ts
|
|
@@ -1189,7 +1259,7 @@ function validateTimestamp(timestamp) {
|
|
|
1189
1259
|
}
|
|
1190
1260
|
function validateFrameCount(model, frameCount) {
|
|
1191
1261
|
const config = MODEL_CONFIGS[model];
|
|
1192
|
-
const required = config
|
|
1262
|
+
const required = config?.minFrames ?? 10;
|
|
1193
1263
|
return {
|
|
1194
1264
|
valid: frameCount >= required,
|
|
1195
1265
|
required,
|
|
@@ -1781,6 +1851,7 @@ export {
|
|
|
1781
1851
|
detectSpecularHighlights,
|
|
1782
1852
|
encodeBase64,
|
|
1783
1853
|
generateSessionId,
|
|
1854
|
+
getActiveModels,
|
|
1784
1855
|
getApiErrorMessage,
|
|
1785
1856
|
getCaptureQualityFeedback,
|
|
1786
1857
|
getEyeRegionBounds,
|
|
@@ -1789,6 +1860,7 @@ export {
|
|
|
1789
1860
|
getOvalGuideState,
|
|
1790
1861
|
getStatusMessage,
|
|
1791
1862
|
hasEnoughFrames,
|
|
1863
|
+
isDeprecatedModel,
|
|
1792
1864
|
isFaceCropFullyInFrame,
|
|
1793
1865
|
isFaceFullyVisible,
|
|
1794
1866
|
isFaceInOval,
|