UNPKG

@vladmandic/face-api

Version:

FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS

19 lines (15 loc) 441 B
export function extractWeightsFactory(weights: Float32Array) { let remainingWeights = weights; function extractWeights(numWeights: number): Float32Array { const ret = remainingWeights.slice(0, numWeights); remainingWeights = remainingWeights.slice(numWeights); return ret; } function getRemainingWeights(): Float32Array { return remainingWeights; } return { extractWeights, getRemainingWeights, }; }