We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 674e0cd commit b23e637Copy full SHA for b23e637
src/faceRecognitionNet/index.ts
@@ -42,8 +42,19 @@ export function faceRecognitionNet(weights: Float32Array) {
42
})
43
}
44
45
- const computeFaceDescriptor = (input: number[] | ImageData) => forward(input).data()
46
- const computeFaceDescriptorSync = (input: number[] | ImageData) => forward(input).dataSync()
+ const computeFaceDescriptor = async (input: number[] | ImageData) => {
+ const result = forward(input)
47
+ const data = await result.data()
48
+ result.dispose()
49
+ return data
50
+ }
51
+
52
+ const computeFaceDescriptorSync = (input: number[] | ImageData) => {
53
54
+ const data = result.dataSync()
55
56
57
58
59
return {
60
computeFaceDescriptor,
0 commit comments