release preview
parent
e70d9bb18b
commit
118fbaba4d
|
@ -13,7 +13,7 @@
|
||||||
"locations": ["dist/*", "typedoc/*", "types/lib/src"]
|
"locations": ["dist/*", "typedoc/*", "types/lib/src"]
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"locations": [ "src/**" ],
|
"locations": [ "src/" ],
|
||||||
"rules": { }
|
"rules": { }
|
||||||
},
|
},
|
||||||
"changelog": {
|
"changelog": {
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
node_modules
|
node_modules
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
### **HEAD -> master** 2021/12/01 mandic00@live.com
|
### **HEAD -> master** 2021/12/01 mandic00@live.com
|
||||||
|
|
||||||
|
- rebuild
|
||||||
|
|
||||||
### **1.5.8** 2021/11/30 mandic00@live.com
|
### **1.5.8** 2021/11/30 mandic00@live.com
|
||||||
|
|
||||||
|
@ -26,7 +27,6 @@
|
||||||
|
|
||||||
### **1.5.5** 2021/10/19 mandic00@live.com
|
### **1.5.5** 2021/10/19 mandic00@live.com
|
||||||
|
|
||||||
- rebuild
|
|
||||||
- allow backend change in demo via url params
|
- allow backend change in demo via url params
|
||||||
- add node-match demo
|
- add node-match demo
|
||||||
- fix face matcher
|
- fix face matcher
|
||||||
|
|
|
@ -2137,7 +2137,7 @@ function drawFaceLandmarks(canvasArg, faceLandmarks) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// package.json
|
// package.json
|
||||||
var version10 = "1.5.8";
|
var version10 = "1.6.0";
|
||||||
|
|
||||||
// src/xception/extractParams.ts
|
// src/xception/extractParams.ts
|
||||||
function extractorsFactory2(extractWeights, paramMappings) {
|
function extractorsFactory2(extractWeights, paramMappings) {
|
||||||
|
|
|
@ -72894,7 +72894,7 @@ function drawFaceLandmarks(canvasArg, faceLandmarks) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// package.json
|
// package.json
|
||||||
var version9 = "1.5.8";
|
var version9 = "1.6.0";
|
||||||
|
|
||||||
// src/xception/extractParams.ts
|
// src/xception/extractParams.ts
|
||||||
function extractorsFactory2(extractWeights, paramMappings) {
|
function extractorsFactory2(extractWeights, paramMappings) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2292,7 +2292,7 @@ function drawFaceLandmarks(canvasArg, faceLandmarks) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// package.json
|
// package.json
|
||||||
var version = "1.5.8";
|
var version = "1.6.0";
|
||||||
|
|
||||||
// src/ageGenderNet/AgeGenderNet.ts
|
// src/ageGenderNet/AgeGenderNet.ts
|
||||||
var tf20 = __toModule(require_tfjs_esm());
|
var tf20 = __toModule(require_tfjs_esm());
|
||||||
|
|
|
@ -2292,7 +2292,7 @@ function drawFaceLandmarks(canvasArg, faceLandmarks) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// package.json
|
// package.json
|
||||||
var version = "1.5.8";
|
var version = "1.6.0";
|
||||||
|
|
||||||
// src/ageGenderNet/AgeGenderNet.ts
|
// src/ageGenderNet/AgeGenderNet.ts
|
||||||
var tf20 = __toModule(require_tfjs_esm());
|
var tf20 = __toModule(require_tfjs_esm());
|
||||||
|
|
|
@ -20,4 +20,7 @@ export declare const version: {
|
||||||
tfjs: string;
|
tfjs: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export { Tensor, TensorLike, Rank, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, NamedTensorMap } from '@tensorflow/tfjs-core/dist/index';
|
// export { io, browser, image } from '@tensorflow/tfjs-core';
|
||||||
|
export { tensor, tidy, softmax, unstack, relu, add, conv2d, cast, zeros, concat, avgPool, stack, fill, transpose, tensor1d, tensor2d, tensor3d, tensor4d, maxPool, matMul, mul, sub, scalar } from '@tensorflow/tfjs-core';
|
||||||
|
export { div, pad, slice, reshape, slice3d, expandDims, depthwiseConv2d, separableConv2d, sigmoid, exp, tile, batchNorm, clipByValue } from '@tensorflow/tfjs-core';
|
||||||
|
export { ENV, Variable, Tensor, TensorLike, Rank, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, NamedTensorMap } from '@tensorflow/tfjs-core';
|
||||||
|
|
|
@ -47,8 +47,9 @@ export class NetInput {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
const canvas = (input as any) instanceof env.getEnv().Canvas ? input : createCanvasFromMedia(input);
|
const canvas = (input as any) instanceof env.getEnv().Canvas ? input : createCanvasFromMedia(input);
|
||||||
this._canvases[idx] = canvas;
|
this._canvases[idx] = canvas as HTMLCanvasElement;
|
||||||
this._inputDimensions[idx] = [canvas.height, canvas.width, 3];
|
this._inputDimensions[idx] = [canvas.height, canvas.width, 3];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -127,10 +128,10 @@ export class NetInput {
|
||||||
|
|
||||||
if (input instanceof tf.Tensor) {
|
if (input instanceof tf.Tensor) {
|
||||||
let imgTensor = isTensor4D(input) ? input : tf.expandDims(input);
|
let imgTensor = isTensor4D(input) ? input : tf.expandDims(input);
|
||||||
imgTensor = padToSquare(imgTensor, isCenterInputs);
|
imgTensor = padToSquare(imgTensor as tf.Tensor4D, isCenterInputs);
|
||||||
|
|
||||||
if (imgTensor.shape[1] !== inputSize || imgTensor.shape[2] !== inputSize) {
|
if (imgTensor.shape[1] !== inputSize || imgTensor.shape[2] !== inputSize) {
|
||||||
imgTensor = tf.image.resizeBilinear(imgTensor, [inputSize, inputSize], false, false);
|
imgTensor = tf.image.resizeBilinear(imgTensor as tf.Tensor4D, [inputSize, inputSize], false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return imgTensor.as3D(inputSize, inputSize, 3);
|
return imgTensor.as3D(inputSize, inputSize, 3);
|
||||||
|
|
|
@ -51,7 +51,7 @@ export class FaceRecognitionNet extends NeuralNetwork<NetParams> {
|
||||||
const globalAvg = out.mean([1, 2]) as tf.Tensor2D;
|
const globalAvg = out.mean([1, 2]) as tf.Tensor2D;
|
||||||
const fullyConnected = tf.matMul(globalAvg, params.fc);
|
const fullyConnected = tf.matMul(globalAvg, params.fc);
|
||||||
|
|
||||||
return fullyConnected;
|
return fullyConnected as tf.Tensor2D;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ export class FaceRecognitionNet extends NeuralNetwork<NetParams> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async computeFaceDescriptor(input: TNetInput): Promise<Float32Array|Float32Array[]> {
|
public async computeFaceDescriptor(input: TNetInput): Promise<Float32Array|Float32Array[]> {
|
||||||
|
// @ts-ignore
|
||||||
if (input?.shape?.some((dim) => dim <= 0)) return new Float32Array(128);
|
if (input?.shape?.some((dim) => dim <= 0)) return new Float32Array(128);
|
||||||
const netInput = await toNetInput(input);
|
const netInput = await toNetInput(input);
|
||||||
const faceDescriptorTensors = tf.tidy(() => tf.unstack(this.forwardInput(netInput)));
|
const faceDescriptorTensors = tf.tidy(() => tf.unstack(this.forwardInput(netInput)));
|
||||||
|
|
|
@ -25,7 +25,7 @@ export function padToSquare(imgTensor: tf.Tensor4D, isCenterImage = false): tf.T
|
||||||
const paddingTensorPrepend = isCenterImage && remainingPaddingAmount ? createPaddingTensor(remainingPaddingAmount) : null;
|
const paddingTensorPrepend = isCenterImage && remainingPaddingAmount ? createPaddingTensor(remainingPaddingAmount) : null;
|
||||||
const tensorsToStack = [paddingTensorPrepend, imgTensor, paddingTensorAppend]
|
const tensorsToStack = [paddingTensorPrepend, imgTensor, paddingTensorAppend]
|
||||||
.filter((t) => !!t)
|
.filter((t) => !!t)
|
||||||
.map((t: tf.Tensor) => tf.cast(t, 'float32')) as tf.Tensor4D[];
|
.map((t) => tf.cast(t as tf.Tensor4D, 'float32')) as tf.Tensor4D[];
|
||||||
return tf.concat(tensorsToStack, paddingAxis);
|
return tf.concat(tensorsToStack, paddingAxis);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -20,4 +20,7 @@ export declare const version: {
|
||||||
tfjs: string;
|
tfjs: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export { Tensor, TensorLike, Rank, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, NamedTensorMap } from '@tensorflow/tfjs-core/dist/index';
|
// export { io, browser, image } from '@tensorflow/tfjs-core';
|
||||||
|
export { tensor, tidy, softmax, unstack, relu, add, conv2d, cast, zeros, concat, avgPool, stack, fill, transpose, tensor1d, tensor2d, tensor3d, tensor4d, maxPool, matMul, mul, sub, scalar } from '@tensorflow/tfjs-core';
|
||||||
|
export { div, pad, slice, reshape, slice3d, expandDims, depthwiseConv2d, separableConv2d, sigmoid, exp, tile, batchNorm, clipByValue } from '@tensorflow/tfjs-core';
|
||||||
|
export { ENV, Variable, Tensor, TensorLike, Rank, Tensor1D, Tensor2D, Tensor3D, Tensor4D, Tensor5D, NamedTensorMap } from '@tensorflow/tfjs-core';
|
||||||
|
|
Loading…
Reference in New Issue