@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.
- package/LICENSE +21 -0
- package/README.md +405 -2
- package/lib/commonjs/detector/TFLiteCatAnalyzer.js +609 -0
- package/lib/commonjs/detector/TFLiteCatAnalyzer.js.map +1 -0
- package/lib/commonjs/detector/TFLiteFaceRecognizer.js +690 -0
- package/lib/commonjs/detector/TFLiteFaceRecognizer.js.map +1 -0
- package/lib/commonjs/detector/TFLiteObjectDetector.js +392 -0
- package/lib/commonjs/detector/TFLiteObjectDetector.js.map +1 -0
- package/lib/commonjs/detector/index.js +50 -0
- package/lib/commonjs/detector/index.js.map +1 -0
- package/lib/commonjs/detector/modelLoader.js +139 -0
- package/lib/commonjs/detector/modelLoader.js.map +1 -0
- package/lib/commonjs/detector/workletFrameHelper.js +233 -0
- package/lib/commonjs/detector/workletFrameHelper.js.map +1 -0
- package/lib/commonjs/index.js +39 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/parser/blazeFaceParser.js +771 -0
- package/lib/commonjs/parser/blazeFaceParser.js.map +1 -0
- package/lib/commonjs/parser/catParser.js +752 -0
- package/lib/commonjs/parser/catParser.js.map +1 -0
- package/lib/commonjs/parser/index.js +39 -0
- package/lib/commonjs/parser/index.js.map +1 -0
- package/lib/commonjs/parser/outputParser.js +196 -0
- package/lib/commonjs/parser/outputParser.js.map +1 -0
- package/lib/commonjs/types/cat.js +6 -0
- package/lib/commonjs/types/cat.js.map +1 -0
- package/lib/commonjs/types/index.js +28 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/types/resize-plugin.d.ts +20 -0
- package/lib/commonjs/types/tflite.js +6 -0
- package/lib/commonjs/types/tflite.js.map +1 -0
- package/lib/module/detector/TFLiteCatAnalyzer.js +605 -0
- package/lib/module/detector/TFLiteCatAnalyzer.js.map +1 -0
- package/lib/module/detector/TFLiteFaceRecognizer.js +684 -0
- package/lib/module/detector/TFLiteFaceRecognizer.js.map +1 -0
- package/lib/module/detector/TFLiteObjectDetector.js +386 -0
- package/lib/module/detector/TFLiteObjectDetector.js.map +1 -0
- package/lib/module/detector/index.js +7 -0
- package/lib/module/detector/index.js.map +1 -0
- package/lib/module/detector/modelLoader.js +133 -0
- package/lib/module/detector/modelLoader.js.map +1 -0
- package/lib/module/detector/workletFrameHelper.js +226 -0
- package/lib/module/detector/workletFrameHelper.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/parser/blazeFaceParser.js +756 -0
- package/lib/module/parser/blazeFaceParser.js.map +1 -0
- package/lib/module/parser/catParser.js +739 -0
- package/lib/module/parser/catParser.js.map +1 -0
- package/lib/module/parser/index.js +6 -0
- package/lib/module/parser/index.js.map +1 -0
- package/lib/module/parser/outputParser.js +192 -0
- package/lib/module/parser/outputParser.js.map +1 -0
- package/lib/module/types/cat.js +4 -0
- package/lib/module/types/cat.js.map +1 -0
- package/lib/module/types/index.js +5 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/resize-plugin.d.ts +20 -0
- package/lib/module/types/tflite.js +4 -0
- package/lib/module/types/tflite.js.map +1 -0
- package/lib/typescript/commonjs/detector/TFLiteCatAnalyzer.d.ts +6 -0
- package/lib/typescript/commonjs/detector/TFLiteCatAnalyzer.d.ts.map +1 -0
- package/lib/typescript/commonjs/detector/TFLiteFaceRecognizer.d.ts +59 -0
- package/lib/typescript/commonjs/detector/TFLiteFaceRecognizer.d.ts.map +1 -0
- package/lib/typescript/commonjs/detector/TFLiteObjectDetector.d.ts +41 -0
- package/lib/typescript/commonjs/detector/TFLiteObjectDetector.d.ts.map +1 -0
- package/lib/typescript/commonjs/detector/index.d.ts +5 -0
- package/lib/typescript/commonjs/detector/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/detector/modelLoader.d.ts +23 -0
- package/lib/typescript/commonjs/detector/modelLoader.d.ts.map +1 -0
- package/lib/typescript/commonjs/detector/workletFrameHelper.d.ts +40 -0
- package/lib/typescript/commonjs/detector/workletFrameHelper.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +4 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/parser/blazeFaceParser.d.ts +68 -0
- package/lib/typescript/commonjs/parser/blazeFaceParser.d.ts.map +1 -0
- package/lib/typescript/commonjs/parser/catParser.d.ts +61 -0
- package/lib/typescript/commonjs/parser/catParser.d.ts.map +1 -0
- package/lib/typescript/commonjs/parser/index.d.ts +4 -0
- package/lib/typescript/commonjs/parser/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/parser/outputParser.d.ts +17 -0
- package/lib/typescript/commonjs/parser/outputParser.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/cat.d.ts +109 -0
- package/lib/typescript/commonjs/types/cat.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/index.d.ts +3 -0
- package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/tflite.d.ts +233 -0
- package/lib/typescript/commonjs/types/tflite.d.ts.map +1 -0
- package/lib/typescript/module/detector/TFLiteCatAnalyzer.d.ts +6 -0
- package/lib/typescript/module/detector/TFLiteCatAnalyzer.d.ts.map +1 -0
- package/lib/typescript/module/detector/TFLiteFaceRecognizer.d.ts +59 -0
- package/lib/typescript/module/detector/TFLiteFaceRecognizer.d.ts.map +1 -0
- package/lib/typescript/module/detector/TFLiteObjectDetector.d.ts +41 -0
- package/lib/typescript/module/detector/TFLiteObjectDetector.d.ts.map +1 -0
- package/lib/typescript/module/detector/index.d.ts +5 -0
- package/lib/typescript/module/detector/index.d.ts.map +1 -0
- package/lib/typescript/module/detector/modelLoader.d.ts +23 -0
- package/lib/typescript/module/detector/modelLoader.d.ts.map +1 -0
- package/lib/typescript/module/detector/workletFrameHelper.d.ts +40 -0
- package/lib/typescript/module/detector/workletFrameHelper.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +4 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/parser/blazeFaceParser.d.ts +68 -0
- package/lib/typescript/module/parser/blazeFaceParser.d.ts.map +1 -0
- package/lib/typescript/module/parser/catParser.d.ts +61 -0
- package/lib/typescript/module/parser/catParser.d.ts.map +1 -0
- package/lib/typescript/module/parser/index.d.ts +4 -0
- package/lib/typescript/module/parser/index.d.ts.map +1 -0
- package/lib/typescript/module/parser/outputParser.d.ts +17 -0
- package/lib/typescript/module/parser/outputParser.d.ts.map +1 -0
- package/lib/typescript/module/types/cat.d.ts +109 -0
- package/lib/typescript/module/types/cat.d.ts.map +1 -0
- package/lib/typescript/module/types/index.d.ts +3 -0
- package/lib/typescript/module/types/index.d.ts.map +1 -0
- package/lib/typescript/module/types/tflite.d.ts +233 -0
- package/lib/typescript/module/types/tflite.d.ts.map +1 -0
- package/package.json +116 -4
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
let cachedResizer = undefined;
|
|
4
|
+
let cachedFrameConverter = undefined;
|
|
5
|
+
export function getOptionalResizePlugin() {
|
|
6
|
+
if (cachedResizer !== undefined) {
|
|
7
|
+
return cachedResizer;
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
11
|
+
const plugin = require('vision-camera-resize-plugin');
|
|
12
|
+
if (typeof plugin?.resize === 'function') {
|
|
13
|
+
cachedResizer = plugin;
|
|
14
|
+
return plugin;
|
|
15
|
+
}
|
|
16
|
+
} catch {
|
|
17
|
+
// vision-camera-resize-plugin not installed
|
|
18
|
+
}
|
|
19
|
+
cachedResizer = null;
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
export function getOptionalFrameConverter() {
|
|
23
|
+
if (cachedFrameConverter !== undefined) {
|
|
24
|
+
return cachedFrameConverter;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
28
|
+
const vc = require('react-native-vision-camera');
|
|
29
|
+
if (typeof vc?.HybridFrameConverter?.convertFrameToImage === 'function') {
|
|
30
|
+
cachedFrameConverter = vc.HybridFrameConverter;
|
|
31
|
+
return cachedFrameConverter;
|
|
32
|
+
}
|
|
33
|
+
} catch {
|
|
34
|
+
// react-native-vision-camera HybridFrameConverter not loaded
|
|
35
|
+
}
|
|
36
|
+
cachedFrameConverter = null;
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
export function createWorkletSyncRef(initial, fixedType = false) {
|
|
40
|
+
try {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
42
|
+
const worklets = require('react-native-worklets');
|
|
43
|
+
if (typeof worklets?.createSynchronizable === 'function') {
|
|
44
|
+
return fixedType ? worklets.createSynchronizable(initial, {
|
|
45
|
+
fixedType: true
|
|
46
|
+
}) : worklets.createSynchronizable(initial);
|
|
47
|
+
}
|
|
48
|
+
} catch {
|
|
49
|
+
// Fallback outside native runtime
|
|
50
|
+
}
|
|
51
|
+
let val = initial;
|
|
52
|
+
return {
|
|
53
|
+
getBlocking: () => val,
|
|
54
|
+
setBlocking: next => {
|
|
55
|
+
val = next;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function viewToArrayBuffer(view) {
|
|
60
|
+
'worklet';
|
|
61
|
+
|
|
62
|
+
const underlying = view.buffer;
|
|
63
|
+
if (view.byteOffset === 0 && view.byteLength === underlying.byteLength) {
|
|
64
|
+
return underlying;
|
|
65
|
+
}
|
|
66
|
+
return underlying.slice(view.byteOffset, view.byteOffset + view.byteLength);
|
|
67
|
+
}
|
|
68
|
+
function normalizeRawPixelsToRgbUint8(buffer, pixelFormat, width, height) {
|
|
69
|
+
'worklet';
|
|
70
|
+
|
|
71
|
+
const src = new Uint8Array(buffer);
|
|
72
|
+
const expectedPixels = Math.max(0, Math.floor(width) * Math.floor(height));
|
|
73
|
+
if (pixelFormat === 'RGB') {
|
|
74
|
+
const expectedBytes = expectedPixels * 3;
|
|
75
|
+
if (src.byteLength === expectedBytes) {
|
|
76
|
+
return buffer;
|
|
77
|
+
}
|
|
78
|
+
const copyLen = Math.min(src.byteLength, expectedBytes);
|
|
79
|
+
const out = new Uint8Array(expectedBytes);
|
|
80
|
+
out.set(src.subarray(0, copyLen));
|
|
81
|
+
return out.buffer;
|
|
82
|
+
}
|
|
83
|
+
const out = new Uint8Array(expectedPixels * 3);
|
|
84
|
+
const count = Math.min(expectedPixels, Math.floor(src.byteLength / 4));
|
|
85
|
+
const isBgra = pixelFormat === 'BGRA' || pixelFormat === 'BGRX';
|
|
86
|
+
if (isBgra) {
|
|
87
|
+
for (let i = 0; i < count; i++) {
|
|
88
|
+
const s = i * 4;
|
|
89
|
+
const d = i * 3;
|
|
90
|
+
out[d] = src[s + 2];
|
|
91
|
+
out[d + 1] = src[s + 1];
|
|
92
|
+
out[d + 2] = src[s];
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
for (let i = 0; i < count; i++) {
|
|
96
|
+
const s = i * 4;
|
|
97
|
+
const d = i * 3;
|
|
98
|
+
out[d] = src[s];
|
|
99
|
+
out[d + 1] = src[s + 1];
|
|
100
|
+
out[d + 2] = src[s + 2];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return out.buffer;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Extracts a contiguous RGB uint8 buffer from VisionCamera v5 Nitro Frame,
|
|
107
|
+
* vision-camera-resize-plugin, or direct ArrayBuffer inputs cleanly on the worklet thread.
|
|
108
|
+
*/
|
|
109
|
+
export function extractRgbUint8Frame(frame, targetSize, frameConverter, resizePlugin) {
|
|
110
|
+
'worklet';
|
|
111
|
+
|
|
112
|
+
const frameRecord = typeof frame === 'object' && frame !== null ? frame : null;
|
|
113
|
+
const isVc5Frame = frameRecord !== null && typeof frameRecord.getPixelBuffer === 'function';
|
|
114
|
+
if (!isVc5Frame && resizePlugin && frame) {
|
|
115
|
+
try {
|
|
116
|
+
const resized = resizePlugin.resize(frame, {
|
|
117
|
+
scale: {
|
|
118
|
+
width: targetSize,
|
|
119
|
+
height: targetSize
|
|
120
|
+
},
|
|
121
|
+
pixelFormat: 'rgb',
|
|
122
|
+
dataType: 'uint8'
|
|
123
|
+
});
|
|
124
|
+
if (resized?.buffer instanceof ArrayBuffer) {
|
|
125
|
+
return {
|
|
126
|
+
buffer: resized.buffer,
|
|
127
|
+
width: targetSize,
|
|
128
|
+
height: targetSize,
|
|
129
|
+
needs180Correction: false
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
if (resized?.buffer && ArrayBuffer.isView(resized.buffer)) {
|
|
133
|
+
return {
|
|
134
|
+
buffer: viewToArrayBuffer(resized.buffer),
|
|
135
|
+
width: targetSize,
|
|
136
|
+
height: targetSize,
|
|
137
|
+
needs180Correction: false
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (typeof resized?.toArrayBuffer === 'function') {
|
|
141
|
+
return {
|
|
142
|
+
buffer: resized.toArrayBuffer(),
|
|
143
|
+
width: targetSize,
|
|
144
|
+
height: targetSize,
|
|
145
|
+
needs180Correction: false
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
} catch {
|
|
149
|
+
// Continue to VC v5 or raw buffer extraction
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (isVc5Frame && frameConverter) {
|
|
153
|
+
if (frameRecord?.isValid === false) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
const needs180 = frameRecord?.orientation === 'left' || frameRecord?.orientation === 'right';
|
|
157
|
+
let sourceImage = null;
|
|
158
|
+
let resizedImage = null;
|
|
159
|
+
try {
|
|
160
|
+
sourceImage = frameConverter.convertFrameToImage(frame);
|
|
161
|
+
resizedImage = sourceImage.width !== targetSize || sourceImage.height !== targetSize ? sourceImage.resize(targetSize, targetSize) : sourceImage;
|
|
162
|
+
const rawPixel = resizedImage.toRawPixelData(false);
|
|
163
|
+
const w = rawPixel.width > 0 ? rawPixel.width : targetSize;
|
|
164
|
+
const h = rawPixel.height > 0 ? rawPixel.height : targetSize;
|
|
165
|
+
return {
|
|
166
|
+
buffer: normalizeRawPixelsToRgbUint8(rawPixel.buffer, rawPixel.pixelFormat, w, h),
|
|
167
|
+
width: w,
|
|
168
|
+
height: h,
|
|
169
|
+
needs180Correction: needs180
|
|
170
|
+
};
|
|
171
|
+
} finally {
|
|
172
|
+
if (resizedImage && resizedImage !== sourceImage && typeof resizedImage.dispose === 'function') {
|
|
173
|
+
resizedImage.dispose();
|
|
174
|
+
}
|
|
175
|
+
if (sourceImage && typeof sourceImage.dispose === 'function') {
|
|
176
|
+
sourceImage.dispose();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (frame instanceof ArrayBuffer) {
|
|
181
|
+
const inferredW = Math.max(1, Math.round(Math.sqrt(frame.byteLength / 3)));
|
|
182
|
+
return {
|
|
183
|
+
buffer: frame,
|
|
184
|
+
width: inferredW,
|
|
185
|
+
height: inferredW,
|
|
186
|
+
needs180Correction: false
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
if (ArrayBuffer.isView(frame)) {
|
|
190
|
+
const buf = viewToArrayBuffer(frame);
|
|
191
|
+
const inferredW = Math.max(1, Math.round(Math.sqrt(buf.byteLength / 3)));
|
|
192
|
+
return {
|
|
193
|
+
buffer: buf,
|
|
194
|
+
width: inferredW,
|
|
195
|
+
height: inferredW,
|
|
196
|
+
needs180Correction: false
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
if (frameRecord) {
|
|
200
|
+
let rawBuf = null;
|
|
201
|
+
if (frameRecord.buffer instanceof ArrayBuffer) {
|
|
202
|
+
rawBuf = frameRecord.buffer;
|
|
203
|
+
} else if (frameRecord.buffer && ArrayBuffer.isView(frameRecord.buffer)) {
|
|
204
|
+
rawBuf = viewToArrayBuffer(frameRecord.buffer);
|
|
205
|
+
} else if (typeof frameRecord.toArrayBuffer === 'function') {
|
|
206
|
+
rawBuf = frameRecord.toArrayBuffer();
|
|
207
|
+
}
|
|
208
|
+
if (rawBuf) {
|
|
209
|
+
const w = typeof frameRecord.width === 'number' && frameRecord.width > 0 ? frameRecord.width : targetSize;
|
|
210
|
+
const h = typeof frameRecord.height === 'number' && frameRecord.height > 0 ? frameRecord.height : targetSize;
|
|
211
|
+
return {
|
|
212
|
+
buffer: rawBuf,
|
|
213
|
+
width: w,
|
|
214
|
+
height: h,
|
|
215
|
+
needs180Correction: false
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
buffer: new ArrayBuffer(targetSize * targetSize * 3),
|
|
221
|
+
width: targetSize,
|
|
222
|
+
height: targetSize,
|
|
223
|
+
needs180Correction: false
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
//# sourceMappingURL=workletFrameHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cachedResizer","undefined","cachedFrameConverter","getOptionalResizePlugin","plugin","require","resize","getOptionalFrameConverter","vc","HybridFrameConverter","convertFrameToImage","createWorkletSyncRef","initial","fixedType","worklets","createSynchronizable","val","getBlocking","setBlocking","next","viewToArrayBuffer","view","underlying","buffer","byteOffset","byteLength","slice","normalizeRawPixelsToRgbUint8","pixelFormat","width","height","src","Uint8Array","expectedPixels","Math","max","floor","expectedBytes","copyLen","min","out","set","subarray","count","isBgra","i","s","d","extractRgbUint8Frame","frame","targetSize","frameConverter","resizePlugin","frameRecord","isVc5Frame","getPixelBuffer","resized","scale","dataType","ArrayBuffer","needs180Correction","isView","toArrayBuffer","isValid","needs180","orientation","sourceImage","resizedImage","rawPixel","toRawPixelData","w","h","dispose","inferredW","round","sqrt","buf","r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D,iBAAiB,CAACiC,WAAW,CAAC9B,MAAM,CAAC;IAChD,CAAC,MAAM,IAAI,OAAO8B,WAAW,CAACS,aAAa,KAAK,UAAU,EAAE;MAC1De,MAAM,GAAGxB,WAAW,CAACS,aAAa,CAAC,CAAC;IACtC;IACA,IAAIe,MAAM,EAAE;MACV,MAAMP,CAAC,GACL,OAAOjB,WAAW,CAACxB,KAAK,KAAK,QAAQ,IAAIwB,WAAW,CAACxB,KAAK,GAAG,CAAC,GAC1DwB,WAAW,CAACxB,KAAK,GACjBqB,UAAU;MAChB,MAAMqB,CAAC,GACL,OAAOlB,WAAW,CAACvB,MAAM,KAAK,QAAQ,IAAIuB,WAAW,CAACvB,MAAM,GAAG,CAAC,GAC5DuB,WAAW,CAACvB,MAAM,GAClBoB,UAAU;MAChB,OAAO;QACL3B,MAAM,EAAEsD,MAAM;QACdhD,KAAK,EAAEyC,CAAC;QACRxC,MAAM,EAAEyC,CAAC;QACTX,kBAAkB,EAAE;MACtB,CAAC;IACH;EACF;EAEA,OAAO;IACLrC,MAAM,EAAE,IAAIoC,WAAW,CAACT,UAAU,GAAGA,UAAU,GAAG,CAAC,CAAC;IACpDrB,KAAK,EAAEqB,UAAU;IACjBpB,MAAM,EAAEoB,UAAU;IAClBU,kBAAkB,EAAE;EACtB,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,kBAAS;AACvB,cAAc,mBAAU;AACxB,cAAc,qBAAY","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|