@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,41 @@
1
+ import { type DetectionResult, type ModelStatus, type WorkletBoolSync } from '@masumdev/rn-camera-ai';
2
+ import type { TFLiteObjectDetector, TFLiteObjectDetectorConfig, TensorflowModel } from '../types/tflite.js';
3
+ /**
4
+ * Concrete implementation of the TFLite Object Detection CameraProcessor.
5
+ */
6
+ export declare class TFLiteDetectorImpl implements TFLiteObjectDetector {
7
+ readonly id: string;
8
+ readonly name = "TFLiteObjectDetector";
9
+ readonly processFrameWorklet: (frame: unknown) => DetectionResult[];
10
+ readonly wasThrottledSync: WorkletBoolSync;
11
+ private _status;
12
+ private _activeDelegate;
13
+ private _confidenceThreshold;
14
+ private _maxResults;
15
+ private _config;
16
+ private _disposedSync;
17
+ private _readySync;
18
+ private _modelSync;
19
+ private _confidenceSync;
20
+ private _maxResultsSync;
21
+ private _lastFrameTimeSync;
22
+ constructor(config: TFLiteObjectDetectorConfig, model: TensorflowModel, activeDelegate: 'gpu' | 'cpu');
23
+ get status(): ModelStatus;
24
+ get activeDelegate(): 'gpu' | 'cpu';
25
+ get confidenceThreshold(): number;
26
+ get maxResults(): number;
27
+ get targetFps(): number | undefined;
28
+ setConfidenceThreshold(newThreshold: number): void;
29
+ setMaxResults(newMaxResults: number): void;
30
+ processFrame(frame: unknown): DetectionResult[];
31
+ initialize(): Promise<void>;
32
+ dispose(): void;
33
+ }
34
+ /**
35
+ * Creates and initializes a TensorFlow Lite object detector processor.
36
+ *
37
+ * @param config Detector configuration parameters
38
+ * @returns Fully initialized TFLiteObjectDetector instance
39
+ */
40
+ export declare function createTFLiteObjectDetector(config: TFLiteObjectDetectorConfig): Promise<TFLiteObjectDetector>;
41
+ //# sourceMappingURL=TFLiteObjectDetector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TFLiteObjectDetector.d.ts","sourceRoot":"","sources":["../../../../src/detector/TFLiteObjectDetector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,oBAAoB,EACpB,0BAA0B,EAE1B,eAAe,EAChB,MAAM,oBAAiB,CAAC;AAyXzB;;GAEG;AACH,qBAAa,kBAAmB,YAAW,oBAAoB;IAC7D,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,CAAgB;IACvC,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,kBAAkB,CAAkB;gBAG1C,MAAM,EAAE,0BAA0B,EAClC,KAAK,EAAE,eAAe,EACtB,cAAc,EAAE,KAAK,GAAG,KAAK;IAkD/B,IAAI,MAAM,IAAI,WAAW,CAExB;IAED,IAAI,cAAc,IAAI,KAAK,GAAG,KAAK,CAElC;IAED,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAOlD,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAO1C,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,EAAE;IAczC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAkBjC,OAAO,IAAI,IAAI;CAOhB;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,oBAAoB,CAAC,CAS/B"}
@@ -0,0 +1,5 @@
1
+ export * from './modelLoader.js';
2
+ export * from './TFLiteObjectDetector.js';
3
+ export * from './TFLiteFaceRecognizer.js';
4
+ export * from './TFLiteCatAnalyzer.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/detector/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAe,CAAC;AAC9B,cAAc,2BAAwB,CAAC;AACvC,cAAc,2BAAwB,CAAC;AACvC,cAAc,wBAAqB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { LoadedModelResult, ModelLoaderOptions, TFLiteModelSource } from '../types/tflite.js';
2
+ /**
3
+ * Validates that the provided model source conforms to supported TFLite model source representations.
4
+ * Throws a typed ModelLoadError if the source is invalid or empty.
5
+ */
6
+ export declare function validateModelSource(source: unknown): TFLiteModelSource;
7
+ /**
8
+ * Determines the target operating platform for delegate selection.
9
+ */
10
+ export declare function getEffectivePlatform(platformOverride?: string): string;
11
+ /**
12
+ * Loads a TensorFlow Lite model with automatic hardware delegate fallback.
13
+ *
14
+ * It attempts to initialize with GPU acceleration ('android-gpu' on Android, 'core-ml' on iOS).
15
+ * If the GPU delegate fails (e.g., unsupported OpenCL/OpenGL ops), it falls back to CPU ([])
16
+ * without throwing or crashing, safely emitting onDelegateFallback.
17
+ *
18
+ * @param source Model bundle ID, file path string, or URL object
19
+ * @param options Loading options including GPU preference and fallback callback
20
+ * @returns Initialized model and active delegate ('gpu' | 'cpu')
21
+ */
22
+ export declare function loadModelWithFallback(source: unknown, options?: ModelLoaderOptions): Promise<LoadedModelResult>;
23
+ //# sourceMappingURL=modelLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelLoader.d.ts","sourceRoot":"","sources":["../../../../src/detector/modelLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,oBAAiB,CAAC;AAEzB;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,iBAAiB,CAwCtE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAoBtE;AAwDD;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAoC5B"}
@@ -0,0 +1,40 @@
1
+ export interface ResizerModuleLike {
2
+ resize: (frame: unknown, options: unknown) => {
3
+ buffer?: ArrayBuffer;
4
+ toArrayBuffer?: () => ArrayBuffer;
5
+ };
6
+ }
7
+ export interface NitroImageLike {
8
+ readonly width: number;
9
+ readonly height: number;
10
+ resize(width: number, height: number): NitroImageLike;
11
+ toRawPixelData(allowGpu?: boolean): {
12
+ buffer: ArrayBuffer;
13
+ width: number;
14
+ height: number;
15
+ pixelFormat: string;
16
+ };
17
+ dispose?: () => void;
18
+ }
19
+ export interface FrameConverterLike {
20
+ convertFrameToImage(frame: unknown): NitroImageLike;
21
+ }
22
+ export interface WorkletSyncRef<T> {
23
+ getBlocking(): T;
24
+ setBlocking(value: T): void;
25
+ }
26
+ export declare function getOptionalResizePlugin(): ResizerModuleLike | null;
27
+ export declare function getOptionalFrameConverter(): FrameConverterLike | null;
28
+ export declare function createWorkletSyncRef<T>(initial: T, fixedType?: boolean): WorkletSyncRef<T>;
29
+ export interface ExtractedRgbFrame {
30
+ buffer: ArrayBuffer;
31
+ width: number;
32
+ height: number;
33
+ needs180Correction: boolean;
34
+ }
35
+ /**
36
+ * Extracts a contiguous RGB uint8 buffer from VisionCamera v5 Nitro Frame,
37
+ * vision-camera-resize-plugin, or direct ArrayBuffer inputs cleanly on the worklet thread.
38
+ */
39
+ export declare function extractRgbUint8Frame(frame: unknown, targetSize: number, frameConverter: FrameConverterLike | null, resizePlugin: ResizerModuleLike | null): ExtractedRgbFrame | null;
40
+ //# sourceMappingURL=workletFrameHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workletFrameHelper.d.ts","sourceRoot":"","sources":["../../../../src/detector/workletFrameHelper.ts"],"names":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H,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,kBAAkB,GAAG,IAAI,EACzC,YAAY,EAAE,iBAAiB,GAAG,IAAI,GACrC,iBAAiB,GAAG,IAAI,CAiJ1B"}
@@ -0,0 +1,4 @@
1
+ export * from './types/index.js';
2
+ export * from './parser/index.js';
3
+ export * from './detector/index.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAS,CAAC;AACxB,cAAc,mBAAU,CAAC;AACzB,cAAc,qBAAY,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,68 @@
1
+ import type { BoundingBox, DetectionResult, FaceLandmark, FaceLivenessMetrics } from '@masumdev/rn-camera-ai';
2
+ import type { BlazeFaceAnchor, BlazeFaceDecodeOptions } from '../types/tflite.js';
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":"blazeFaceParser.d.ts","sourceRoot":"","sources":["../../../../src/parser/blazeFaceParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,YAAY,EAEZ,mBAAmB,EAGpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACvB,MAAM,oBAAiB,CAAC;AAWzB;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,eAAe,EAAE,CA4B5D;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,IAAI,eAAe,EAAE,CAYrE;AAiDD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,eAAe,EAAE,EAC7B,YAAY,SAAM,EAClB,UAAU,SAAI,GACb,eAAe,EAAE,CA6BnB;A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E,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,EACtB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,UAAU,SAAM,EAChB,MAAM,GAAE,WAAiD,GACxD;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAmDjD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,OAAO,EAAE,EACrB,IAAI,EAAE,gBAAgB,GACrB,WAAW,GAAG,IAAI,CAyCpB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,OAAO,EAAE,EACrB,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,MAAM,EAAE,cAAc,EACtB,gBAAgB,UAAQ,EACxB,IAAI,SAAI,GACP,iBAAiB,EAAE,CAwDrB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,EAAE,EAC5B,OAAO,EAAE,iBAAiB,EAAE,EAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,KAAK,SAAO,EACZ,IAAI,SAAI,GACP,iBAAiB,EAAE,CAoErB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,OAAO,EAAE,EACrB,OAAO,EAAE,WAAW,GACnB,YAAY,EAAE,GAAG,IAAI,CAiCvB;AAoCD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,YAAY,EAAE,GAAG,cAAc,CAuEjF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,OAAO,EAAE,EACrB,aAAa,SAAI,EACjB,QAAQ,SAAK,EACb,UAAU,SAAM,EAChB,UAAU,SAAK,GACd,sBAAsB,GAAG,IAAI,CAoE/B;AASD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,WAAW,EACtB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,EACnB,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.js';
2
+ export * from './blazeFaceParser.js';
3
+ export * from './catParser.js';
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,mBAAgB,CAAC;AAC/B,cAAc,sBAAmB,CAAC;AAClC,cAAc,gBAAa,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { DetectionResult } from '@masumdev/rn-camera-ai';
2
+ import type { ParseOptions, TFLiteOutputs } from '../types/tflite.js';
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,oBAAiB,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.js';
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,aAAU,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,KAAK,GACL,OAAO,GACP,WAAW,GACX,cAAc,GACd,UAAU,CAAC;AAEf;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,UAAU,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,qEAAqE;IACrE,aAAa,EAAE,iBAAiB,CAAC;IACjC,qCAAqC;IACrC,cAAc,CAAC,EAAE,MAAM,E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P,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.js';
2
+ export * from './cat.js';
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,aAAU,CAAC;AACzB,cAAc,UAAO,CAAC"}