mirror of https://github.com/vladmandic/human
fix for human.draw labels and typedefs
parent
d4188518db
commit
669e6e7c00
|
@ -9,8 +9,9 @@
|
|||
|
||||
## Changelog
|
||||
|
||||
### **HEAD -> main** 2021/10/19 mandic00@live.com
|
||||
### **HEAD -> main** 2021/10/21 mandic00@live.com
|
||||
|
||||
- add human.custom.esm using custom tfjs build
|
||||
|
||||
### **2.3.5** 2021/10/19 mandic00@live.com
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ const drawOptions = {
|
|||
drawBoxes: true,
|
||||
drawGaze: true,
|
||||
drawLabels: true,
|
||||
drawGestures: true,
|
||||
drawPolygons: true,
|
||||
drawPoints: false,
|
||||
fillPolygons: false,
|
||||
|
|
|
@ -80930,6 +80930,7 @@ var options2 = {
|
|||
drawPoints: false,
|
||||
drawLabels: true,
|
||||
drawBoxes: true,
|
||||
drawGestures: true,
|
||||
drawPolygons: true,
|
||||
drawGaze: true,
|
||||
fillPolygons: false,
|
||||
|
@ -81034,6 +81035,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
if (!result || !inCanvas2)
|
||||
return;
|
||||
if (localOptions.drawGestures) {
|
||||
const ctx = getCanvasContext(inCanvas2);
|
||||
ctx.font = localOptions.font;
|
||||
ctx.fillStyle = localOptions.color;
|
||||
|
@ -81055,6 +81057,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
async function face(inCanvas2, result, drawOptions) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
|
@ -81067,6 +81070,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.color;
|
||||
if (localOptions.drawBoxes)
|
||||
rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);
|
||||
if (localOptions.drawLabels) {
|
||||
const labels2 = [];
|
||||
labels2.push(`face: ${Math.trunc(100 * f.score)}%`);
|
||||
if (f.genderScore)
|
||||
|
@ -81076,7 +81080,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
if (f.iris)
|
||||
labels2.push(`distance: ${f.iris}`);
|
||||
if (f.real)
|
||||
labels2.push(`Real: ${Math.trunc(100 * f.real)}%`);
|
||||
labels2.push(`real: ${Math.trunc(100 * f.real)}%`);
|
||||
if (f.emotion && f.emotion.length > 0) {
|
||||
const emotion3 = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);
|
||||
if (emotion3.length > 3)
|
||||
|
@ -81102,6 +81106,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.labelColor;
|
||||
ctx.fillText(labels2[i], x + 4, y + 15);
|
||||
}
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
if (f.mesh && f.mesh.length > 0) {
|
||||
if (localOptions.drawPoints) {
|
||||
|
@ -81500,31 +81505,31 @@ var detectFace = async (parent, input2) => {
|
|||
const rotation = calculateFaceAngle(faces[i], [input2.shape[2], input2.shape[1]]);
|
||||
parent.analyze("Start Emotion:");
|
||||
if (parent.config.async) {
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:emotion";
|
||||
timeStamp = now();
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.emotion = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Emotion:");
|
||||
parent.analyze("Start AntiSpoof:");
|
||||
if (parent.config.async) {
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:antispoof";
|
||||
timeStamp = now();
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.antispoof = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End AntiSpoof:");
|
||||
parent.analyze("Start Description:");
|
||||
if (parent.config.async) {
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:description";
|
||||
timeStamp = now();
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.embedding = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Description:");
|
||||
|
@ -81544,10 +81549,10 @@ var detectFace = async (parent, input2) => {
|
|||
faceRes.push({
|
||||
...faces[i],
|
||||
id: i,
|
||||
age: descRes.age,
|
||||
gender: descRes.gender,
|
||||
genderScore: descRes.genderScore,
|
||||
embedding: descRes.descriptor,
|
||||
age: descRes == null ? void 0 : descRes.age,
|
||||
gender: descRes == null ? void 0 : descRes.gender,
|
||||
genderScore: descRes == null ? void 0 : descRes.genderScore,
|
||||
embedding: descRes == null ? void 0 : descRes.descriptor,
|
||||
emotion: emotionRes,
|
||||
real: antispoofRes,
|
||||
iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -10878,6 +10878,7 @@ var options2 = {
|
|||
drawPoints: false,
|
||||
drawLabels: true,
|
||||
drawBoxes: true,
|
||||
drawGestures: true,
|
||||
drawPolygons: true,
|
||||
drawGaze: true,
|
||||
fillPolygons: false,
|
||||
|
@ -10982,6 +10983,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
if (!result || !inCanvas2)
|
||||
return;
|
||||
if (localOptions.drawGestures) {
|
||||
const ctx = getCanvasContext(inCanvas2);
|
||||
ctx.font = localOptions.font;
|
||||
ctx.fillStyle = localOptions.color;
|
||||
|
@ -11003,6 +11005,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
async function face(inCanvas2, result, drawOptions) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
|
@ -11015,6 +11018,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.color;
|
||||
if (localOptions.drawBoxes)
|
||||
rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);
|
||||
if (localOptions.drawLabels) {
|
||||
const labels2 = [];
|
||||
labels2.push(`face: ${Math.trunc(100 * f.score)}%`);
|
||||
if (f.genderScore)
|
||||
|
@ -11024,7 +11028,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
if (f.iris)
|
||||
labels2.push(`distance: ${f.iris}`);
|
||||
if (f.real)
|
||||
labels2.push(`Real: ${Math.trunc(100 * f.real)}%`);
|
||||
labels2.push(`real: ${Math.trunc(100 * f.real)}%`);
|
||||
if (f.emotion && f.emotion.length > 0) {
|
||||
const emotion3 = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);
|
||||
if (emotion3.length > 3)
|
||||
|
@ -11050,6 +11054,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.labelColor;
|
||||
ctx.fillText(labels2[i], x + 4, y + 15);
|
||||
}
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
if (f.mesh && f.mesh.length > 0) {
|
||||
if (localOptions.drawPoints) {
|
||||
|
@ -11448,31 +11453,31 @@ var detectFace = async (parent, input) => {
|
|||
const rotation = calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]);
|
||||
parent.analyze("Start Emotion:");
|
||||
if (parent.config.async) {
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:emotion";
|
||||
timeStamp = now();
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.emotion = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Emotion:");
|
||||
parent.analyze("Start AntiSpoof:");
|
||||
if (parent.config.async) {
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:antispoof";
|
||||
timeStamp = now();
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.antispoof = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End AntiSpoof:");
|
||||
parent.analyze("Start Description:");
|
||||
if (parent.config.async) {
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:description";
|
||||
timeStamp = now();
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tfjs_esm_exports.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.embedding = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Description:");
|
||||
|
@ -11492,10 +11497,10 @@ var detectFace = async (parent, input) => {
|
|||
faceRes.push({
|
||||
...faces[i],
|
||||
id: i,
|
||||
age: descRes.age,
|
||||
gender: descRes.gender,
|
||||
genderScore: descRes.genderScore,
|
||||
embedding: descRes.descriptor,
|
||||
age: descRes == null ? void 0 : descRes.age,
|
||||
gender: descRes == null ? void 0 : descRes.gender,
|
||||
genderScore: descRes == null ? void 0 : descRes.genderScore,
|
||||
embedding: descRes == null ? void 0 : descRes.descriptor,
|
||||
emotion: emotionRes,
|
||||
real: antispoofRes,
|
||||
iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -78360,6 +78360,7 @@ var options2 = {
|
|||
drawPoints: false,
|
||||
drawLabels: true,
|
||||
drawBoxes: true,
|
||||
drawGestures: true,
|
||||
drawPolygons: true,
|
||||
drawGaze: true,
|
||||
fillPolygons: false,
|
||||
|
@ -78464,6 +78465,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
if (!result || !inCanvas2)
|
||||
return;
|
||||
if (localOptions.drawGestures) {
|
||||
const ctx = getCanvasContext(inCanvas2);
|
||||
ctx.font = localOptions.font;
|
||||
ctx.fillStyle = localOptions.color;
|
||||
|
@ -78485,6 +78487,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
async function face(inCanvas2, result, drawOptions) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
|
@ -78497,6 +78500,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.color;
|
||||
if (localOptions.drawBoxes)
|
||||
rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);
|
||||
if (localOptions.drawLabels) {
|
||||
const labels2 = [];
|
||||
labels2.push(`face: ${Math.trunc(100 * f.score)}%`);
|
||||
if (f.genderScore)
|
||||
|
@ -78506,7 +78510,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
if (f.iris)
|
||||
labels2.push(`distance: ${f.iris}`);
|
||||
if (f.real)
|
||||
labels2.push(`Real: ${Math.trunc(100 * f.real)}%`);
|
||||
labels2.push(`real: ${Math.trunc(100 * f.real)}%`);
|
||||
if (f.emotion && f.emotion.length > 0) {
|
||||
const emotion3 = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);
|
||||
if (emotion3.length > 3)
|
||||
|
@ -78532,6 +78536,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.labelColor;
|
||||
ctx.fillText(labels2[i], x + 4, y + 15);
|
||||
}
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
if (f.mesh && f.mesh.length > 0) {
|
||||
if (localOptions.drawPoints) {
|
||||
|
@ -78930,31 +78935,31 @@ var detectFace = async (parent, input2) => {
|
|||
const rotation = calculateFaceAngle(faces[i], [input2.shape[2], input2.shape[1]]);
|
||||
parent.analyze("Start Emotion:");
|
||||
if (parent.config.async) {
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:emotion";
|
||||
timeStamp = now();
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.emotion = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Emotion:");
|
||||
parent.analyze("Start AntiSpoof:");
|
||||
if (parent.config.async) {
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:antispoof";
|
||||
timeStamp = now();
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.antispoof = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End AntiSpoof:");
|
||||
parent.analyze("Start Description:");
|
||||
if (parent.config.async) {
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:description";
|
||||
timeStamp = now();
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.embedding = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Description:");
|
||||
|
@ -78974,10 +78979,10 @@ var detectFace = async (parent, input2) => {
|
|||
faceRes.push({
|
||||
...faces[i],
|
||||
id: i,
|
||||
age: descRes.age,
|
||||
gender: descRes.gender,
|
||||
genderScore: descRes.genderScore,
|
||||
embedding: descRes.descriptor,
|
||||
age: descRes == null ? void 0 : descRes.age,
|
||||
gender: descRes == null ? void 0 : descRes.gender,
|
||||
genderScore: descRes == null ? void 0 : descRes.genderScore,
|
||||
embedding: descRes == null ? void 0 : descRes.descriptor,
|
||||
emotion: emotionRes,
|
||||
real: antispoofRes,
|
||||
iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0,
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -10937,6 +10937,7 @@ var options2 = {
|
|||
drawPoints: false,
|
||||
drawLabels: true,
|
||||
drawBoxes: true,
|
||||
drawGestures: true,
|
||||
drawPolygons: true,
|
||||
drawGaze: true,
|
||||
fillPolygons: false,
|
||||
|
@ -11041,6 +11042,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
if (!result || !inCanvas2)
|
||||
return;
|
||||
if (localOptions.drawGestures) {
|
||||
const ctx = getCanvasContext(inCanvas2);
|
||||
ctx.font = localOptions.font;
|
||||
ctx.fillStyle = localOptions.color;
|
||||
|
@ -11062,6 +11064,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
async function face(inCanvas2, result, drawOptions) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
|
@ -11074,6 +11077,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.color;
|
||||
if (localOptions.drawBoxes)
|
||||
rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);
|
||||
if (localOptions.drawLabels) {
|
||||
const labels2 = [];
|
||||
labels2.push(`face: ${Math.trunc(100 * f.score)}%`);
|
||||
if (f.genderScore)
|
||||
|
@ -11083,7 +11087,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
if (f.iris)
|
||||
labels2.push(`distance: ${f.iris}`);
|
||||
if (f.real)
|
||||
labels2.push(`Real: ${Math.trunc(100 * f.real)}%`);
|
||||
labels2.push(`real: ${Math.trunc(100 * f.real)}%`);
|
||||
if (f.emotion && f.emotion.length > 0) {
|
||||
const emotion3 = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);
|
||||
if (emotion3.length > 3)
|
||||
|
@ -11109,6 +11113,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.labelColor;
|
||||
ctx.fillText(labels2[i], x + 4, y + 15);
|
||||
}
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
if (f.mesh && f.mesh.length > 0) {
|
||||
if (localOptions.drawPoints) {
|
||||
|
@ -11510,31 +11515,31 @@ var detectFace = async (parent, input) => {
|
|||
const rotation = calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]);
|
||||
parent.analyze("Start Emotion:");
|
||||
if (parent.config.async) {
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:emotion";
|
||||
timeStamp = now();
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.emotion = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Emotion:");
|
||||
parent.analyze("Start AntiSpoof:");
|
||||
if (parent.config.async) {
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:antispoof";
|
||||
timeStamp = now();
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.antispoof = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End AntiSpoof:");
|
||||
parent.analyze("Start Description:");
|
||||
if (parent.config.async) {
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:description";
|
||||
timeStamp = now();
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.embedding = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Description:");
|
||||
|
@ -11554,10 +11559,10 @@ var detectFace = async (parent, input) => {
|
|||
faceRes.push({
|
||||
...faces[i],
|
||||
id: i,
|
||||
age: descRes.age,
|
||||
gender: descRes.gender,
|
||||
genderScore: descRes.genderScore,
|
||||
embedding: descRes.descriptor,
|
||||
age: descRes == null ? void 0 : descRes.age,
|
||||
gender: descRes == null ? void 0 : descRes.gender,
|
||||
genderScore: descRes == null ? void 0 : descRes.genderScore,
|
||||
embedding: descRes == null ? void 0 : descRes.descriptor,
|
||||
emotion: emotionRes,
|
||||
real: antispoofRes,
|
||||
iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0,
|
||||
|
|
|
@ -10938,6 +10938,7 @@ var options2 = {
|
|||
drawPoints: false,
|
||||
drawLabels: true,
|
||||
drawBoxes: true,
|
||||
drawGestures: true,
|
||||
drawPolygons: true,
|
||||
drawGaze: true,
|
||||
fillPolygons: false,
|
||||
|
@ -11042,6 +11043,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
if (!result || !inCanvas2)
|
||||
return;
|
||||
if (localOptions.drawGestures) {
|
||||
const ctx = getCanvasContext(inCanvas2);
|
||||
ctx.font = localOptions.font;
|
||||
ctx.fillStyle = localOptions.color;
|
||||
|
@ -11063,6 +11065,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
async function face(inCanvas2, result, drawOptions) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
|
@ -11075,6 +11078,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.color;
|
||||
if (localOptions.drawBoxes)
|
||||
rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);
|
||||
if (localOptions.drawLabels) {
|
||||
const labels2 = [];
|
||||
labels2.push(`face: ${Math.trunc(100 * f.score)}%`);
|
||||
if (f.genderScore)
|
||||
|
@ -11084,7 +11088,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
if (f.iris)
|
||||
labels2.push(`distance: ${f.iris}`);
|
||||
if (f.real)
|
||||
labels2.push(`Real: ${Math.trunc(100 * f.real)}%`);
|
||||
labels2.push(`real: ${Math.trunc(100 * f.real)}%`);
|
||||
if (f.emotion && f.emotion.length > 0) {
|
||||
const emotion3 = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);
|
||||
if (emotion3.length > 3)
|
||||
|
@ -11110,6 +11114,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.labelColor;
|
||||
ctx.fillText(labels2[i], x + 4, y + 15);
|
||||
}
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
if (f.mesh && f.mesh.length > 0) {
|
||||
if (localOptions.drawPoints) {
|
||||
|
@ -11511,31 +11516,31 @@ var detectFace = async (parent, input) => {
|
|||
const rotation = calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]);
|
||||
parent.analyze("Start Emotion:");
|
||||
if (parent.config.async) {
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:emotion";
|
||||
timeStamp = now();
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.emotion = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Emotion:");
|
||||
parent.analyze("Start AntiSpoof:");
|
||||
if (parent.config.async) {
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:antispoof";
|
||||
timeStamp = now();
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.antispoof = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End AntiSpoof:");
|
||||
parent.analyze("Start Description:");
|
||||
if (parent.config.async) {
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:description";
|
||||
timeStamp = now();
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.embedding = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Description:");
|
||||
|
@ -11555,10 +11560,10 @@ var detectFace = async (parent, input) => {
|
|||
faceRes.push({
|
||||
...faces[i],
|
||||
id: i,
|
||||
age: descRes.age,
|
||||
gender: descRes.gender,
|
||||
genderScore: descRes.genderScore,
|
||||
embedding: descRes.descriptor,
|
||||
age: descRes == null ? void 0 : descRes.age,
|
||||
gender: descRes == null ? void 0 : descRes.gender,
|
||||
genderScore: descRes == null ? void 0 : descRes.genderScore,
|
||||
embedding: descRes == null ? void 0 : descRes.descriptor,
|
||||
emotion: emotionRes,
|
||||
real: antispoofRes,
|
||||
iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0,
|
||||
|
|
|
@ -10937,6 +10937,7 @@ var options2 = {
|
|||
drawPoints: false,
|
||||
drawLabels: true,
|
||||
drawBoxes: true,
|
||||
drawGestures: true,
|
||||
drawPolygons: true,
|
||||
drawGaze: true,
|
||||
fillPolygons: false,
|
||||
|
@ -11041,6 +11042,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
if (!result || !inCanvas2)
|
||||
return;
|
||||
if (localOptions.drawGestures) {
|
||||
const ctx = getCanvasContext(inCanvas2);
|
||||
ctx.font = localOptions.font;
|
||||
ctx.fillStyle = localOptions.color;
|
||||
|
@ -11062,6 +11064,7 @@ async function gesture(inCanvas2, result, drawOptions) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
async function face(inCanvas2, result, drawOptions) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
const localOptions = mergeDeep(options2, drawOptions);
|
||||
|
@ -11074,6 +11077,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.color;
|
||||
if (localOptions.drawBoxes)
|
||||
rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);
|
||||
if (localOptions.drawLabels) {
|
||||
const labels2 = [];
|
||||
labels2.push(`face: ${Math.trunc(100 * f.score)}%`);
|
||||
if (f.genderScore)
|
||||
|
@ -11083,7 +11087,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
if (f.iris)
|
||||
labels2.push(`distance: ${f.iris}`);
|
||||
if (f.real)
|
||||
labels2.push(`Real: ${Math.trunc(100 * f.real)}%`);
|
||||
labels2.push(`real: ${Math.trunc(100 * f.real)}%`);
|
||||
if (f.emotion && f.emotion.length > 0) {
|
||||
const emotion3 = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);
|
||||
if (emotion3.length > 3)
|
||||
|
@ -11109,6 +11113,7 @@ async function face(inCanvas2, result, drawOptions) {
|
|||
ctx.fillStyle = localOptions.labelColor;
|
||||
ctx.fillText(labels2[i], x + 4, y + 15);
|
||||
}
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
if (f.mesh && f.mesh.length > 0) {
|
||||
if (localOptions.drawPoints) {
|
||||
|
@ -11510,31 +11515,31 @@ var detectFace = async (parent, input) => {
|
|||
const rotation = calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]);
|
||||
parent.analyze("Start Emotion:");
|
||||
if (parent.config.async) {
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:emotion";
|
||||
timeStamp = now();
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? await predict5(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.emotion = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Emotion:");
|
||||
parent.analyze("Start AntiSpoof:");
|
||||
if (parent.config.async) {
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:antispoof";
|
||||
timeStamp = now();
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await predict(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.antispoof = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End AntiSpoof:");
|
||||
parent.analyze("Start Description:");
|
||||
if (parent.config.async) {
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = "run:description";
|
||||
timeStamp = now();
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? await predict7(faces[i].tensor || tf26.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.embedding = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze("End Description:");
|
||||
|
@ -11554,10 +11559,10 @@ var detectFace = async (parent, input) => {
|
|||
faceRes.push({
|
||||
...faces[i],
|
||||
id: i,
|
||||
age: descRes.age,
|
||||
gender: descRes.gender,
|
||||
genderScore: descRes.genderScore,
|
||||
embedding: descRes.descriptor,
|
||||
age: descRes == null ? void 0 : descRes.age,
|
||||
gender: descRes == null ? void 0 : descRes.gender,
|
||||
genderScore: descRes == null ? void 0 : descRes.genderScore,
|
||||
embedding: descRes == null ? void 0 : descRes.descriptor,
|
||||
emotion: emotionRes,
|
||||
real: antispoofRes,
|
||||
iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0,
|
||||
|
|
|
@ -48,11 +48,11 @@ export const detectFace = async (parent /* instance of human */, input: Tensor):
|
|||
// run emotion, inherits face from blazeface
|
||||
parent.analyze('Start Emotion:');
|
||||
if (parent.config.async) {
|
||||
emotionRes = parent.config.face.emotion.enabled ? emotion.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? emotion.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = 'run:emotion';
|
||||
timeStamp = now();
|
||||
emotionRes = parent.config.face.emotion.enabled ? await emotion.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
|
||||
emotionRes = parent.config.face.emotion.enabled ? await emotion.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.emotion = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze('End Emotion:');
|
||||
|
@ -60,11 +60,11 @@ export const detectFace = async (parent /* instance of human */, input: Tensor):
|
|||
// run antispoof, inherits face from blazeface
|
||||
parent.analyze('Start AntiSpoof:');
|
||||
if (parent.config.async) {
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? antispoof.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? antispoof.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = 'run:antispoof';
|
||||
timeStamp = now();
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await antispoof.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : {};
|
||||
antispoofRes = parent.config.face.antispoof.enabled ? await antispoof.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.antispoof = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze('End AntiSpoof:');
|
||||
|
@ -86,11 +86,11 @@ export const detectFace = async (parent /* instance of human */, input: Tensor):
|
|||
// run emotion, inherits face from blazeface
|
||||
parent.analyze('Start Description:');
|
||||
if (parent.config.async) {
|
||||
descRes = parent.config.face.description.enabled ? faceres.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? faceres.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
|
||||
} else {
|
||||
parent.state = 'run:description';
|
||||
timeStamp = now();
|
||||
descRes = parent.config.face.description.enabled ? await faceres.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : [];
|
||||
descRes = parent.config.face.description.enabled ? await faceres.predict(faces[i].tensor || tf.tensor([]), parent.config, i, faces.length) : null;
|
||||
parent.performance.embedding = Math.trunc(now() - timeStamp);
|
||||
}
|
||||
parent.analyze('End Description:');
|
||||
|
@ -124,10 +124,10 @@ export const detectFace = async (parent /* instance of human */, input: Tensor):
|
|||
faceRes.push({
|
||||
...faces[i],
|
||||
id: i,
|
||||
age: descRes.age,
|
||||
gender: descRes.gender,
|
||||
genderScore: descRes.genderScore,
|
||||
embedding: descRes.descriptor,
|
||||
age: descRes?.age,
|
||||
gender: descRes?.gender,
|
||||
genderScore: descRes?.genderScore,
|
||||
embedding: descRes?.descriptor,
|
||||
emotion: emotionRes,
|
||||
real: antispoofRes,
|
||||
iris: irisSize !== 0 ? Math.trunc(500 / irisSize / 11.7) / 100 : 0,
|
||||
|
|
|
@ -135,7 +135,7 @@ export class Human {
|
|||
* - canvas: draw processed canvas which is a processed copy of the input
|
||||
* - all: meta-function that performs: canvas, face, body, hand
|
||||
*/
|
||||
draw: { canvas, face, body, hand, gesture, object, person, all, options: DrawOptions };
|
||||
draw: { canvas: typeof draw.canvas, face: typeof draw.face, body: typeof draw.body, hand: typeof draw.hand, gesture: typeof draw.gesture, object: typeof draw.object, person: typeof draw.person, all: typeof draw.all, options: DrawOptions };
|
||||
|
||||
/** Currently loaded models
|
||||
* @internal
|
||||
|
|
|
@ -37,6 +37,7 @@ export interface DrawOptions {
|
|||
roundRect: number,
|
||||
drawPoints: boolean,
|
||||
drawLabels: boolean,
|
||||
drawGestures: boolean,
|
||||
drawBoxes: boolean,
|
||||
drawPolygons: boolean,
|
||||
drawGaze: boolean,
|
||||
|
@ -58,6 +59,7 @@ export const options: DrawOptions = {
|
|||
drawPoints: <boolean>false,
|
||||
drawLabels: <boolean>true,
|
||||
drawBoxes: <boolean>true,
|
||||
drawGestures: <boolean>true,
|
||||
drawPolygons: <boolean>true,
|
||||
drawGaze: <boolean>true,
|
||||
fillPolygons: <boolean>false,
|
||||
|
@ -166,6 +168,7 @@ function arrow(ctx: CanvasRenderingContext2D, from: Point, to: Point, radius = 5
|
|||
export async function gesture(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array<GestureResult>, drawOptions?: Partial<DrawOptions>) {
|
||||
const localOptions = mergeDeep(options, drawOptions);
|
||||
if (!result || !inCanvas) return;
|
||||
if (localOptions.drawGestures) {
|
||||
const ctx = getCanvasContext(inCanvas);
|
||||
ctx.font = localOptions.font;
|
||||
ctx.fillStyle = localOptions.color;
|
||||
|
@ -187,6 +190,7 @@ export async function gesture(inCanvas: HTMLCanvasElement | OffscreenCanvas, res
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function face(inCanvas: HTMLCanvasElement | OffscreenCanvas, result: Array<FaceResult>, drawOptions?: Partial<DrawOptions>) {
|
||||
const localOptions = mergeDeep(options, drawOptions);
|
||||
|
@ -197,13 +201,14 @@ export async function face(inCanvas: HTMLCanvasElement | OffscreenCanvas, result
|
|||
ctx.strokeStyle = localOptions.color;
|
||||
ctx.fillStyle = localOptions.color;
|
||||
if (localOptions.drawBoxes) rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);
|
||||
if (localOptions.drawLabels) {
|
||||
// silly hack since fillText does not suport new line
|
||||
const labels:string[] = [];
|
||||
labels.push(`face: ${Math.trunc(100 * f.score)}%`);
|
||||
if (f.genderScore) labels.push(`${f.gender || ''} ${Math.trunc(100 * f.genderScore)}%`);
|
||||
if (f.age) labels.push(`age: ${f.age || ''}`);
|
||||
if (f.iris) labels.push(`distance: ${f.iris}`);
|
||||
if (f.real) labels.push(`Real: ${Math.trunc(100 * f.real)}%`);
|
||||
if (f.real) labels.push(`real: ${Math.trunc(100 * f.real)}%`);
|
||||
if (f.emotion && f.emotion.length > 0) {
|
||||
const emotion = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);
|
||||
if (emotion.length > 3) emotion.length = 3;
|
||||
|
@ -225,6 +230,7 @@ export async function face(inCanvas: HTMLCanvasElement | OffscreenCanvas, result
|
|||
ctx.fillStyle = localOptions.labelColor;
|
||||
ctx.fillText(labels[i], x + 4, y + 15);
|
||||
}
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
if (f.mesh && f.mesh.length > 0) {
|
||||
if (localOptions.drawPoints) {
|
||||
|
|
2755
test/build.log
2755
test/build.log
File diff suppressed because it is too large
Load Diff
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
|
@ -1,9 +1,11 @@
|
|||
/**
|
||||
* Human main module
|
||||
*/
|
||||
import { Env } from './util/env';
|
||||
import * as tf from '../dist/tfjs.esm.js';
|
||||
import * as env from './util/env';
|
||||
import * as draw from './util/draw';
|
||||
import * as facemesh from './face/facemesh';
|
||||
import * as image from './image/image';
|
||||
import * as match from './face/match';
|
||||
import * as models from './models';
|
||||
import type { Result } from './result';
|
||||
|
@ -88,7 +90,7 @@ export declare class Human {
|
|||
*/
|
||||
tf: TensorFlow;
|
||||
/** Object containing environment information used for diagnostics */
|
||||
env: env.Env;
|
||||
env: Env;
|
||||
/** Draw helper classes that can draw detected objects on canvas using specified draw
|
||||
* - options: {@link DrawOptions} global settings for all draw operations, can be overriden for each draw method
|
||||
* - face: draw detected faces
|
||||
|
@ -98,14 +100,14 @@ export declare class Human {
|
|||
* - all: meta-function that performs: canvas, face, body, hand
|
||||
*/
|
||||
draw: {
|
||||
canvas: any;
|
||||
face: any;
|
||||
body: any;
|
||||
hand: any;
|
||||
gesture: any;
|
||||
object: any;
|
||||
person: any;
|
||||
all: any;
|
||||
canvas: typeof draw.canvas;
|
||||
face: typeof draw.face;
|
||||
body: typeof draw.body;
|
||||
hand: typeof draw.hand;
|
||||
gesture: typeof draw.gesture;
|
||||
object: typeof draw.object;
|
||||
person: typeof draw.person;
|
||||
all: typeof draw.all;
|
||||
options: DrawOptions;
|
||||
};
|
||||
/** Currently loaded models
|
||||
|
@ -162,7 +164,7 @@ export declare class Human {
|
|||
*/
|
||||
image(input: Input, getTensor?: boolean): {
|
||||
tensor: Tensor<import("@tensorflow/tfjs-core").Rank> | null;
|
||||
canvas: HTMLCanvasElement | OffscreenCanvas | null;
|
||||
canvas: image.AnyCanvas | null;
|
||||
};
|
||||
/** Segmentation method takes any input and returns processed canvas with body segmentation
|
||||
* - Optional parameter background is used to fill the background with specific input
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"human.d.ts","sourceRoot":"","sources":["../../src/human.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAO1C,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAElC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAQ5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AASnC,OAAO,KAAK,EAAE,MAAM,EAAiF,MAAM,UAAU,CAAC;AACtH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,kEAAkE;AAClE,cAAc,UAAU,CAAC;AAEzB,6DAA6D;AAC7D,cAAc,UAAU,CAAC;AAEzB,yDAAyD;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,2CAA2C;AAC3C,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,+BAA+B;AAC/B,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,4DAA4D;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,+DAA+D;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;;;;;;;GAOG;AACH,oBAAY,MAAM,GAAG,QAAQ,GAAG,MAAM,GA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C,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIrC;;;;;;OAMG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B;;;;;MAKE;IACI,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCvD,cAAc;IACd,IAAI,UAAW,MAAM,UAEnB;IAEF;;;;;OAKG;IACH,IAAI,CAAC,MAAM,GAAE,MAAoB,GAAG,MAAM;IAI1C;;;;;MAKE;IACI,MAAM,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG;QAAE,KAAK,MAAA;KAAE,CAAC;IAIvE;;;;;;;;;MASE;IACI,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC;CAkKlF;AAED,oCAAoC;AACpC,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,CAAC"}
|
|
@ -5,11 +5,12 @@ import type { Tensor } from '../tfjs/types';
|
|||
import type { Config } from '../config';
|
||||
import { env } from '../util/env';
|
||||
export declare type Input = Tensor | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas | typeof Image | typeof env.Canvas;
|
||||
export declare function canvas(width: any, height: any): HTMLCanvasElement | OffscreenCanvas;
|
||||
export declare function copy(input: HTMLCanvasElement | OffscreenCanvas, output?: HTMLCanvasElement | OffscreenCanvas): HTMLCanvasElement | OffscreenCanvas;
|
||||
export declare type AnyCanvas = HTMLCanvasElement | OffscreenCanvas;
|
||||
export declare function canvas(width: any, height: any): AnyCanvas;
|
||||
export declare function copy(input: AnyCanvas, output?: AnyCanvas): AnyCanvas;
|
||||
export declare function process(input: Input, config: Config, getTensor?: boolean): {
|
||||
tensor: Tensor | null;
|
||||
canvas: OffscreenCanvas | HTMLCanvasElement | null;
|
||||
canvas: AnyCanvas | null;
|
||||
};
|
||||
export declare function skip(config: any, input: Tensor): Promise<boolean>;
|
||||
//# sourceMappingURL=image.d.ts.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/image/image.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,oBAAY,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,eAAe,GAAG,OAAO,KAAK,GAAG,OAAO,GAAG,CAAC,MAAM,CAAC;AAUvL,wBAAgB,MAAM,CAAC,KAAK,KAAA,EAAE,MAAM,KAAA,GAAG,iBAAiB,GAAG,eAAe,CAkBzE;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,eAAe,EAAE,MAAM,CAAC,EAAE,iBAAiB,GAAG,eAAe,uCAK5G;AAKD,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAE,OAAc,GAAG;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB,GAAG,IAAI,CAAA;CAAE,CA8J9J;AAkCD,wBAAsB,IAAI,CAAC,MAAM,KAAA,EAAE,KAAK,EAAE,MAAM,oBAY/C"}
|
||||
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/image/image.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,oBAAY,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,eAAe,GAAG,OAAO,KAAK,GAAG,OAAO,GAAG,CAAC,MAAM,CAAC;AACvL,oBAAY,SAAS,GAAG,iBAAiB,GAAG,eAAe,CAAC;AAU5D,wBAAgB,MAAM,CAAC,KAAK,KAAA,EAAE,MAAM,KAAA,GAAG,SAAS,CAkB/C;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,SAAS,aAKxD;AAKD,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAE,OAAc,GAAG;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAA;CAAE,CA8JpI;AAkCD,wBAAsB,IAAI,CAAC,MAAM,KAAA,EAAE,KAAK,EAAE,MAAM,oBAY/C"}
|
|
@ -8,7 +8,6 @@
|
|||
* @property {function} add add specified filter to filter chain
|
||||
* @property {function} apply execute filter chain and draw result
|
||||
* @property {function} draw just draw input to result
|
||||
* @param {HTMLCanvasElement | OffscreenCanvas} canvas use specific canvas for all webgl bindings
|
||||
*/
|
||||
export declare function GLImageFilter(params?: {}): void;
|
||||
export declare function GLImageFilter(): void;
|
||||
//# sourceMappingURL=imagefx.d.ts.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"imagefx.d.ts","sourceRoot":"","sources":["../../../src/image/imagefx.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA4CH;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,KAAK,QAkWxC"}
|
||||
{"version":3,"file":"imagefx.d.ts","sourceRoot":"","sources":["../../../src/image/imagefx.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6CH;;;;;;GAMG;AAEH,wBAAgB,aAAa,SAkW5B"}
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../../src/tfjs/backend.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAOpD,wBAAsB,KAAK,CAAC,QAAQ,KAAA,EAAE,KAAK,UAAQ,oBAqGlD;AAGD,wBAAgB,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,KAAA,QAazD"}
|
||||
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../../src/tfjs/backend.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAOpD,wBAAsB,KAAK,CAAC,QAAQ,KAAA,EAAE,KAAK,UAAQ,oBAoGlD;AAGD,wBAAgB,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,KAAA,QAazD"}
|
|
@ -33,6 +33,7 @@ export interface DrawOptions {
|
|||
roundRect: number;
|
||||
drawPoints: boolean;
|
||||
drawLabels: boolean;
|
||||
drawGestures: boolean;
|
||||
drawBoxes: boolean;
|
||||
drawPolygons: boolean;
|
||||
drawGaze: boolean;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../../src/util/draw.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAS,MAAM,WAAW,CAAC;AAE9H;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SA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AE,OAAO,CAAC,WAAW,CAAC,kDAc1H"}
|
|
@ -1,20 +1,21 @@
|
|||
export declare type Env = {
|
||||
/** Env class that holds detected capabilities */
|
||||
export declare class Env {
|
||||
/** Running in Browser */
|
||||
browser: undefined | boolean;
|
||||
browser: boolean;
|
||||
/** Running in NodeJS */
|
||||
node: undefined | boolean;
|
||||
node: boolean;
|
||||
/** Running in WebWorker thread */
|
||||
worker: undefined | boolean;
|
||||
worker: boolean;
|
||||
/** Detected platform */
|
||||
platform: undefined | string;
|
||||
platform: string;
|
||||
/** Detected agent */
|
||||
agent: undefined | string;
|
||||
agent: string;
|
||||
/** List of supported backends */
|
||||
backends: string[];
|
||||
/** Has any work been performed so far */
|
||||
initial: boolean;
|
||||
/** Are image filters supported? */
|
||||
filter: undefined | boolean;
|
||||
filter: boolean | undefined;
|
||||
/** TFJS instance details */
|
||||
tfjs: {
|
||||
version: undefined | string;
|
||||
|
@ -41,6 +42,11 @@ export declare type Env = {
|
|||
backend: undefined | boolean;
|
||||
adapter: undefined | string;
|
||||
};
|
||||
/** CPU info */
|
||||
cpu: {
|
||||
model: undefined | string;
|
||||
flags: string[];
|
||||
};
|
||||
/** List of supported kernels for current backend */
|
||||
kernels: string[];
|
||||
/** MonkeyPatch for Canvas */
|
||||
|
@ -49,10 +55,9 @@ export declare type Env = {
|
|||
Image: undefined;
|
||||
/** MonkeyPatch for ImageData */
|
||||
ImageData: undefined;
|
||||
};
|
||||
export declare let env: Env;
|
||||
export declare function cpuInfo(): Promise<void>;
|
||||
export declare function backendInfo(): Promise<void>;
|
||||
export declare function get(): Promise<void>;
|
||||
export declare function set(obj: any): Promise<void>;
|
||||
constructor();
|
||||
updateBackend(): Promise<void>;
|
||||
updateCPU(): Promise<void>;
|
||||
}
|
||||
export declare const env: Env;
|
||||
//# sourceMappingURL=env.d.ts.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/util/env.ts"],"names":[],"mappings":"AAIA,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