facecog-liveness-showcase 0.0.1
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/.browserslistrc +15 -0
- package/.dockerignore +48 -0
- package/.editorconfig +16 -0
- package/.eslintrc.json +47 -0
- package/.vercelignore +7 -0
- package/.vscode/extensions.json +5 -0
- package/.vscode/settings.json +3 -0
- package/DOCKER.md +221 -0
- package/Dockerfile +33 -0
- package/README.md +268 -0
- package/angular.json +156 -0
- package/capacitor.config.ts +9 -0
- package/docker-compose.dev.yml +20 -0
- package/docker-compose.yml +18 -0
- package/ionic.config.json +7 -0
- package/jest.config.js +38 -0
- package/nginx.conf +50 -0
- package/package.json +131 -0
- package/patches/ng-packagr+20.3.2.patch +60 -0
- package/projects/facecog-liveness-verification/README.md +295 -0
- package/projects/facecog-liveness-verification/ng-package.json +7 -0
- package/projects/facecog-liveness-verification/package.json +48 -0
- package/projects/facecog-liveness-verification/scripts/build-with-wrapper-copy.js +38 -0
- package/projects/facecog-liveness-verification/scripts/copy-wrapper-after-ngc.js +35 -0
- package/projects/facecog-liveness-verification/sources/FaceLivenessReactWrapper.tsx +320 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.d.ts +28 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.js +247 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.js.map +1 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.js.map +1 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/aws-face-liveness.component.ts +500 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.html +41 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.scss +234 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.spec.ts +158 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.ts +58 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-verification/camera-verification.component.html +34 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-verification/camera-verification.component.ts +210 -0
- package/projects/facecog-liveness-verification/src/lib/components/dialogs/save-custom-pose-dialog.component.ts +174 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.html +45 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.scss +87 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.ts +182 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.html +394 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.scss +1567 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.spec.ts +699 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.ts +721 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.html +120 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.scss +611 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.spec.ts +605 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.ts +524 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.html +73 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.scss +19 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.spec.ts +673 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.ts +963 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.html +38 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.scss +10 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.ts +233 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.html +17 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.spec.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.ts +33 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.html +17 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.scss +156 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.spec.ts +46 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.html +190 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.scss +534 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.spec.ts +286 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.ts +155 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/analyze-response.interface.ts +16 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/aws-face-liveness.interface.ts +46 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-adapter.interface.ts +21 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-http-client.interface.ts +93 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-response.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/camera-provider.interface.ts +107 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/category-info.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-data.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-repository.interface.ts +48 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-response.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/index.ts +52 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-action-result.interface.ts +13 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-config.interface.ts +17 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-metadata.interface.ts +17 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-result.interface.ts +24 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-verification-config.interface.ts +41 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/multi-backend-analyze-response.interface.ts +21 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/multi-backend-liveness-result.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-definition.interface.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-keypoint.interface.ts +12 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-match-result.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-verify-response.interface.ts +8 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/scan-results.interface.ts +29 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-plan.interface.ts +42 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-progress-event.interface.ts +12 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-session.interface.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-step-change-event.interface.ts +11 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/video-recording.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/liveness-verification.module.ts +123 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/aws-face-liveness-component.token.ts +23 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/category-info.constant.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/default-liveness-config.constant.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/liveness-verification-config.token.ts +16 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/pose-definitions.constant.ts +377 -0
- package/projects/facecog-liveness-verification/src/lib/models/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/index.ts +2 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/pose.utils.spec.ts +76 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/pose.utils.ts +59 -0
- package/projects/facecog-liveness-verification/src/lib/services/aws-face-liveness.service.ts +49 -0
- package/projects/facecog-liveness-verification/src/lib/services/backend-http.service.spec.ts +111 -0
- package/projects/facecog-liveness-verification/src/lib/services/backend-http.service.ts +130 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/azure-backend.service.spec.ts +69 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/azure-backend.service.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/facetec-backend.service.spec.ts +24 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/facetec-backend.service.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/mock-backend.service.spec.ts +36 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/mock-backend.service.ts +39 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/openpose-backend.service.spec.ts +81 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/openpose-backend.service.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/rekognition-analysis-backend.service.spec.ts +69 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/rekognition-analysis-backend.service.ts +83 -0
- package/projects/facecog-liveness-verification/src/lib/services/camera.service.spec.ts +200 -0
- package/projects/facecog-liveness-verification/src/lib/services/camera.service.ts +155 -0
- package/projects/facecog-liveness-verification/src/lib/services/custom-poses-api.service.ts +117 -0
- package/projects/facecog-liveness-verification/src/lib/services/index.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-backend.service.spec.ts +103 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-backend.service.ts +61 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-config.service.spec.ts +109 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-config.service.ts +70 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-orchestrator.service.spec.ts +144 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-orchestrator.service.ts +162 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/hand-gesture-detection.service.ts +315 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/openpose.service.ts +287 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/pose-comparison.service.ts +353 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/pose-matching.service.ts +2370 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/reference-pose.service.ts +271 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-selection.service.spec.ts +183 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-selection.service.ts +179 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-api.service.spec.ts +159 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-api.service.ts +151 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-plan.service.spec.ts +184 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-plan.service.ts +94 -0
- package/projects/facecog-liveness-verification/src/lib/services/video-recorder.service.spec.ts +52 -0
- package/projects/facecog-liveness-verification/src/lib/services/video-recorder.service.ts +117 -0
- package/projects/facecog-liveness-verification/src/lib/types/detection-strategy.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/index.ts +7 -0
- package/projects/facecog-liveness-verification/src/lib/types/liveness-action.type.ts +31 -0
- package/projects/facecog-liveness-verification/src/lib/types/liveness-backend.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/pose-category.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/pose-difficulty.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/verification-flow-step.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/verification-step-kind.type.ts +4 -0
- package/projects/facecog-liveness-verification/src/public-api.ts +150 -0
- package/projects/facecog-liveness-verification/tsconfig.lib.json +20 -0
- package/projects/facecog-liveness-verification/tsconfig.lib.prod.json +11 -0
- package/projects/facecog-liveness-verification/tsconfig.spec.json +13 -0
- package/projects/facecog-liveness-verification/tsconfig.wrapper.json +15 -0
- package/projects/facecog-liveness-verification-test/src/app/app-routing.module.ts +22 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.html +3 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.scss +0 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.ts +11 -0
- package/projects/facecog-liveness-verification-test/src/app/app.module.ts +27 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home-routing.module.ts +16 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.module.ts +19 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.html +39 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.scss +97 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.spec.ts +24 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.ts +92 -0
- package/projects/facecog-liveness-verification-test/src/app/home/verification-modal.component.ts +106 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Bold_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Medium_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Regular_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-SemiBold_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Thin_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/icon/favicon.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Five_Fingers_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Left_Palm.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Ok_Sign_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Peace_Sign_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/README.md +77 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Right_Palm.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Speak_Phrase.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Three_Fingers_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Thumbs_Up_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Thumbs_Up_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Wave_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/blink.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/blink_twice.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/center_face.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/clap.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cover_mouth.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cover_right_eye.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cross_arms.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/face_straight.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/follow_dot.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/look_down.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/look_up.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/move_closer.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/nod.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/open_mouth.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/raise_eyebrow.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/rotate_face.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/shake_head.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/smile.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/tilt_left.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/tilt_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_chin_left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_left_cheek.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_nose_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_right_cheek.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/turn_left.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/turn_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/wink.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/reference-pose.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/shapes.svg +1 -0
- package/projects/facecog-liveness-verification-test/src/environments/environment.prod.ts +4 -0
- package/projects/facecog-liveness-verification-test/src/environments/environment.ts +17 -0
- package/projects/facecog-liveness-verification-test/src/global.scss +288 -0
- package/projects/facecog-liveness-verification-test/src/index.html +31 -0
- package/projects/facecog-liveness-verification-test/src/main.ts +6 -0
- package/projects/facecog-liveness-verification-test/src/polyfills.ts +55 -0
- package/projects/facecog-liveness-verification-test/src/theme/nextsapien-theme.scss +174 -0
- package/projects/facecog-liveness-verification-test/src/theme/variables.scss +2 -0
- package/projects/facecog-liveness-verification-test/src/zone-flags.ts +6 -0
- package/projects/facecog-liveness-verification-test/tsconfig.app.json +15 -0
- package/projects/facecog-liveness-verification-test/tsconfig.spec.json +14 -0
- package/setup-jest.ts +118 -0
- package/tsconfig.json +41 -0
- package/tsconfig.spec.json +15 -0
- package/vercel.json +24 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { ModalController } from '@ionic/angular';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { FormsModule } from '@angular/forms';
|
|
5
|
+
import { IonicModule } from '@ionic/angular';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'lib-save-custom-pose-dialog',
|
|
9
|
+
standalone: true,
|
|
10
|
+
imports: [CommonModule, FormsModule, IonicModule],
|
|
11
|
+
template: `
|
|
12
|
+
<ion-header>
|
|
13
|
+
<ion-toolbar color="primary">
|
|
14
|
+
<ion-title>Save Custom Pose</ion-title>
|
|
15
|
+
<ion-buttons slot="end">
|
|
16
|
+
<ion-button (click)="dismiss()">
|
|
17
|
+
<ion-icon name="close"></ion-icon>
|
|
18
|
+
</ion-button>
|
|
19
|
+
</ion-buttons>
|
|
20
|
+
</ion-toolbar>
|
|
21
|
+
</ion-header>
|
|
22
|
+
|
|
23
|
+
<ion-content>
|
|
24
|
+
<div class="ion-padding">
|
|
25
|
+
<div class="preview-section">
|
|
26
|
+
<img [src]="imageData" alt="Pose preview" class="preview-image">
|
|
27
|
+
<p class="preview-hint">This is how your pose will appear</p>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<ion-item>
|
|
31
|
+
<ion-label position="stacked">Pose Name *</ion-label>
|
|
32
|
+
<ion-input
|
|
33
|
+
[(ngModel)]="poseName"
|
|
34
|
+
placeholder="e.g., My Peace Sign"
|
|
35
|
+
maxlength="50"
|
|
36
|
+
required
|
|
37
|
+
(ionInput)="validateForm()">
|
|
38
|
+
</ion-input>
|
|
39
|
+
</ion-item>
|
|
40
|
+
<div *ngIf="poseName && poseName.length < 3" class="error-text">
|
|
41
|
+
<ion-text color="danger">
|
|
42
|
+
<small>Pose name must be at least 3 characters</small>
|
|
43
|
+
</ion-text>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<ion-item>
|
|
47
|
+
<ion-label position="stacked">Description</ion-label>
|
|
48
|
+
<ion-textarea
|
|
49
|
+
[(ngModel)]="description"
|
|
50
|
+
[placeholder]="suggestedDescription || 'Instructions for performing this pose'"
|
|
51
|
+
rows="3">
|
|
52
|
+
</ion-textarea>
|
|
53
|
+
</ion-item>
|
|
54
|
+
|
|
55
|
+
<ion-item>
|
|
56
|
+
<ion-label>Category *</ion-label>
|
|
57
|
+
<ion-select [(ngModel)]="category" interface="popover">
|
|
58
|
+
<ion-select-option value="face">Face Expression</ion-select-option>
|
|
59
|
+
<ion-select-option value="head">Head Movement</ion-select-option>
|
|
60
|
+
<ion-select-option value="hand">Hand Gesture</ion-select-option>
|
|
61
|
+
<ion-select-option value="gesture">Body Gesture</ion-select-option>
|
|
62
|
+
<ion-select-option value="combined">Combined</ion-select-option>
|
|
63
|
+
</ion-select>
|
|
64
|
+
</ion-item>
|
|
65
|
+
|
|
66
|
+
<ion-item>
|
|
67
|
+
<ion-label>Difficulty *</ion-label>
|
|
68
|
+
<ion-select [(ngModel)]="difficulty" interface="popover">
|
|
69
|
+
<ion-select-option value="easy">Easy</ion-select-option>
|
|
70
|
+
<ion-select-option value="medium">Medium</ion-select-option>
|
|
71
|
+
<ion-select-option value="hard">Hard</ion-select-option>
|
|
72
|
+
</ion-select>
|
|
73
|
+
</ion-item>
|
|
74
|
+
|
|
75
|
+
<div class="button-container ion-margin-top">
|
|
76
|
+
<ion-button
|
|
77
|
+
expand="block"
|
|
78
|
+
(click)="save()"
|
|
79
|
+
[disabled]="!isValid()">
|
|
80
|
+
<ion-icon name="bookmark" slot="start"></ion-icon>
|
|
81
|
+
Save Pose
|
|
82
|
+
</ion-button>
|
|
83
|
+
|
|
84
|
+
<ion-button
|
|
85
|
+
expand="block"
|
|
86
|
+
fill="clear"
|
|
87
|
+
(click)="dismiss()">
|
|
88
|
+
Cancel
|
|
89
|
+
</ion-button>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</ion-content>
|
|
93
|
+
`,
|
|
94
|
+
styles: [`
|
|
95
|
+
.preview-section {
|
|
96
|
+
text-align: center;
|
|
97
|
+
margin-bottom: 24px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.preview-image {
|
|
101
|
+
max-width: 300px;
|
|
102
|
+
max-height: 300px;
|
|
103
|
+
width: 100%;
|
|
104
|
+
height: auto;
|
|
105
|
+
border-radius: 8px;
|
|
106
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
107
|
+
margin-bottom: 8px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.preview-hint {
|
|
111
|
+
font-size: 0.875rem;
|
|
112
|
+
color: var(--ion-color-medium);
|
|
113
|
+
margin: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.button-container {
|
|
117
|
+
margin-top: 24px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.error-text {
|
|
121
|
+
padding: 4px 16px;
|
|
122
|
+
margin-top: -8px;
|
|
123
|
+
margin-bottom: 8px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
ion-item {
|
|
127
|
+
--padding-start: 0;
|
|
128
|
+
--inner-padding-end: 0;
|
|
129
|
+
margin-bottom: 16px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
ion-label[position="stacked"] {
|
|
133
|
+
margin-bottom: 8px;
|
|
134
|
+
font-weight: 500;
|
|
135
|
+
}
|
|
136
|
+
`]
|
|
137
|
+
})
|
|
138
|
+
export class SaveCustomPoseDialogComponent {
|
|
139
|
+
@Input() imageData!: string;
|
|
140
|
+
@Input() suggestedDescription?: string;
|
|
141
|
+
|
|
142
|
+
poseName: string = '';
|
|
143
|
+
description: string = '';
|
|
144
|
+
category: string = 'hand';
|
|
145
|
+
difficulty: string = 'medium';
|
|
146
|
+
formValid: boolean = false;
|
|
147
|
+
|
|
148
|
+
constructor(private modalCtrl: ModalController) {}
|
|
149
|
+
|
|
150
|
+
validateForm(): void {
|
|
151
|
+
this.formValid = this.isValid();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
isValid(): boolean {
|
|
155
|
+
return this.poseName.trim().length >= 3;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
save(): void {
|
|
159
|
+
if (!this.isValid()) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
this.modalCtrl.dismiss({
|
|
164
|
+
name: this.poseName.trim(),
|
|
165
|
+
description: this.description.trim() || this.suggestedDescription || this.poseName.trim(),
|
|
166
|
+
category: this.category,
|
|
167
|
+
difficulty: this.difficulty
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
dismiss(): void {
|
|
172
|
+
this.modalCtrl.dismiss();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<div class="facetec-scan-container">
|
|
2
|
+
<div class="camera-container">
|
|
3
|
+
<video #videoElement autoplay playsinline class="camera-video"></video>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
<div class="message-container">
|
|
7
|
+
<ion-card class="message-card">
|
|
8
|
+
<ion-card-content>
|
|
9
|
+
<div class="message-content">
|
|
10
|
+
<h2 *ngIf="countdown > 0 && isScanning" class="countdown-text">
|
|
11
|
+
{{ countdown }}
|
|
12
|
+
</h2>
|
|
13
|
+
<p class="message-text">{{ message }}</p>
|
|
14
|
+
<ion-progress-bar
|
|
15
|
+
*ngIf="isScanning && progress > 0"
|
|
16
|
+
[value]="progress / 100"
|
|
17
|
+
color="primary">
|
|
18
|
+
</ion-progress-bar>
|
|
19
|
+
</div>
|
|
20
|
+
</ion-card-content>
|
|
21
|
+
</ion-card>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="action-buttons">
|
|
25
|
+
<ion-button
|
|
26
|
+
*ngIf="!isScanning && !autoStart"
|
|
27
|
+
expand="block"
|
|
28
|
+
color="primary"
|
|
29
|
+
size="large"
|
|
30
|
+
(click)="startScan()">
|
|
31
|
+
<ion-icon name="scan" slot="start"></ion-icon>
|
|
32
|
+
Start FaceTec Scan
|
|
33
|
+
</ion-button>
|
|
34
|
+
|
|
35
|
+
<ion-button
|
|
36
|
+
*ngIf="isScanning"
|
|
37
|
+
expand="block"
|
|
38
|
+
color="danger"
|
|
39
|
+
size="large"
|
|
40
|
+
(click)="cancel()">
|
|
41
|
+
<ion-icon name="close" slot="start"></ion-icon>
|
|
42
|
+
Cancel
|
|
43
|
+
</ion-button>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
.facetec-scan-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
height: 100%;
|
|
5
|
+
background: #000;
|
|
6
|
+
position: relative;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.camera-container {
|
|
10
|
+
position: relative;
|
|
11
|
+
flex: 1;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.camera-video {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
object-fit: cover;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.message-container {
|
|
25
|
+
position: absolute;
|
|
26
|
+
bottom: 120px;
|
|
27
|
+
left: 0;
|
|
28
|
+
right: 0;
|
|
29
|
+
padding: 0 20px;
|
|
30
|
+
z-index: 10;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.message-card {
|
|
34
|
+
background: rgba(0, 0, 0, 0.8);
|
|
35
|
+
backdrop-filter: blur(10px);
|
|
36
|
+
border-radius: 12px;
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.message-content {
|
|
41
|
+
text-align: center;
|
|
42
|
+
padding: 10px 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.countdown-text {
|
|
46
|
+
font-size: 48px;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
color: #00D4FF;
|
|
49
|
+
margin: 0 0 10px 0;
|
|
50
|
+
animation: countdown-pulse 1s ease-in-out;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@keyframes countdown-pulse {
|
|
54
|
+
0% {
|
|
55
|
+
transform: scale(1);
|
|
56
|
+
opacity: 0;
|
|
57
|
+
}
|
|
58
|
+
50% {
|
|
59
|
+
transform: scale(1.2);
|
|
60
|
+
opacity: 1;
|
|
61
|
+
}
|
|
62
|
+
100% {
|
|
63
|
+
transform: scale(1);
|
|
64
|
+
opacity: 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.message-text {
|
|
69
|
+
font-size: 16px;
|
|
70
|
+
color: #fff;
|
|
71
|
+
margin: 0;
|
|
72
|
+
font-weight: 500;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.action-buttons {
|
|
76
|
+
position: absolute;
|
|
77
|
+
bottom: 20px;
|
|
78
|
+
left: 20px;
|
|
79
|
+
right: 20px;
|
|
80
|
+
z-index: 10;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
ion-progress-bar {
|
|
84
|
+
margin-top: 10px;
|
|
85
|
+
--background: rgba(255, 255, 255, 0.2);
|
|
86
|
+
--progress-background: #00D4FF;
|
|
87
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
EventEmitter,
|
|
4
|
+
Input,
|
|
5
|
+
Output,
|
|
6
|
+
ViewChild,
|
|
7
|
+
ElementRef,
|
|
8
|
+
OnDestroy,
|
|
9
|
+
AfterViewInit,
|
|
10
|
+
OnInit
|
|
11
|
+
} from '@angular/core';
|
|
12
|
+
import { CommonModule } from '@angular/common';
|
|
13
|
+
import { IonicModule } from '@ionic/angular';
|
|
14
|
+
import { CameraService } from '../../services/camera.service';
|
|
15
|
+
import type { FaceTecScanResult } from '../../interfaces/scan-results.interface';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* FaceTecScanComponent
|
|
19
|
+
*
|
|
20
|
+
* Simulates FaceTec 3D liveness scanning.
|
|
21
|
+
* In production, this would integrate with the actual FaceTec Browser SDK.
|
|
22
|
+
*
|
|
23
|
+
* For now, this component:
|
|
24
|
+
* 1. Uses the device camera
|
|
25
|
+
* 2. Captures a frame after countdown
|
|
26
|
+
* 3. Sends it as "FaceScan" data to backend
|
|
27
|
+
*/
|
|
28
|
+
@Component({
|
|
29
|
+
selector: 'facecog-facetec-scan',
|
|
30
|
+
templateUrl: './facetec-scan.component.html',
|
|
31
|
+
styleUrls: ['./facetec-scan.component.scss'],
|
|
32
|
+
standalone: true,
|
|
33
|
+
imports: [CommonModule, IonicModule]
|
|
34
|
+
})
|
|
35
|
+
export class FaceTecScanComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
36
|
+
@ViewChild('videoElement', { static: false }) videoElement!: ElementRef<HTMLVideoElement>;
|
|
37
|
+
|
|
38
|
+
@Input() sessionId: string = '';
|
|
39
|
+
@Input() deviceKey: string = '';
|
|
40
|
+
@Input() autoStart: boolean = false;
|
|
41
|
+
|
|
42
|
+
@Output() scanComplete = new EventEmitter<FaceTecScanResult>();
|
|
43
|
+
@Output() scanCancelled = new EventEmitter<void>();
|
|
44
|
+
|
|
45
|
+
isScanning = false;
|
|
46
|
+
countdown = 3;
|
|
47
|
+
message = 'Position your face in the frame';
|
|
48
|
+
progress = 0;
|
|
49
|
+
|
|
50
|
+
private countdownInterval: ReturnType<typeof setInterval> | null = null;
|
|
51
|
+
private progressInterval: ReturnType<typeof setInterval> | null = null;
|
|
52
|
+
|
|
53
|
+
constructor(private cameraService: CameraService) {}
|
|
54
|
+
|
|
55
|
+
ngOnInit(): void {
|
|
56
|
+
console.log('[FaceTec Scan] Component initialized', { autoStart: this.autoStart });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
ngAfterViewInit(): void {
|
|
60
|
+
if (this.autoStart) {
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
console.log('[FaceTec Scan] Auto-starting scan...');
|
|
63
|
+
this.startScan();
|
|
64
|
+
}, 500);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
ngOnDestroy(): void {
|
|
69
|
+
this.cleanup();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async startScan(): Promise<void> {
|
|
73
|
+
try {
|
|
74
|
+
console.log('[FaceTec Scan] Starting scan...');
|
|
75
|
+
this.message = 'Initializing camera...';
|
|
76
|
+
|
|
77
|
+
const stream = await this.cameraService.startCamera(this.videoElement.nativeElement);
|
|
78
|
+
if (!stream) {
|
|
79
|
+
throw new Error('Failed to start camera');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
this.message = 'Position your face in the oval';
|
|
83
|
+
await this.delay(1000);
|
|
84
|
+
|
|
85
|
+
this.startCountdown();
|
|
86
|
+
} catch (error: unknown) {
|
|
87
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
88
|
+
console.error('[FaceTec Scan] Error starting scan:', err);
|
|
89
|
+
this.scanComplete.emit({
|
|
90
|
+
success: false,
|
|
91
|
+
faceScan: '',
|
|
92
|
+
error: err.message || 'Failed to start scan'
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
private startCountdown(): void {
|
|
98
|
+
this.isScanning = true;
|
|
99
|
+
this.countdown = 3;
|
|
100
|
+
this.message = `Get ready! ${this.countdown}`;
|
|
101
|
+
|
|
102
|
+
this.countdownInterval = setInterval(() => {
|
|
103
|
+
this.countdown--;
|
|
104
|
+
|
|
105
|
+
if (this.countdown > 0) {
|
|
106
|
+
this.message = `${this.countdown}`;
|
|
107
|
+
} else {
|
|
108
|
+
if (this.countdownInterval) {
|
|
109
|
+
clearInterval(this.countdownInterval);
|
|
110
|
+
this.countdownInterval = null;
|
|
111
|
+
}
|
|
112
|
+
this.performScan();
|
|
113
|
+
}
|
|
114
|
+
}, 1000);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
private async performScan(): Promise<void> {
|
|
118
|
+
try {
|
|
119
|
+
this.message = 'Scanning...';
|
|
120
|
+
this.progress = 0;
|
|
121
|
+
|
|
122
|
+
this.progressInterval = setInterval(() => {
|
|
123
|
+
this.progress += 10;
|
|
124
|
+
if (this.progress >= 100 && this.progressInterval) {
|
|
125
|
+
clearInterval(this.progressInterval);
|
|
126
|
+
this.progressInterval = null;
|
|
127
|
+
}
|
|
128
|
+
}, 100);
|
|
129
|
+
|
|
130
|
+
await this.delay(1000);
|
|
131
|
+
|
|
132
|
+
const faceScan = this.cameraService.captureFrame(this.videoElement.nativeElement);
|
|
133
|
+
const auditTrailImage = faceScan;
|
|
134
|
+
|
|
135
|
+
console.log('[FaceTec Scan] Scan completed, faceScan length:', faceScan.length);
|
|
136
|
+
|
|
137
|
+
this.message = 'Scan complete!';
|
|
138
|
+
await this.delay(500);
|
|
139
|
+
|
|
140
|
+
this.cameraService.stopCamera();
|
|
141
|
+
|
|
142
|
+
this.scanComplete.emit({
|
|
143
|
+
success: true,
|
|
144
|
+
faceScan,
|
|
145
|
+
auditTrailImage,
|
|
146
|
+
lowQualityAuditTrailImage: auditTrailImage
|
|
147
|
+
});
|
|
148
|
+
} catch (error: unknown) {
|
|
149
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
150
|
+
console.error('[FaceTec Scan] Error performing scan:', err);
|
|
151
|
+
this.scanComplete.emit({
|
|
152
|
+
success: false,
|
|
153
|
+
faceScan: '',
|
|
154
|
+
error: err.message || 'Scan failed'
|
|
155
|
+
});
|
|
156
|
+
} finally {
|
|
157
|
+
this.isScanning = false;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
cancel(): void {
|
|
162
|
+
console.log('[FaceTec Scan] Scan cancelled');
|
|
163
|
+
this.cleanup();
|
|
164
|
+
this.scanCancelled.emit();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
private cleanup(): void {
|
|
168
|
+
if (this.countdownInterval) {
|
|
169
|
+
clearInterval(this.countdownInterval);
|
|
170
|
+
this.countdownInterval = null;
|
|
171
|
+
}
|
|
172
|
+
if (this.progressInterval) {
|
|
173
|
+
clearInterval(this.progressInterval);
|
|
174
|
+
this.progressInterval = null;
|
|
175
|
+
}
|
|
176
|
+
this.cameraService.stopCamera();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
private delay(ms: number): Promise<void> {
|
|
180
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
181
|
+
}
|
|
182
|
+
}
|