@masumdev/rn-camera-ai-tflite 0.0.0-stage → 0.2.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.
Files changed (121) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +405 -2
  3. package/lib/commonjs/detector/TFLiteCatAnalyzer.js +609 -0
  4. package/lib/commonjs/detector/TFLiteCatAnalyzer.js.map +1 -0
  5. package/lib/commonjs/detector/TFLiteFaceRecognizer.js +690 -0
  6. package/lib/commonjs/detector/TFLiteFaceRecognizer.js.map +1 -0
  7. package/lib/commonjs/detector/TFLiteObjectDetector.js +392 -0
  8. package/lib/commonjs/detector/TFLiteObjectDetector.js.map +1 -0
  9. package/lib/commonjs/detector/index.js +50 -0
  10. package/lib/commonjs/detector/index.js.map +1 -0
  11. package/lib/commonjs/detector/modelLoader.js +139 -0
  12. package/lib/commonjs/detector/modelLoader.js.map +1 -0
  13. package/lib/commonjs/detector/workletFrameHelper.js +233 -0
  14. package/lib/commonjs/detector/workletFrameHelper.js.map +1 -0
  15. package/lib/commonjs/index.js +39 -0
  16. package/lib/commonjs/index.js.map +1 -0
  17. package/lib/commonjs/package.json +1 -0
  18. package/lib/commonjs/parser/blazeFaceParser.js +771 -0
  19. package/lib/commonjs/parser/blazeFaceParser.js.map +1 -0
  20. package/lib/commonjs/parser/catParser.js +752 -0
  21. package/lib/commonjs/parser/catParser.js.map +1 -0
  22. package/lib/commonjs/parser/index.js +39 -0
  23. package/lib/commonjs/parser/index.js.map +1 -0
  24. package/lib/commonjs/parser/outputParser.js +196 -0
  25. package/lib/commonjs/parser/outputParser.js.map +1 -0
  26. package/lib/commonjs/types/cat.js +6 -0
  27. package/lib/commonjs/types/cat.js.map +1 -0
  28. package/lib/commonjs/types/index.js +28 -0
  29. package/lib/commonjs/types/index.js.map +1 -0
  30. package/lib/commonjs/types/resize-plugin.d.ts +20 -0
  31. package/lib/commonjs/types/tflite.js +6 -0
  32. package/lib/commonjs/types/tflite.js.map +1 -0
  33. package/lib/module/detector/TFLiteCatAnalyzer.js +605 -0
  34. package/lib/module/detector/TFLiteCatAnalyzer.js.map +1 -0
  35. package/lib/module/detector/TFLiteFaceRecognizer.js +684 -0
  36. package/lib/module/detector/TFLiteFaceRecognizer.js.map +1 -0
  37. package/lib/module/detector/TFLiteObjectDetector.js +386 -0
  38. package/lib/module/detector/TFLiteObjectDetector.js.map +1 -0
  39. package/lib/module/detector/index.js +7 -0
  40. package/lib/module/detector/index.js.map +1 -0
  41. package/lib/module/detector/modelLoader.js +133 -0
  42. package/lib/module/detector/modelLoader.js.map +1 -0
  43. package/lib/module/detector/workletFrameHelper.js +226 -0
  44. package/lib/module/detector/workletFrameHelper.js.map +1 -0
  45. package/lib/module/index.js +6 -0
  46. package/lib/module/index.js.map +1 -0
  47. package/lib/module/package.json +1 -0
  48. package/lib/module/parser/blazeFaceParser.js +756 -0
  49. package/lib/module/parser/blazeFaceParser.js.map +1 -0
  50. package/lib/module/parser/catParser.js +739 -0
  51. package/lib/module/parser/catParser.js.map +1 -0
  52. package/lib/module/parser/index.js +6 -0
  53. package/lib/module/parser/index.js.map +1 -0
  54. package/lib/module/parser/outputParser.js +192 -0
  55. package/lib/module/parser/outputParser.js.map +1 -0
  56. package/lib/module/types/cat.js +4 -0
  57. package/lib/module/types/cat.js.map +1 -0
  58. package/lib/module/types/index.js +5 -0
  59. package/lib/module/types/index.js.map +1 -0
  60. package/lib/module/types/resize-plugin.d.ts +20 -0
  61. package/lib/module/types/tflite.js +4 -0
  62. package/lib/module/types/tflite.js.map +1 -0
  63. package/lib/typescript/commonjs/detector/TFLiteCatAnalyzer.d.ts +6 -0
  64. package/lib/typescript/commonjs/detector/TFLiteCatAnalyzer.d.ts.map +1 -0
  65. package/lib/typescript/commonjs/detector/TFLiteFaceRecognizer.d.ts +59 -0
  66. package/lib/typescript/commonjs/detector/TFLiteFaceRecognizer.d.ts.map +1 -0
  67. package/lib/typescript/commonjs/detector/TFLiteObjectDetector.d.ts +41 -0
  68. package/lib/typescript/commonjs/detector/TFLiteObjectDetector.d.ts.map +1 -0
  69. package/lib/typescript/commonjs/detector/index.d.ts +5 -0
  70. package/lib/typescript/commonjs/detector/index.d.ts.map +1 -0
  71. package/lib/typescript/commonjs/detector/modelLoader.d.ts +23 -0
  72. package/lib/typescript/commonjs/detector/modelLoader.d.ts.map +1 -0
  73. package/lib/typescript/commonjs/detector/workletFrameHelper.d.ts +40 -0
  74. package/lib/typescript/commonjs/detector/workletFrameHelper.d.ts.map +1 -0
  75. package/lib/typescript/commonjs/index.d.ts +4 -0
  76. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  77. package/lib/typescript/commonjs/package.json +1 -0
  78. package/lib/typescript/commonjs/parser/blazeFaceParser.d.ts +68 -0
  79. package/lib/typescript/commonjs/parser/blazeFaceParser.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/parser/catParser.d.ts +61 -0
  81. package/lib/typescript/commonjs/parser/catParser.d.ts.map +1 -0
  82. package/lib/typescript/commonjs/parser/index.d.ts +4 -0
  83. package/lib/typescript/commonjs/parser/index.d.ts.map +1 -0
  84. package/lib/typescript/commonjs/parser/outputParser.d.ts +17 -0
  85. package/lib/typescript/commonjs/parser/outputParser.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/types/cat.d.ts +109 -0
  87. package/lib/typescript/commonjs/types/cat.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/types/index.d.ts +3 -0
  89. package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/types/tflite.d.ts +233 -0
  91. package/lib/typescript/commonjs/types/tflite.d.ts.map +1 -0
  92. package/lib/typescript/module/detector/TFLiteCatAnalyzer.d.ts +6 -0
  93. package/lib/typescript/module/detector/TFLiteCatAnalyzer.d.ts.map +1 -0
  94. package/lib/typescript/module/detector/TFLiteFaceRecognizer.d.ts +59 -0
  95. package/lib/typescript/module/detector/TFLiteFaceRecognizer.d.ts.map +1 -0
  96. package/lib/typescript/module/detector/TFLiteObjectDetector.d.ts +41 -0
  97. package/lib/typescript/module/detector/TFLiteObjectDetector.d.ts.map +1 -0
  98. package/lib/typescript/module/detector/index.d.ts +5 -0
  99. package/lib/typescript/module/detector/index.d.ts.map +1 -0
  100. package/lib/typescript/module/detector/modelLoader.d.ts +23 -0
  101. package/lib/typescript/module/detector/modelLoader.d.ts.map +1 -0
  102. package/lib/typescript/module/detector/workletFrameHelper.d.ts +40 -0
  103. package/lib/typescript/module/detector/workletFrameHelper.d.ts.map +1 -0
  104. package/lib/typescript/module/index.d.ts +4 -0
  105. package/lib/typescript/module/index.d.ts.map +1 -0
  106. package/lib/typescript/module/package.json +1 -0
  107. package/lib/typescript/module/parser/blazeFaceParser.d.ts +68 -0
  108. package/lib/typescript/module/parser/blazeFaceParser.d.ts.map +1 -0
  109. package/lib/typescript/module/parser/catParser.d.ts +61 -0
  110. package/lib/typescript/module/parser/catParser.d.ts.map +1 -0
  111. package/lib/typescript/module/parser/index.d.ts +4 -0
  112. package/lib/typescript/module/parser/index.d.ts.map +1 -0
  113. package/lib/typescript/module/parser/outputParser.d.ts +17 -0
  114. package/lib/typescript/module/parser/outputParser.d.ts.map +1 -0
  115. package/lib/typescript/module/types/cat.d.ts +109 -0
  116. package/lib/typescript/module/types/cat.d.ts.map +1 -0
  117. package/lib/typescript/module/types/index.d.ts +3 -0
  118. package/lib/typescript/module/types/index.d.ts.map +1 -0
  119. package/lib/typescript/module/types/tflite.d.ts +233 -0
  120. package/lib/typescript/module/types/tflite.d.ts.map +1 -0
  121. package/package.json +116 -4
@@ -0,0 +1,68 @@
1
+ import type { BoundingBox, DetectionResult, FaceLandmark, FaceLivenessMetrics } from '@masumdev/rn-camera-ai';
2
+ import type { BlazeFaceAnchor, BlazeFaceDecodeOptions } from '../types/tflite';
3
+ /**
4
+ * Generates the standard 896 SSD anchors for MediaPipe BlazeFace Short-Range (128x128):
5
+ * - Layer 0: 16x16 grid (stride 8), 2 anchors per cell = 512 anchors
6
+ * - Layer 1: 8x8 grid (stride 16), 6 anchors per cell = 384 anchors
7
+ * Total = 896 anchors.
8
+ */
9
+ export declare function generateBlazeFaceAnchors(): BlazeFaceAnchor[];
10
+ /**
11
+ * Generates the standard 2,304 SSD anchors for MediaPipe BlazeFace Full-Range (192x192):
12
+ * - Single layer: 48x48 grid (stride 4), 1 anchor per cell = 2,304 anchors.
13
+ */
14
+ export declare function generateBlazeFaceFullRangeAnchors(): BlazeFaceAnchor[];
15
+ /**
16
+ * Applies Greedy IoU Non-Maximum Suppression (NMS) to candidate face detections.
17
+ */
18
+ export declare function nonMaxSuppression(candidates: DetectionResult[], iouThreshold?: number, maxResults?: number): DetectionResult[];
19
+ /**
20
+ * Decodes MediaPipe BlazeFace Short-Range output tensors:
21
+ * - Output 0 (regressors): [1, 896, 16] -> (dx, dy, w, h, kp0_x, kp0_y, ..., kp5_x, kp5_y)
22
+ * - Output 1 (classificators): [1, 896, 1] -> raw logit score
23
+ */
24
+ export declare function decodeBlazeFaceOutputs(rawOutputs: unknown[], anchors: BlazeFaceAnchor[], options?: BlazeFaceDecodeOptions): DetectionResult[];
25
+ /**
26
+ * L2-normalizes a feature embedding vector so its Euclidean norm equals 1.0.
27
+ */
28
+ export declare function l2NormalizeEmbedding(vector: ArrayLike<number>): number[];
29
+ /**
30
+ * Computes the Cosine Similarity in [0, 1] between two face embedding vectors.
31
+ */
32
+ export declare function cosineSimilarity(a: ArrayLike<number>, b: ArrayLike<number>): number;
33
+ /**
34
+ * Crops a detected face bounding box from an RGB uint8 image buffer and resizes it
35
+ * to a normalized [-1, 1] Float32Array buffer (e.g. [1, 112, 112, 3] for MobileFaceNet).
36
+ */
37
+ export declare function cropAndResizeFaceToFloat32Buffer(rgbBuffer: ArrayBuffer, imgWidth: number, imgHeight: number, box: BoundingBox, targetWidth?: number, targetHeight?: number): ArrayBuffer;
38
+ /**
39
+ * Expands a normalized face bounding box by a padding factor around its center,
40
+ * clamped to [0, 1], for feeding into the 468-point MediaPipe Face Mesh model.
41
+ */
42
+ export declare function expandFaceRoiBox(box: BoundingBox, scaleFactor?: number): BoundingBox;
43
+ /**
44
+ * Crops a face ROI from an RGB uint8 buffer and resizes it to a [0.0, 1.0] Float32Array
45
+ * buffer ([1, 192, 192, 3]) expected by MediaPipe face_landmark.tflite.
46
+ */
47
+ export declare function cropAndResizeFaceToNormalized01Float32Buffer(rgbBuffer: ArrayBuffer, imgWidth: number, imgHeight: number, roiBox: BoundingBox, targetWidth?: number, targetHeight?: number): ArrayBuffer;
48
+ /**
49
+ * Decodes the 1,404-float output tensor ([1, 1, 1, 1404] = 468 x (x, y, z)) from MediaPipe
50
+ * face_landmark.tflite into 468 normalized full-frame FaceLandmark points and computes
51
+ * the exact anatomical face bounding box from the 468-point mesh envelope.
52
+ */
53
+ export declare function decodeFaceMeshOutputs(rawMeshOutputs: unknown[], roiBox: BoundingBox, meshInputSize?: number): {
54
+ landmarks: FaceLandmark[];
55
+ tightBox: BoundingBox;
56
+ } | null;
57
+ /**
58
+ * Extracts a 128-D L2-normalized illumination-invariant face signature combining
59
+ * aligned facial ROI grid luminance/chrominance cells and Procrustes-normalized landmark geometry.
60
+ */
61
+ export declare function extractFaceDescriptorFromRgbAndLandmarks(rgbBuffer: ArrayBuffer, imgWidth: number, imgHeight: number, box: BoundingBox, landmarks?: FaceLandmark[]): number[];
62
+ /**
63
+ * Computes hybrid Active (Eye Blink EAR, Mouth/Smile MAR, 3D Head Pose Yaw/Pitch/Roll)
64
+ * and Passive (3D Z-Depth Relief + RGB Surface Texture / Anti-Moiré / Glare + Optional Neural Score)
65
+ * face liveness telemetry on the background camera worklet thread.
66
+ */
67
+ export declare function computeFaceLivenessMetrics(rgbBuffer: ArrayBuffer | null, imgWidth: number, imgHeight: number, box: BoundingBox, landmarks?: FaceLandmark[], livenessThreshold?: number, externalAntiSpoofScore?: number): FaceLivenessMetrics;
68
+ //# sourceMappingURL=blazeFaceParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blazeFa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,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,EACnB,WAAW,SAAM,EACjB,YAAY,SAAM,GACjB,WAAW,CAgCb;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,OAAO,EAAE,EACzB,MAAM,EAAE,WAAW,EACnB,aAAa,SAAM,GAClB;IAAE,SAAS,EAAE,YAAY,EAAE,CAAC;IAAC,QAAQ,EAAE,WAAW,CAAA;CAAE,GAAG,IAAI,CAqE7D;AAED;;;GAGG;AACH,wBAAgB,wCAAwC,CACtD,SAAS,EAAE,WAAW,EACtB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,WAAW,EAChB,SAAS,CAAC,EAAE,YAAY,EAAE,GACzB,MAAM,EAAE,CAsEV;AASD;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,WAAW,GAAG,IAAI,EAC7B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,WAAW,EAChB,SAAS,CAAC,EAAE,YAAY,EAAE,EAC1B,iBAAiB,SAAO,EACxB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,mBAAmB,CAqOrB"}
@@ -0,0 +1,61 @@
1
+ import type { BoundingBox, CatBreedCandidate, CatBreedSource, CatCoatSwatch, CatFACSMetrics, CatSegmentationSummary, FaceLandmark } from '@masumdev/rn-camera-ai';
2
+ export interface CatLetterboxMeta {
3
+ roiBox: BoundingBox;
4
+ normWidth: number;
5
+ normHeight: number;
6
+ padNormX: number;
7
+ padNormY: number;
8
+ }
9
+ /**
10
+ * Crops an RGB uint8 image buffer to a normalized ROI and scales into a uint8 [0, 255] tensor buffer.
11
+ */
12
+ export declare function cropRgbToUint8Buffer(rgbBuffer: ArrayBuffer, imgWidth: number, imgHeight: number, roiBox: BoundingBox, targetWidth: number, targetHeight: number): ArrayBuffer;
13
+ /**
14
+ * Letterboxes an RGB uint8 image region preserving aspect ratio into a square Float32 [0.0, 1.0]
15
+ * tensor expected by `cat_face_localizer.tflite` (224x224).
16
+ */
17
+ export declare function letterboxRgbToFloat01Buffer(rgbBuffer: ArrayBuffer, imgWidth: number, imgHeight: number, targetSize?: number, roiBox?: BoundingBox): {
18
+ buffer: ArrayBuffer;
19
+ meta: CatLetterboxMeta;
20
+ };
21
+ /**
22
+ * Un-letterboxes [xmin, ymin, xmax, ymax] output from `cat_face_localizer.tflite` back into full-frame [0, 1] box.
23
+ */
24
+ export declare function deletterboxNormalizedBox(rawOutputs: unknown[], meta: CatLetterboxMeta): BoundingBox | null;
25
+ /**
26
+ * Decodes top-K cat breed candidates from either Float32 or Quantized Uint8 softmax/logit output tensors.
27
+ */
28
+ export declare function decodeBreedProbabilities(rawOutputs: unknown[], labels: readonly string[], source: CatBreedSource, isQuantizedUint8?: boolean, topK?: number): CatBreedCandidate[];
29
+ /**
30
+ * Merges and temporally smooths predictions across 67-breed and 12-pedigree breed engines.
31
+ */
32
+ export declare function fuseBreedPredictions(breed67: CatBreedCandidate[], breed12: CatBreedCandidate[], emaMap: Record<string, number>, alpha?: number, topK?: number): CatBreedCandidate[];
33
+ /**
34
+ * Decodes [1, 96] normalized landmark outputs from `cat_face_landmarks_full.tflite` into 48 full-frame landmarks.
35
+ */
36
+ export declare function decodeCatFaceLandmarks(rawOutputs: unknown[], cropBox: BoundingBox): FaceLandmark[] | null;
37
+ /**
38
+ * Computes CatFACS facial muscle & posture metrics (slow-blink eyes, airplane ears, meow/mouth opening)
39
+ * and synthesizes feline affective mood directly from 48 CatFLW landmarks.
40
+ */
41
+ export declare function computeCatFACSMetrics(landmarks48: FaceLandmark[]): CatFACSMetrics;
42
+ /**
43
+ * Downsamples MediaPipe DeepLab-V3 [1, 257, 257, 21] semantic segmentation output into a compact
44
+ * feline pixel mask (class 8 = cat) with tight bounding box and area coverage ratio.
45
+ */
46
+ export declare function decodeDeepLabCatMask(rawOutputs: unknown[], catClassIndex?: number, gridSize?: number, tensorSize?: number, numClasses?: number): CatSegmentationSummary | null;
47
+ /**
48
+ * Extracts dominant coat colors, pattern estimate, and shot sharpness optimality from an RGB cat region,
49
+ * ignoring background pixels when DeepLab cat segmentation mask cells are available.
50
+ */
51
+ export declare function analyzeCatCoatAndColors(rgbBuffer: ArrayBuffer, imgWidth: number, imgHeight: number, roiBox: BoundingBox, segMask?: CatSegmentationSummary): {
52
+ swatches: CatCoatSwatch[];
53
+ coatPattern: string;
54
+ shotOptimalityScore: number;
55
+ };
56
+ /**
57
+ * Extracts a compact 96-D L2-normalized feline appearance & landmark geometry embedding
58
+ * for 1-tap personal Cat ID matching via cosine similarity.
59
+ */
60
+ export declare function extractCatIdentityDescriptor(rgbBuffer: ArrayBuffer, imgWidth: number, imgHeight: number, catBox: BoundingBox, landmarks48?: FaceLandmark[] | null): number[];
61
+ //# sourceMappingURL=catParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catParser.d.ts","sourceRoot":"","sources":["../../../../src/parser/catParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EAEd,sBAAsB,EACtB,YAAY,EACb,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAsED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,WAAW,EACtB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,WAAW,CAkCb;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,WAAW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,OAAO,CAAC,EAAE,sBAAsB,GAC/B;IACD,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CA2JA;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,WAAW,EACtB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,EACnB,WAAW,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,GAClC,MAAM,EAAE,CA2DV"}
@@ -0,0 +1,4 @@
1
+ export * from './outputParser';
2
+ export * from './blazeFaceParser';
3
+ export * from './catParser';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/parser/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { DetectionResult } from '@masumdev/rn-camera-ai';
2
+ import type { ParseOptions, TFLiteOutputs } from '../types/tflite';
3
+ /**
4
+ * Parses raw TFLite tensors from SSD or EfficientDet models into structured DetectionResult objects.
5
+ *
6
+ * Tensor Layout (standard TFLite SSD output):
7
+ * 0: Detection Boxes [1, N, 4] formatted as [ymin, xmin, ymax, xmax] normalized to [0, 1]
8
+ * 1: Detection Classes [1, N] class indices
9
+ * 2: Detection Scores [1, N] confidence scores in [0, 1]
10
+ * 3: Detection Count [1] scalar total valid detections
11
+ *
12
+ * @param outputs The 4 TFLite output tensors (ArrayBuffers, flat Float32Arrays, nested number arrays, or count number)
13
+ * @param options Configuration for threshold, maximum results, and label resolution
14
+ * @returns Array of validated DetectionResult objects sorted by confidence descending
15
+ */
16
+ export declare function parseDetectionOutputs(outputs: TFLiteOutputs, options?: ParseOptions): DetectionResult[];
17
+ //# sourceMappingURL=outputParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputParser.d.ts","sourceRoot":"","sources":["../../../../src/parser/outputParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAyDnE;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,CAAC,EAAE,YAAY,GACrB,eAAe,EAAE,CA6LnB"}
@@ -0,0 +1,109 @@
1
+ import type { CameraProcessor } from '@masumdev/rn-camera-ai';
2
+ import type { TFLiteModelSource, TensorflowModel } from './tflite';
3
+ /**
4
+ * Pipeline operating mode controlling which cat vision neural networks execute.
5
+ */
6
+ export type CatAnalysisMode = 'all' | 'breed' | 'face_mood' | 'segmentation' | 'identity';
7
+ /**
8
+ * Active breed classification model engine selector.
9
+ */
10
+ export type CatBreedEngine = '67' | '12' | 'ensemble';
11
+ /**
12
+ * Enrolled personal cat identity profile stored for cosine similarity matching.
13
+ */
14
+ export interface EnrolledCatProfile {
15
+ /** Unique profile identifier */
16
+ id: string;
17
+ /** Custom cat nickname (e.g. 'Oyen', 'Mochi') */
18
+ name: string;
19
+ /** Optional detected or user-provided breed hint */
20
+ breedHint?: string;
21
+ /** L2-normalized 96-D feline descriptor embedding */
22
+ embedding: number[];
23
+ /** Creation timestamp (epoch ms) */
24
+ createdAt: number;
25
+ }
26
+ /**
27
+ * Configuration options for creating a Multi-Model TFLite Cat Vision Analyzer.
28
+ */
29
+ export interface TFLiteCatAnalyzerConfig {
30
+ /** Stage 1 COCO SSD object detector model (detect.tflite 300x300) */
31
+ detectorModel: TFLiteModelSource;
32
+ /** COCO labels array or index map */
33
+ detectorLabels?: string[] | Record<number, string>;
34
+ /** Index offset applied before COCO label lookup (default: 1) */
35
+ detectorLabelOffset?: number;
36
+ /** Detector input tensor width (default: 300) */
37
+ detectorInputWidth?: number;
38
+ /** Detector input tensor height (default: 300) */
39
+ detectorInputHeight?: number;
40
+ /** Extended 67-class Cat Breed & Coat Classifier model (224x224 float32 [0,1]) */
41
+ breed67Model?: TFLiteModelSource;
42
+ /** Label array for 67-class cat breed model */
43
+ breed67Labels?: readonly string[];
44
+ /** High-precision 12-class Oxford-IIIT Pet Cat Breed Classifier (224x224 uint8) */
45
+ breed12Model?: TFLiteModelSource;
46
+ /** Label array for 12-class breed model */
47
+ breed12Labels?: readonly string[];
48
+ /** Stage 2a Cat Face Localizer model (224x224 float32 [0,1] letterboxed) */
49
+ catFaceLocalizerModel?: TFLiteModelSource;
50
+ /** Stage 2b 48-point CatFLW Facial Landmarks model (384x384 float32 [0,1]) */
51
+ catFaceLandmarksModel?: TFLiteModelSource;
52
+ /** MediaPipe DeepLab-V3 21-class Semantic Segmenter (257x257 float32 [-1,1]) */
53
+ segmentationModel?: TFLiteModelSource;
54
+ /** Class index corresponding to 'cat' in segmentation outputs (default: 8) */
55
+ segmentationCatClassIndex?: number;
56
+ /** Initial active Cat AI pipeline mode (default: 'all') */
57
+ initialMode?: CatAnalysisMode;
58
+ /** Initial cat breed engine selection (default: 'ensemble') */
59
+ initialBreedEngine?: CatBreedEngine;
60
+ /** Minimum COCO SSD detection score threshold [0, 1] (default: 0.42) */
61
+ confidenceThreshold?: number;
62
+ /** Minimum cosine similarity threshold for Cat ID recognition [0, 1] (default: 0.72) */
63
+ similarityThreshold?: number;
64
+ /** Fall back to center close-up ROI when SSD misses an extreme close-up cat (default: true) */
65
+ closeUpFallback?: boolean;
66
+ /** Target FPS processing cap (default: 15) */
67
+ targetFps?: number;
68
+ /** Whether to prefer hardware GPU delegates before CPU fallback (default: true) */
69
+ useGpu?: boolean;
70
+ /** Optional initial list of enrolled cats */
71
+ initialCats?: EnrolledCatProfile[];
72
+ /** Delegate fallback callback */
73
+ onDelegateFallback?: (requested: string, fallback: string) => void;
74
+ /** Optional custom model loader function */
75
+ loadModel?: (source: TFLiteModelSource, delegates: string[]) => Promise<TensorflowModel>;
76
+ /** Platform override ('android' | 'ios') */
77
+ platform?: 'android' | 'ios' | string;
78
+ }
79
+ /**
80
+ * Pluggable multi-model feline vision CameraProcessor contract.
81
+ */
82
+ export interface TFLiteCatAnalyzer extends CameraProcessor {
83
+ readonly activeDelegate: 'gpu' | 'cpu';
84
+ readonly analysisMode: CatAnalysisMode;
85
+ readonly breedEngine: CatBreedEngine;
86
+ readonly confidenceThreshold: number;
87
+ readonly similarityThreshold: number;
88
+ readonly closeUpFallback: boolean;
89
+ readonly loadedModels: {
90
+ readonly detector: boolean;
91
+ readonly breed67: boolean;
92
+ readonly breed12: boolean;
93
+ readonly catFaceLocalizer: boolean;
94
+ readonly catFaceLandmarks: boolean;
95
+ readonly segmentation: boolean;
96
+ };
97
+ setAnalysisMode(mode: CatAnalysisMode): void;
98
+ setBreedEngine(engine: CatBreedEngine): void;
99
+ setConfidenceThreshold(threshold: number): void;
100
+ setSimilarityThreshold(threshold: number): void;
101
+ setCloseUpFallback(enabled: boolean): void;
102
+ enrollLastDetectedCat(name: string, breedHint?: string): EnrolledCatProfile | null;
103
+ enrollCat(name: string, embedding: Float32Array | number[], breedHint?: string): EnrolledCatProfile;
104
+ removeEnrolledCat(id: string): boolean;
105
+ clearEnrolledCats(): void;
106
+ getEnrolledCats(): EnrolledCatProfile[];
107
+ hasRecentCatEmbedding(): boolean;
108
+ }
109
+ //# sourceMappingURL=cat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat.d.ts","sourceRoot":"","sources":["../../../../src/types/cat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,KAAK,GACL,OAAO,GACP,WAAW,GACX,cAAc,GACd,UAAU,CAAC;AAEf;;GAEG;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gB,EAAE,OAAO,CAAC;QACnC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;KAChC,CAAC;IACF,eAAe,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IAC7C,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC7C,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3C,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAAC;IACnF,SAAS,CACP,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,YAAY,GAAG,MAAM,EAAE,EAClC,SAAS,CAAC,EAAE,MAAM,GACjB,kBAAkB,CAAC;IACtB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IACvC,iBAAiB,IAAI,IAAI,CAAC;IAC1B,eAAe,IAAI,kBAAkB,EAAE,CAAC;IACxC,qBAAqB,IAAI,OAAO,CAAC;CAClC"}
@@ -0,0 +1,3 @@
1
+ export * from './tflite';
2
+ export * from './cat';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC"}
@@ -0,0 +1,233 @@
1
+ import type { CameraProcessor, FaceLandmark } from '@masumdev/rn-camera-ai';
2
+ /**
3
+ * Universal source specification for TensorFlow Lite models.
4
+ * - number: Local asset bundle required via require('./model.tflite')
5
+ * - { url: string }: Remote HTTPS URL or local file:/// URI
6
+ * - string: Direct local filesystem path
7
+ */
8
+ export type TFLiteModelSource = number | {
9
+ url: string;
10
+ } | string;
11
+ /**
12
+ * Minimal interface representing an active TensorFlow Lite interpreter instance.
13
+ */
14
+ export interface TensorflowModel {
15
+ runSync(inputs: (ArrayBuffer | ArrayBufferView)[]): (ArrayBuffer | Float32Array | number[])[];
16
+ run?(inputs: (ArrayBuffer | ArrayBufferView)[]): Promise<(ArrayBuffer | Float32Array | number[])[]>;
17
+ readonly delegates?: readonly string[];
18
+ }
19
+ /**
20
+ * Options controlling model loading and hardware delegate resolution.
21
+ */
22
+ export interface ModelLoaderOptions {
23
+ /** Whether to request GPU delegate acceleration (default: true) */
24
+ useGpu?: boolean;
25
+ /** Explicit operating system platform ('android' or 'ios') */
26
+ platform?: 'android' | 'ios' | string;
27
+ /** Callback triggered when requested hardware delegate falls back to CPU */
28
+ onDelegateFallback?: (requested: string, fallback: string) => void;
29
+ /** Optional custom model loader function for dependency injection or testing */
30
+ loadModel?: (source: TFLiteModelSource, delegates: string[]) => Promise<TensorflowModel>;
31
+ }
32
+ /**
33
+ * Result returned upon successful model loading and delegate negotiation.
34
+ */
35
+ export interface LoadedModelResult {
36
+ /** Initialized model instance */
37
+ model: TensorflowModel;
38
+ /** Active hardware delegate negotiated */
39
+ activeDelegate: 'gpu' | 'cpu';
40
+ /** Validated model source */
41
+ source: TFLiteModelSource;
42
+ }
43
+ /**
44
+ * Configuration options for initializing a TFLiteObjectDetector instance.
45
+ */
46
+ export interface TFLiteObjectDetectorConfig {
47
+ /** Target TensorFlow Lite model source */
48
+ model: TFLiteModelSource;
49
+ /** Human-readable class labels as array or index-to-name dictionary */
50
+ labels?: string[] | Record<number, string>;
51
+ /** Optional offset applied to raw class index (e.g. -1 if index 0 is background) */
52
+ labelOffset?: number;
53
+ /** Minimum confidence threshold in range [0, 1] (default: 0.50) */
54
+ confidenceThreshold?: number;
55
+ /** Maximum number of top detections to return (default: 10) */
56
+ maxResults?: number;
57
+ /** Whether to attempt GPU acceleration (default: true) */
58
+ useGpu?: boolean;
59
+ /** Frame rate limit in frames per second (default: 15) */
60
+ targetFps?: number;
61
+ /** Target model input tensor width in pixels (default: 300) */
62
+ inputWidth?: number;
63
+ /** Target model input tensor height in pixels (default: 300) */
64
+ inputHeight?: number;
65
+ /** Callback triggered when GPU delegate fails and falls back to CPU */
66
+ onDelegateFallback?: (requested: string, fallback: string) => void;
67
+ /** Optional custom model loader function for testing or custom runtime */
68
+ loadModel?: (source: TFLiteModelSource, delegates: string[]) => Promise<TensorflowModel>;
69
+ /** Explicit platform target */
70
+ platform?: 'android' | 'ios' | string;
71
+ /** Optional custom resize plugin instance */
72
+ resizePlugin?: {
73
+ resize(frame: unknown, options: unknown): {
74
+ buffer?: ArrayBuffer;
75
+ toArrayBuffer?: () => ArrayBuffer;
76
+ };
77
+ };
78
+ }
79
+ /**
80
+ * Pluggable camera processor contract for TensorFlow Lite object detection.
81
+ */
82
+ export interface TFLiteObjectDetector extends CameraProcessor {
83
+ /** Active hardware delegate utilized for inference */
84
+ readonly activeDelegate: 'gpu' | 'cpu';
85
+ /** Current confidence threshold */
86
+ readonly confidenceThreshold?: number;
87
+ /** Current maximum results limit */
88
+ readonly maxResults?: number;
89
+ /** Dynamically updates the detection confidence threshold */
90
+ setConfidenceThreshold(threshold: number): void;
91
+ /** Dynamically updates the maximum results limit */
92
+ setMaxResults(maxResults: number): void;
93
+ }
94
+ /**
95
+ * Options controlling standard 4-tensor output decoding.
96
+ */
97
+ export interface ParseOptions {
98
+ /** Minimum detection confidence score (default: 0.50) */
99
+ confidenceThreshold?: number;
100
+ /** Maximum number of detections to retain (default: 10) */
101
+ maxResults?: number;
102
+ /** Class label array or dictionary mapping */
103
+ labels?: string[] | Record<number, string>;
104
+ /** Index offset applied before label lookup (default: 0) */
105
+ labelOffset?: number;
106
+ }
107
+ /**
108
+ * Alias for ParseOptions for backwards and contract compatibility.
109
+ */
110
+ export type ParseDetectionOptions = ParseOptions;
111
+ /**
112
+ * Accepted representation for the 4 standard TFLite output tensors.
113
+ */
114
+ export type TFLiteOutputs = [
115
+ ArrayBuffer | Float32Array | number[],
116
+ ArrayBuffer | Float32Array | number[],
117
+ ArrayBuffer | Float32Array | number[],
118
+ ArrayBuffer | Float32Array | number[] | number
119
+ ] | (ArrayBuffer | Float32Array | number[] | number | unknown[])[];
120
+ /**
121
+ * 2D SSD anchor center coordinate in normalized [0..1] space for BlazeFace decoding.
122
+ */
123
+ export interface BlazeFaceAnchor {
124
+ /** Normalized horizontal center [0, 1] */
125
+ x: number;
126
+ /** Normalized vertical center [0, 1] */
127
+ y: number;
128
+ }
129
+ /**
130
+ * Options for decoding MediaPipe BlazeFace raw output tensors.
131
+ */
132
+ export interface BlazeFaceDecodeOptions {
133
+ /** Minimum face detection confidence score in [0, 1] (default: 0.5) */
134
+ confidenceThreshold?: number;
135
+ /** Non-Maximum Suppression IoU threshold in [0, 1] (default: 0.3) */
136
+ iouThreshold?: number;
137
+ /** Maximum number of faces to return (default: 5) */
138
+ maxResults?: number;
139
+ /** Model input width in pixels (default: 128) */
140
+ inputWidth?: number;
141
+ /** Model input height in pixels (default: 128) */
142
+ inputHeight?: number;
143
+ /** Camera source frame height / width aspect ratio for portrait de-squishing (e.g. 1280/720) */
144
+ frameAspectRatio?: number;
145
+ }
146
+ /**
147
+ * Enrolled face identity profile stored for real-time face recognition.
148
+ */
149
+ export interface EnrolledFaceProfile {
150
+ /** Unique profile identifier */
151
+ id: string;
152
+ /** Display name of the enrolled person */
153
+ name: string;
154
+ /** L2-normalized embedding vector */
155
+ embedding: number[];
156
+ /** Creation timestamp (epoch ms) */
157
+ createdAt: number;
158
+ }
159
+ /**
160
+ * Configuration options for initializing a TFLiteFaceRecognizer processor.
161
+ */
162
+ export interface TFLiteFaceRecognizerConfig {
163
+ /** MediaPipe BlazeFace detector model source (192x192 or 128x128) */
164
+ model: TFLiteModelSource;
165
+ /** Optional secondary TFLite face embedding model source (e.g. MobileFaceNet 112x112) */
166
+ embeddingModel?: TFLiteModelSource;
167
+ /** Optional MediaPipe 468-point 3D Face Mesh TFLite model source (face_landmark.tflite 192x192) */
168
+ faceMeshModel?: TFLiteModelSource;
169
+ /** Optional dedicated passive anti-spoofing TFLite model source (e.g. MiniFASNet 80x80 / 128x128) */
170
+ antiSpoofModel?: TFLiteModelSource;
171
+ /** Whether to compute hybrid active + passive liveness metrics per face (default: true) */
172
+ enableLiveness?: boolean;
173
+ /** Minimum passive liveness confidence threshold in [0, 1] to classify a face as live (default: 0.62) */
174
+ livenessThreshold?: number;
175
+ /** Minimum face detection confidence threshold in [0, 1] (default: 0.55) */
176
+ confidenceThreshold?: number;
177
+ /** Minimum cosine similarity threshold in [0, 1] to recognize an enrolled identity (default: 0.65) */
178
+ similarityThreshold?: number;
179
+ /** Non-Maximum Suppression IoU overlap threshold in [0, 1] (default: 0.3) */
180
+ iouThreshold?: number;
181
+ /** Maximum faces to detect per frame (default: 5) */
182
+ maxResults?: number;
183
+ /** Target frame rate in FPS (default: 24) */
184
+ targetFps?: number;
185
+ /** Detector model input width (default: 128) */
186
+ inputWidth?: number;
187
+ /** Detector model input height (default: 128) */
188
+ inputHeight?: number;
189
+ /** Whether to request GPU acceleration (default: true) */
190
+ useGpu?: boolean;
191
+ /** Initial list of enrolled face profiles */
192
+ initialFaces?: EnrolledFaceProfile[];
193
+ /** Callback triggered when hardware delegate falls back to CPU */
194
+ onDelegateFallback?: (requested: string, fallback: string) => void;
195
+ /** Optional custom model loader function for testing or custom runtime */
196
+ loadModel?: (source: TFLiteModelSource, delegates: string[]) => Promise<TensorflowModel>;
197
+ /** Explicit operating system platform target */
198
+ platform?: 'android' | 'ios' | string;
199
+ }
200
+ /**
201
+ * Pluggable camera processor for real-time Face Detection, 6 Facial Landmarks, and Identity Recognition.
202
+ */
203
+ export interface TFLiteFaceRecognizer extends CameraProcessor {
204
+ /** Active hardware delegate utilized for inference */
205
+ readonly activeDelegate: 'gpu' | 'cpu';
206
+ /** Current face detection confidence threshold */
207
+ readonly confidenceThreshold: number;
208
+ /** Current cosine similarity threshold for identity matching */
209
+ readonly similarityThreshold: number;
210
+ /** Current passive liveness threshold */
211
+ readonly livenessThreshold: number;
212
+ /** Dynamically updates face detection confidence threshold */
213
+ setConfidenceThreshold(threshold: number): void;
214
+ /** Dynamically updates cosine similarity threshold for identity matching */
215
+ setSimilarityThreshold(threshold: number): void;
216
+ /** Dynamically updates passive liveness verification threshold */
217
+ setLivenessThreshold(threshold: number): void;
218
+ /** Enrolls a face profile from the most recently detected face in the camera stream */
219
+ enrollLastDetectedFace(name: string): EnrolledFaceProfile | null;
220
+ /** Enrolls a face profile with an explicit embedding vector */
221
+ enrollFace(name: string, embedding: Float32Array | number[]): EnrolledFaceProfile;
222
+ /** Removes an enrolled face profile by ID */
223
+ removeEnrolledFace(id: string): boolean;
224
+ /** Clears all enrolled face profiles */
225
+ clearEnrolledFaces(): void;
226
+ /** Returns all currently enrolled face profiles */
227
+ getEnrolledFaces(): EnrolledFaceProfile[];
228
+ /** Returns whether a valid face embedding was captured from a recent camera frame */
229
+ hasRecentFaceEmbedding(): boolean;
230
+ /** Returns the most recently detected facial landmarks if available */
231
+ getLastDetectedLandmarks?(): FaceLandmark[] | null;
232
+ }
233
+ //# sourceMappingURL=tflite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tflite.d.ts","sourceRoot":"","sources":["../../../../src/types/tflite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,wBAAwB,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,MAAM,EAAE,CAAC,WAAW,GAAG,eAAe,CAAC,EAAE,GAAG,CAAC,WAAW,GAAG,YAAY,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC;IAC9F,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,GAAG,eAAe,CAAC,EAAE,GAAG,OAAO,C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EAAE,MAAM,CAAC;IACrC,gEAAgE;IAChE,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,yCAAyC;IACzC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,8DAA8D;IAC9D,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,4EAA4E;IAC5E,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,kEAAkE;IAClE,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,uFAAuF;IACvF,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAAC;IACjE,+DAA+D;IAC/D,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,MAAM,EAAE,GAAG,mBAAmB,CAAC;IAClF,6CAA6C;IAC7C,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IACxC,wCAAwC;IACxC,kBAAkB,IAAI,IAAI,CAAC;IAC3B,mDAAmD;IACnD,gBAAgB,IAAI,mBAAmB,EAAE,CAAC;IAC1C,qFAAqF;IACrF,sBAAsB,IAAI,OAAO,CAAC;IAClC,uEAAuE;IACvE,wBAAwB,CAAC,IAAI,YAAY,EAAE,GAAG,IAAI,CAAC;CACpD"}
@@ -0,0 +1,6 @@
1
+ import type { TFLiteCatAnalyzer, TFLiteCatAnalyzerConfig } from '../types/cat.js';
2
+ /**
3
+ * Creates and initializes a Multi-Model On-Device Feline Vision CameraProcessor.
4
+ */
5
+ export declare function createTFLiteCatAnalyzer(config: TFLiteCatAnalyzerConfig): Promise<TFLiteCatAnalyzer>;
6
+ //# sourceMappingURL=TFLiteCatAnalyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TFLiteCatAnalyzer.d.ts","sourceRoot":"","sources":["../../../../src/detector/TFLiteCatAnalyzer.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAIV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,iBAAc,CAAC;AAu2BtB;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CAG5B"}
@@ -0,0 +1,59 @@
1
+ import { type DetectionResult, type FaceLandmark, type ModelStatus, type WorkletBoolSync } from '@masumdev/rn-camera-ai';
2
+ import type { EnrolledFaceProfile, TFLiteFaceRecognizer, TFLiteFaceRecognizerConfig, TensorflowModel } from '../types/tflite.js';
3
+ /**
4
+ * Concrete implementation of the TFLite Face Detection & Recognition CameraProcessor.
5
+ */
6
+ export declare class TFLiteFaceRecognizerImpl implements TFLiteFaceRecognizer {
7
+ readonly id: string;
8
+ readonly name = "TFLiteFaceRecognizer";
9
+ readonly processFrameWorklet: (frame: unknown) => DetectionResult[];
10
+ readonly wasThrottledSync: WorkletBoolSync;
11
+ private _status;
12
+ private _activeDelegate;
13
+ private _confidenceThreshold;
14
+ private _similarityThreshold;
15
+ private _livenessThreshold;
16
+ private _iouThreshold;
17
+ private _maxResults;
18
+ private _config;
19
+ private _disposedSync;
20
+ private _readySync;
21
+ private _modelSync;
22
+ private _embeddingModelSync;
23
+ private _faceMeshModelSync;
24
+ private _antiSpoofModelSync;
25
+ private _confidenceSync;
26
+ private _similaritySync;
27
+ private _livenessThresholdSync;
28
+ private _iouSync;
29
+ private _maxResultsSync;
30
+ private _lastFrameTimeSync;
31
+ private _enrolledFacesSync;
32
+ private _lastEmbeddingSync;
33
+ private _lastLandmarksSync;
34
+ constructor(config: TFLiteFaceRecognizerConfig, model: TensorflowModel, activeDelegate: 'gpu' | 'cpu', embeddingModel?: TensorflowModel | null, faceMeshModel?: TensorflowModel | null, antiSpoofModel?: TensorflowModel | null);
35
+ get status(): ModelStatus;
36
+ get activeDelegate(): 'gpu' | 'cpu';
37
+ get confidenceThreshold(): number;
38
+ get similarityThreshold(): number;
39
+ get livenessThreshold(): number;
40
+ get targetFps(): number | undefined;
41
+ setConfidenceThreshold(threshold: number): void;
42
+ setSimilarityThreshold(threshold: number): void;
43
+ setLivenessThreshold(threshold: number): void;
44
+ hasRecentFaceEmbedding(): boolean;
45
+ getLastDetectedLandmarks(): FaceLandmark[] | null;
46
+ enrollFace(name: string, embedding: Float32Array | number[]): EnrolledFaceProfile;
47
+ enrollLastDetectedFace(name: string): EnrolledFaceProfile | null;
48
+ removeEnrolledFace(id: string): boolean;
49
+ clearEnrolledFaces(): void;
50
+ getEnrolledFaces(): EnrolledFaceProfile[];
51
+ processFrame(frame: unknown): DetectionResult[];
52
+ initialize(): Promise<void>;
53
+ dispose(): void;
54
+ }
55
+ /**
56
+ * Creates and initializes a MediaPipe BlazeFace + Identity Recognition processor.
57
+ */
58
+ export declare function createTFLiteFaceRecognizer(config: TFLiteFaceRecognizerConfig): Promise<TFLiteFaceRecognizer>;
59
+ //# sourceMappingURL=TFLiteFaceRecognizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TFLiteFaceRecognizer.d.ts","sourceRoot":"","sources":["../../../../src/detector/TFLiteFaceRecognizer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAchC,OAAO,KAAK,EAEV,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EAChB,MAAM,oBAAiB,CAAC;AA4mBzB;;GAEG;AACH,qBAAa,wBAAyB,YAAW,oBAAoB;IACnE,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,IAAI,0BAA0B;IAC9C,SAAgB,mBAAmB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,eAAe,EAAE,CAAC;IAC3E,SAAgB,gBAAgB,EAAE,eAAe,CAAC;IAClD,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,eAAe,CAAg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