start 2.5 major version

pull/356/head
Vladimir Mandic 2021-10-30 12:21:54 -04:00
parent f3411437a0
commit da7f4300b2
13 changed files with 27 additions and 51 deletions

View File

@ -112,13 +112,13 @@
"external": ["@tensorflow", "fs", "os", "buffer", "util"]
},
{
"name": "tfjs/browser/esm/bundle",
"name": "tfjs/browser/esm/custom",
"platform": "browser",
"target": "esnext",
"format": "esm",
"input": "tfjs/tf-browser.ts",
"input": "tfjs/tf-custom.ts",
"output": "dist/tfjs.esm.js",
"minify": false,
"sourcemap": true,
"sourcemap": false,
"external": ["fs", "os", "buffer", "util"]
},
{
@ -134,31 +134,10 @@
{
"name": "human/browser/esm/bundle",
"platform": "browser",
"target": "esnext",
"format": "esm",
"input": "src/human.ts",
"output": "dist/human.esm.js",
"minify": true,
"sourcemap": true,
"external": ["fs", "os", "buffer", "util"]
},
{
"name": "tfjs/browser/esm/custom",
"platform": "browser",
"target": "esnext",
"format": "esm",
"input": "tfjs/tf-custom.ts",
"output": "dist/tfjs.esm.js",
"sourcemap": false,
"external": ["fs", "os", "buffer", "util"]
},
{
"name": "human/browser/esm/custom",
"platform": "browser",
"target": "esnext",
"format": "esm",
"input": "src/human.ts",
"output": "dist/human.custom.esm.js",
"sourcemap": true,
"minify": false,
"external": ["fs", "os", "buffer", "util"],
@ -174,7 +153,7 @@
"output": "demo/typescript/index.js",
"sourcemap": true,
"minify": false,
"external": ["*/human.custom.esm.js"]
"external": ["*/human.esm.js"]
}
]
},

View File

@ -4,5 +4,3 @@ samples
typedoc
test
wiki
dist/tfjs.esm.js
dist/tfjs.esm.js.map

View File

@ -9,8 +9,9 @@
## Changelog
### **HEAD -> main** 2021/10/28 mandic00@live.com
### **HEAD -> main** 2021/10/29 mandic00@live.com
- fix firefox bug
### **2.4.3** 2021/10/28 mandic00@live.com

View File

@ -6,7 +6,7 @@
*/
/** @type {Human} */
import Human from '../../dist/human.custom.esm.js';
import Human from '../../dist/human.esm.js';
const userConfig = {
backend: 'wasm',

View File

@ -11,21 +11,21 @@ let records = 0;
const descLength = 1024; // descriptor length in bytes
function distance(descBuffer, index, options = { order: 2 }) {
function distance(descBuffer, index, options = { order: 2, multiplier: 20 }) {
const descriptor = new Float32Array(descBuffer);
let sum = 0;
for (let i = 0; i < descriptor.length; i++) {
const diff = (options.order === 2) ? (descriptor[i] - view[index * descLength + i]) : (Math.abs(descriptor[i] - view[index * descLength + i]));
sum += (options.order === 2) ? (diff * diff) : (diff ** options.order);
}
return sum;
return (options.multiplier || 20) * sum;
}
function match(descBuffer, options = { order: 2 }) {
function match(descBuffer, options = { order: 2, multiplier: 20 }) {
let best = Number.MAX_SAFE_INTEGER;
let index = -1;
for (let i = 0; i < records; i++) {
const res = distance(descBuffer, i, { order: options.order });
const res = distance(descBuffer, i, { order: options.order, multiplier: options.multiplier });
if (res < best) {
best = res;
index = i;

View File

@ -5,19 +5,19 @@ const threads = require('worker_threads');
// global optinos
const options = {
dbFile: './faces.json', // sample face db
dbFile: 'demo/facematch/faces.json', // sample face db
dbMax: 10000, // maximum number of records to hold in memory
threadPoolSize: 6, // number of worker threads to create in thread pool
threadPoolSize: 12, // number of worker threads to create in thread pool
workerSrc: './node-match-worker.js', // code that executes in the worker thread
debug: false, // verbose messages
minThreshold: 0.9, // match returns first record that meets the similarity threshold, set to 0 to always scan all records
minThreshold: 0.5, // match returns first record that meets the similarity threshold, set to 0 to always scan all records
descLength: 1024, // descriptor length
};
// test options
const testOptions = {
dbFact: 100, // load db n times to fake huge size
maxJobs: 100, // exit after processing this many jobs
dbFact: 175, // load db n times to fake huge size
maxJobs: 200, // exit after processing this many jobs
fuzDescriptors: true, // randomize descriptor content before match for harder jobs
};

View File

@ -5,7 +5,7 @@
*
*/
import Human from '../../dist/human.custom.esm.js'; // equivalent of @vladmandic/human
import Human from '../../dist/human.esm.js'; // equivalent of @vladmandic/human
import GLBench from '../helpers/gl-bench.js';
const workerJS = './worker.js';

View File

@ -5,7 +5,7 @@
*/
// demo/typescript/index.ts
import Human from "../../dist/human.custom.esm.js";
import Human from "../../dist/human.esm.js";
var config = {
modelBasePath: "../../models",
backend: "humangl",

View File

@ -7,7 +7,7 @@
* @license MIT
*/
import Human from '../../dist/human.custom.esm.js'; // equivalent of @vladmandic/human
import Human from '../../dist/human.esm.js'; // equivalent of @vladmandic/human
const config = {
modelBasePath: '../../models',

View File

@ -1,6 +1,6 @@
{
"name": "@vladmandic/human",
"version": "2.4.3",
"version": "2.5.0",
"description": "Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gesture Recognition",
"sideEffects": false,
"main": "dist/human.node.js",
@ -73,7 +73,7 @@
"@vladmandic/pilogger": "^0.3.3",
"canvas": "^2.8.0",
"dayjs": "^1.10.7",
"esbuild": "^0.13.10",
"esbuild": "^0.13.11",
"eslint": "8.1.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-html": "^6.2.0",
@ -81,7 +81,6 @@
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.1",
"long": "4.0.0",
"node-fetch": "^3.0.0",
"rimraf": "^3.0.2",
"seedrandom": "^3.0.5",

View File

@ -13,8 +13,7 @@ export { Tensor } from '@tensorflow/tfjs-core/dist/index';
export { GraphModel } from '@tensorflow/tfjs-converter/dist/index';
/** Tensorflow Long type
* @external
* @external long
*/
// eslint-disable-next-line node/no-missing-import
export { Long } from 'long';
// import Long from 'long';
// export { Long };

View File

@ -26,7 +26,7 @@
<div id="state" class="state"></div>
<canvas id="canvas" class="canvas" width=256 height=256></canvas>
<script type="module">
import Human from '../dist/human.custom.esm.js';
import Human from '../dist/human.esm.js';
const config = {
async: true,

View File

@ -13,7 +13,7 @@
"allowUnusedLabels": false,
"alwaysStrict": true,
"declaration": true,
"declarationMap": true,
"declarationMap": false,
"emitDecoratorMetadata": true,
"esModuleInterop": false,
"exactOptionalPropertyTypes": true,