mirror of https://github.com/vladmandic/human
fix gender-ssrnet-imdb
parent
c8571ad8e2
commit
da3cf359fd
|
@ -11,6 +11,7 @@
|
|||
|
||||
### **HEAD -> main** 2023/02/13 mandic00@live.com
|
||||
|
||||
- rebuild and publish
|
||||
- add face.detector.minsize configurable setting
|
||||
- add affectnet
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -39286,12 +39286,18 @@ async function predict11(image, config3, idx, count2) {
|
|||
const t10 = {};
|
||||
t10.resize = eK.resizeBilinear(image, [model14.inputs[0].shape[2], model14.inputs[0].shape[1]], false);
|
||||
t10.enhance = Ee(() => {
|
||||
const [red, green, blue] = Oa(t10.resize, 3, 3);
|
||||
const redNorm = ne(red, rgb2[0]);
|
||||
const greenNorm = ne(green, rgb2[1]);
|
||||
const blueNorm = ne(blue, rgb2[2]);
|
||||
const grayscale = K0([redNorm, greenNorm, blueNorm]);
|
||||
const normalize2 = ne(ke(grayscale, constants.tf05), 2);
|
||||
var _a4, _b3;
|
||||
let normalize2;
|
||||
if (((_b3 = (_a4 = model14 == null ? void 0 : model14.inputs) == null ? void 0 : _a4[0].shape) == null ? void 0 : _b3[3]) === 1) {
|
||||
const [red, green, blue] = Oa(t10.resize, 3, 3);
|
||||
const redNorm = ne(red, rgb2[0]);
|
||||
const greenNorm = ne(green, rgb2[1]);
|
||||
const blueNorm = ne(blue, rgb2[2]);
|
||||
const grayscale = K0([redNorm, greenNorm, blueNorm]);
|
||||
normalize2 = ne(ke(grayscale, constants.tf05), 2);
|
||||
} else {
|
||||
normalize2 = ne(ke(t10.resize, constants.tf05), 2);
|
||||
}
|
||||
return normalize2;
|
||||
});
|
||||
const obj = { gender: "unknown", genderScore: 0 };
|
||||
|
|
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
|
@ -91,15 +91,15 @@
|
|||
"@tensorflow/tfjs-layers": "^4.2.0",
|
||||
"@tensorflow/tfjs-node": "^4.2.0",
|
||||
"@tensorflow/tfjs-node-gpu": "^4.2.0",
|
||||
"@types/node": "^18.13.0",
|
||||
"@types/node": "^18.14.0",
|
||||
"@types/offscreencanvas": "^2019.7.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
||||
"@typescript-eslint/parser": "^5.51.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.53.0",
|
||||
"@typescript-eslint/parser": "^5.53.0",
|
||||
"@vladmandic/build": "0.8.2",
|
||||
"@vladmandic/pilogger": "^0.4.7",
|
||||
"@vladmandic/tfjs": "github:vladmandic/tfjs",
|
||||
"canvas": "^2.11.0",
|
||||
"esbuild": "^0.17.8",
|
||||
"esbuild": "^0.17.10",
|
||||
"eslint": "8.34.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-html": "^7.1.0",
|
||||
|
|
|
@ -43,12 +43,17 @@ export async function predict(image: Tensor4D, config: Config, idx, count): Prom
|
|||
const t: Record<string, Tensor> = {};
|
||||
t.resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);
|
||||
t.enhance = tf.tidy(() => {
|
||||
const [red, green, blue] = tf.split(t.resize, 3, 3);
|
||||
const redNorm = tf.mul(red, rgb[0]);
|
||||
const greenNorm = tf.mul(green, rgb[1]);
|
||||
const blueNorm = tf.mul(blue, rgb[2]);
|
||||
const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);
|
||||
const normalize = tf.mul(tf.sub(grayscale, constants.tf05), 2); // range grayscale:-1..1
|
||||
let normalize: Tensor;
|
||||
if (model?.inputs?.[0].shape?.[3] === 1) {
|
||||
const [red, green, blue] = tf.split(t.resize, 3, 3);
|
||||
const redNorm = tf.mul(red, rgb[0]);
|
||||
const greenNorm = tf.mul(green, rgb[1]);
|
||||
const blueNorm = tf.mul(blue, rgb[2]);
|
||||
const grayscale = tf.addN([redNorm, greenNorm, blueNorm]);
|
||||
normalize = tf.mul(tf.sub(grayscale, constants.tf05), 2); // range grayscale:-1..1
|
||||
} else {
|
||||
normalize = tf.mul(tf.sub(t.resize, constants.tf05), 2); // range rgb:-1..1
|
||||
}
|
||||
return normalize;
|
||||
});
|
||||
const obj: { gender: Gender, genderScore: number } = { gender: 'unknown', genderScore: 0 };
|
||||
|
|
100
test/build.log
100
test/build.log
|
@ -1,50 +1,50 @@
|
|||
2023-02-13 10:14:55 [32mDATA: [39m Build {"name":"@vladmandic/human","version":"3.0.5"}
|
||||
2023-02-13 10:14:55 [36mINFO: [39m Application: {"name":"@vladmandic/human","version":"3.0.5"}
|
||||
2023-02-13 10:14:55 [36mINFO: [39m Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
|
||||
2023-02-13 10:14:55 [36mINFO: [39m Toolchain: {"build":"0.8.2","esbuild":"0.17.8","typescript":"4.9.5","typedoc":"0.23.25","eslint":"8.34.0"}
|
||||
2023-02-13 10:14:55 [36mINFO: [39m Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Clean: {"locations":["dist/*","types/*","typedoc/*"]}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1289,"outputBytes":361}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":569,"outputBytes":924}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":80,"inputBytes":672409,"outputBytes":318975}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":577,"outputBytes":928}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":80,"inputBytes":672413,"outputBytes":318979}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":665,"outputBytes":1876}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":80,"inputBytes":673361,"outputBytes":319090}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1375,"outputBytes":670}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":80,"inputBytes":672155,"outputBytes":317547}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/bundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":10,"inputBytes":1375,"outputBytes":1151306}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":80,"inputBytes":1822791,"outputBytes":1464790}
|
||||
2023-02-13 10:14:55 [35mSTATE:[39m Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":80,"inputBytes":1822791,"outputBytes":1931726}
|
||||
2023-02-13 10:15:00 [35mSTATE:[39m Typings: {"input":"src/human.ts","output":"types/lib","files":15}
|
||||
2023-02-13 10:15:02 [35mSTATE:[39m TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":81,"generated":true}
|
||||
2023-02-13 10:15:02 [35mSTATE:[39m Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6140,"outputBytes":2920}
|
||||
2023-02-13 10:15:02 [35mSTATE:[39m Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":17503,"outputBytes":9403}
|
||||
2023-02-13 10:15:12 [35mSTATE:[39m Lint: {"locations":["**/*.json","src/**/*.ts","test/**/*.js","demo/**/*.js","**/*.md"],"files":170,"errors":0,"warnings":0}
|
||||
2023-02-13 10:15:12 [35mSTATE:[39m ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
|
||||
2023-02-13 10:15:12 [35mSTATE:[39m Copy: {"input":"node_modules/@vladmandic/tfjs/types/tfjs-core.d.ts","output":"types/tfjs-core.d.ts"}
|
||||
2023-02-13 10:15:12 [36mINFO: [39m Done...
|
||||
2023-02-13 10:15:13 [35mSTATE:[39m Copy: {"input":"node_modules/@vladmandic/tfjs/types/tfjs.d.ts","output":"types/tfjs.esm.d.ts"}
|
||||
2023-02-13 10:15:13 [35mSTATE:[39m Copy: {"input":"src/types/tsconfig.json","output":"types/tsconfig.json"}
|
||||
2023-02-13 10:15:13 [35mSTATE:[39m Copy: {"input":"src/types/eslint.json","output":"types/.eslintrc.json"}
|
||||
2023-02-13 10:15:13 [35mSTATE:[39m Copy: {"input":"src/types/tfjs.esm.d.ts","output":"dist/tfjs.esm.d.ts"}
|
||||
2023-02-13 10:15:13 [35mSTATE:[39m Filter: {"input":"types/tfjs-core.d.ts"}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m API-Extractor: {"succeeeded":true,"errors":0,"warnings":210}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Filter: {"input":"types/human.d.ts"}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Write: {"output":"dist/human.esm-nobundle.d.ts"}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Write: {"output":"dist/human.esm.d.ts"}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Write: {"output":"dist/human.d.ts"}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Write: {"output":"dist/human.node-gpu.d.ts"}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Write: {"output":"dist/human.node.d.ts"}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Write: {"output":"dist/human.node-wasm.d.ts"}
|
||||
2023-02-13 10:15:14 [36mINFO: [39m Analyze models: {"folders":8,"result":"models/models.json"}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Models {"folder":"./models","models":12}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Models {"folder":"../human-models/models","models":44}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Models {"folder":"../blazepose/model/","models":4}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Models {"folder":"../anti-spoofing/model","models":1}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Models {"folder":"../efficientpose/models","models":3}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Models {"folder":"../insightface/models","models":5}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Models {"folder":"../movenet/models","models":3}
|
||||
2023-02-13 10:15:14 [35mSTATE:[39m Models {"folder":"../nanodet/models","models":4}
|
||||
2023-02-13 10:15:15 [35mSTATE:[39m Models: {"count":58,"totalSize":380063249}
|
||||
2023-02-13 10:15:15 [36mINFO: [39m Human Build complete... {"logFile":"test/build.log"}
|
||||
2023-02-22 06:42:38 [32mDATA: [39m Build {"name":"@vladmandic/human","version":"3.0.5"}
|
||||
2023-02-22 06:42:38 [36mINFO: [39m Application: {"name":"@vladmandic/human","version":"3.0.5"}
|
||||
2023-02-22 06:42:38 [36mINFO: [39m Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
|
||||
2023-02-22 06:42:38 [36mINFO: [39m Toolchain: {"build":"0.8.2","esbuild":"0.17.10","typescript":"4.9.5","typedoc":"0.23.25","eslint":"8.34.0"}
|
||||
2023-02-22 06:42:38 [36mINFO: [39m Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Clean: {"locations":["dist/*","types/*","typedoc/*"]}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1289,"outputBytes":361}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":569,"outputBytes":924}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":80,"inputBytes":672601,"outputBytes":319120}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":577,"outputBytes":928}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":80,"inputBytes":672605,"outputBytes":319124}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":665,"outputBytes":1876}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":80,"inputBytes":673553,"outputBytes":319235}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1375,"outputBytes":670}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":80,"inputBytes":672347,"outputBytes":317690}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/bundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":10,"inputBytes":1375,"outputBytes":1151306}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":80,"inputBytes":1822983,"outputBytes":1464928}
|
||||
2023-02-22 06:42:38 [35mSTATE:[39m Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":80,"inputBytes":1822983,"outputBytes":1931994}
|
||||
2023-02-22 06:42:42 [35mSTATE:[39m Typings: {"input":"src/human.ts","output":"types/lib","files":15}
|
||||
2023-02-22 06:42:45 [35mSTATE:[39m TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":81,"generated":true}
|
||||
2023-02-22 06:42:45 [35mSTATE:[39m Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6140,"outputBytes":2920}
|
||||
2023-02-22 06:42:45 [35mSTATE:[39m Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":17503,"outputBytes":9403}
|
||||
2023-02-22 06:42:54 [35mSTATE:[39m Lint: {"locations":["**/*.json","src/**/*.ts","test/**/*.js","demo/**/*.js","**/*.md"],"files":170,"errors":0,"warnings":0}
|
||||
2023-02-22 06:42:54 [35mSTATE:[39m ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
|
||||
2023-02-22 06:42:54 [35mSTATE:[39m Copy: {"input":"node_modules/@vladmandic/tfjs/types/tfjs-core.d.ts","output":"types/tfjs-core.d.ts"}
|
||||
2023-02-22 06:42:54 [36mINFO: [39m Done...
|
||||
2023-02-22 06:42:54 [35mSTATE:[39m Copy: {"input":"node_modules/@vladmandic/tfjs/types/tfjs.d.ts","output":"types/tfjs.esm.d.ts"}
|
||||
2023-02-22 06:42:54 [35mSTATE:[39m Copy: {"input":"src/types/tsconfig.json","output":"types/tsconfig.json"}
|
||||
2023-02-22 06:42:54 [35mSTATE:[39m Copy: {"input":"src/types/eslint.json","output":"types/.eslintrc.json"}
|
||||
2023-02-22 06:42:54 [35mSTATE:[39m Copy: {"input":"src/types/tfjs.esm.d.ts","output":"dist/tfjs.esm.d.ts"}
|
||||
2023-02-22 06:42:54 [35mSTATE:[39m Filter: {"input":"types/tfjs-core.d.ts"}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m API-Extractor: {"succeeeded":true,"errors":0,"warnings":210}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Filter: {"input":"types/human.d.ts"}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Write: {"output":"dist/human.esm-nobundle.d.ts"}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Write: {"output":"dist/human.esm.d.ts"}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Write: {"output":"dist/human.d.ts"}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Write: {"output":"dist/human.node-gpu.d.ts"}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Write: {"output":"dist/human.node.d.ts"}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Write: {"output":"dist/human.node-wasm.d.ts"}
|
||||
2023-02-22 06:42:55 [36mINFO: [39m Analyze models: {"folders":8,"result":"models/models.json"}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Models {"folder":"./models","models":12}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Models {"folder":"../human-models/models","models":44}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Models {"folder":"../blazepose/model/","models":4}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Models {"folder":"../anti-spoofing/model","models":1}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Models {"folder":"../efficientpose/models","models":3}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Models {"folder":"../insightface/models","models":5}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Models {"folder":"../movenet/models","models":3}
|
||||
2023-02-22 06:42:55 [35mSTATE:[39m Models {"folder":"../nanodet/models","models":4}
|
||||
2023-02-22 06:42:56 [35mSTATE:[39m Models: {"count":58,"totalSize":380063249}
|
||||
2023-02-22 06:42:56 [36mINFO: [39m Human Build complete... {"logFile":"test/build.log"}
|
||||
|
|
|
@ -54,7 +54,6 @@ async function main() {
|
|||
if (stat.isFile()) files.push(inputs);
|
||||
else if (stat.isDirectory()) fs.readdirSync(inputs).forEach((f) => files.push(path.join(inputs, f)));
|
||||
log('data', 'input:', files);
|
||||
await human.load();
|
||||
let res;
|
||||
for (const f of files) {
|
||||
const tensor = getImageTensor(f);
|
||||
|
@ -64,8 +63,10 @@ async function main() {
|
|||
human.config.face.description.enabled = true;
|
||||
human.config.face.gear.enabled = false;
|
||||
human.config.face.ssrnet.enabled = false;
|
||||
human.env.initial = true;
|
||||
await human.models.reset();
|
||||
await human.load();
|
||||
res = await human.detect(tensor);
|
||||
|
||||
msg = { model: 'faceres', image: f, res };
|
||||
if (res?.face?.[0].age > 20 && res?.face?.[0].age < 30) log('state', 'passed: gear', msg.model, msg.image);
|
||||
else log('error', 'failed: gear', msg);
|
||||
|
@ -74,6 +75,9 @@ async function main() {
|
|||
human.config.face.description.enabled = false;
|
||||
human.config.face.gear.enabled = true;
|
||||
human.config.face.ssrnet.enabled = false;
|
||||
human.env.initial = true;
|
||||
await human.models.reset();
|
||||
await human.load();
|
||||
res = await human.detect(tensor);
|
||||
msg = { model: 'gear', image: f, res };
|
||||
if (res?.face?.[0].age > 20 && res?.face?.[0].age < 30) log('state', 'passed: gear', msg.model, msg.image);
|
||||
|
@ -83,6 +87,21 @@ async function main() {
|
|||
human.config.face.description.enabled = false;
|
||||
human.config.face.gear.enabled = false;
|
||||
human.config.face.ssrnet.enabled = true;
|
||||
human.env.initial = true;
|
||||
await human.models.reset();
|
||||
await human.load();
|
||||
res = await human.detect(tensor);
|
||||
msg = { model: 'ssrnet', image: f, res };
|
||||
if (res?.face?.[0].age > 20 && res?.face?.[0].age < 30) log('state', 'passed: gear', msg.model, msg.image);
|
||||
else log('error', 'failed: gear', msg);
|
||||
printResult(msg);
|
||||
|
||||
human.config.face.description.enabled = false;
|
||||
human.config.face.gear.enabled = false;
|
||||
human.config.face.ssrnet = { enabled: true, modelPathAge: 'age.json', modelPathGender: 'gender-ssrnet-imdb.json' };
|
||||
human.env.initial = true;
|
||||
await human.models.reset();
|
||||
await human.load();
|
||||
res = await human.detect(tensor);
|
||||
msg = { model: 'ssrnet', image: f, res };
|
||||
if (res?.face?.[0].age > 20 && res?.face?.[0].age < 30) log('state', 'passed: gear', msg.model, msg.image);
|
||||
|
|
2009
test/test.log
2009
test/test.log
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue