new samples gallery and major code folder restructure
|
@ -9,11 +9,13 @@
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### **HEAD -> main** 2021/09/24 mandic00@live.com
|
||||||
|
|
||||||
|
- new release
|
||||||
|
|
||||||
### **2.2.3** 2021/09/24 mandic00@live.com
|
### **2.2.3** 2021/09/24 mandic00@live.com
|
||||||
|
|
||||||
|
- optimize model loading
|
||||||
### **origin/main** 2021/09/23 mandic00@live.com
|
|
||||||
|
|
||||||
- support segmentation for nodejs
|
- support segmentation for nodejs
|
||||||
- redo segmentation and handtracking
|
- redo segmentation and handtracking
|
||||||
- prototype handtracking
|
- prototype handtracking
|
||||||
|
|
61
README.md
|
@ -42,6 +42,7 @@ Check out [**Live Demo**](https://vladmandic.github.io/human/demo/index.html) ap
|
||||||
- [*Live:* **Face Extraction and 3D Rendering**](https://vladmandic.github.io/human/demo/face3d/index.html)
|
- [*Live:* **Face Extraction and 3D Rendering**](https://vladmandic.github.io/human/demo/face3d/index.html)
|
||||||
- [*Live:* **Multithreaded Detection Showcasing Maximum Performance**](https://vladmandic.github.io/human/demo/multithread/index.html)
|
- [*Live:* **Multithreaded Detection Showcasing Maximum Performance**](https://vladmandic.github.io/human/demo/multithread/index.html)
|
||||||
- [*Live:* **VR Model with Head, Face, Eye, Body and Hand tracking**](https://vladmandic.github.io/human-vrm/src/human-vrm.html)
|
- [*Live:* **VR Model with Head, Face, Eye, Body and Hand tracking**](https://vladmandic.github.io/human-vrm/src/human-vrm.html)
|
||||||
|
- [Examples galery](https://vladmandic.github.io/human/samples/samples.html)
|
||||||
|
|
||||||
## Project pages
|
## Project pages
|
||||||
|
|
||||||
|
@ -75,6 +76,7 @@ Check out [**Live Demo**](https://vladmandic.github.io/human/demo/index.html) ap
|
||||||
- [**Platform Support**](https://github.com/vladmandic/human/wiki/Platforms)
|
- [**Platform Support**](https://github.com/vladmandic/human/wiki/Platforms)
|
||||||
- [**Diagnostic and Performance trace information**](https://github.com/vladmandic/human/wiki/Diag)
|
- [**Diagnostic and Performance trace information**](https://github.com/vladmandic/human/wiki/Diag)
|
||||||
- [**List of Models & Credits**](https://github.com/vladmandic/human/wiki/Models)
|
- [**List of Models & Credits**](https://github.com/vladmandic/human/wiki/Models)
|
||||||
|
- [**Models Download Repository**](https://github.com/vladmandic/human-models)
|
||||||
- [**Security & Privacy Policy**](https://github.com/vladmandic/human/blob/main/SECURITY.md)
|
- [**Security & Privacy Policy**](https://github.com/vladmandic/human/blob/main/SECURITY.md)
|
||||||
- [**License & Usage Restrictions**](https://github.com/vladmandic/human/blob/main/LICENSE)
|
- [**License & Usage Restrictions**](https://github.com/vladmandic/human/blob/main/LICENSE)
|
||||||
|
|
||||||
|
@ -86,6 +88,15 @@ Check out [**Live Demo**](https://vladmandic.github.io/human/demo/index.html) ap
|
||||||
|
|
||||||
<hr><br>
|
<hr><br>
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
Visit [Examples galery](https://vladmandic.github.io/human/samples/samples.html) for more examples
|
||||||
|
<https://vladmandic.github.io/human/samples/samples.html>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
All options as presented in the demo application...
|
All options as presented in the demo application...
|
||||||
|
@ -95,52 +106,15 @@ All options as presented in the demo application...
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
## Examples
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
**Face Close-up:**
|
|
||||||

|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
**Face under a high angle:**
|
|
||||||

|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
**Full Person Details:**
|
|
||||||

|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
**Pose Detection:**
|
|
||||||

|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
**Body Segmentation and Background Replacement:**
|
|
||||||

|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
**Large Group:**
|
|
||||||

|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
**VR Model Tracking:**
|
|
||||||

|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
**Results Browser:**
|
**Results Browser:**
|
||||||
[ *Demo -> Display -> Show Results* ]<br>
|
[ *Demo -> Display -> Show Results* ]<br>
|
||||||

|

|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
**Face Similarity Matching:**
|
## Advanced Examples
|
||||||
|
|
||||||
|
1. **Face Similarity Matching:**
|
||||||
Extracts all faces from provided input images,
|
Extracts all faces from provided input images,
|
||||||
sorts them by similarity to selected face
|
sorts them by similarity to selected face
|
||||||
and optionally matches detected face with database of known people to guess their names
|
and optionally matches detected face with database of known people to guess their names
|
||||||
|
@ -150,13 +124,18 @@ and optionally matches detected face with database of known people to guess thei
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
**Face3D OpenGL Rendering:**
|
2. **Face3D OpenGL Rendering:**
|
||||||
> [demo/face3d](demo/face3d/index.html)
|
> [demo/face3d](demo/face3d/index.html)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
3. **VR Model Tracking:**
|
||||||
|

|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
**468-Point Face Mesh Defails:**
|
**468-Point Face Mesh Defails:**
|
||||||
(view in full resolution to see keypoints)
|
(view in full resolution to see keypoints)
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 297 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 369 KiB |
Before Width: | Height: | Size: 170 KiB |
Before Width: | Height: | Size: 74 KiB |
|
@ -12,7 +12,7 @@ const Human = require('../../dist/human.node.js'); // this is 'const Human = req
|
||||||
const config = { // just enable all and leave default settings
|
const config = { // just enable all and leave default settings
|
||||||
debug: false,
|
debug: false,
|
||||||
face: { enabled: true }, // includes mesh, iris, emotion, descriptor
|
face: { enabled: true }, // includes mesh, iris, emotion, descriptor
|
||||||
hand: { enabled: true },
|
hand: { enabled: true, maxDetected: 2, minConfidence: 0.5, detector: { modelPath: 'handtrack.json' } }, // use alternative hand model
|
||||||
body: { enabled: true },
|
body: { enabled: true },
|
||||||
object: { enabled: true },
|
object: { enabled: true },
|
||||||
gestures: { enabled: true },
|
gestures: { enabled: true },
|
||||||
|
|
|
@ -46,7 +46,7 @@ var __privateSet = (obj, member, value, setter) => {
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
// src/helpers.ts
|
// src/util.ts
|
||||||
function join(folder, file) {
|
function join(folder, file) {
|
||||||
const separator = folder.endsWith("/") ? "" : "/";
|
const separator = folder.endsWith("/") ? "" : "/";
|
||||||
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
|
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
|
||||||
|
@ -4495,11 +4495,11 @@ function process2(input, config3) {
|
||||||
let targetHeight = originalHeight;
|
let targetHeight = originalHeight;
|
||||||
if (targetWidth > maxSize) {
|
if (targetWidth > maxSize) {
|
||||||
targetWidth = maxSize;
|
targetWidth = maxSize;
|
||||||
targetHeight = targetWidth * originalHeight / originalWidth;
|
targetHeight = Math.trunc(targetWidth * originalHeight / originalWidth);
|
||||||
}
|
}
|
||||||
if (targetHeight > maxSize) {
|
if (targetHeight > maxSize) {
|
||||||
targetHeight = maxSize;
|
targetHeight = maxSize;
|
||||||
targetWidth = targetHeight * originalWidth / originalHeight;
|
targetWidth = Math.trunc(targetHeight * originalWidth / originalHeight);
|
||||||
}
|
}
|
||||||
if ((config3.filter.width || 0) > 0)
|
if ((config3.filter.width || 0) > 0)
|
||||||
targetWidth = config3.filter.width;
|
targetWidth = config3.filter.width;
|
||||||
|
@ -12483,13 +12483,6 @@ var Human = class {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
__publicField(this, "reset", () => {
|
|
||||||
const currentBackend = this.config.backend;
|
|
||||||
this.config = JSON.parse(JSON.stringify(config));
|
|
||||||
this.config.backend = currentBackend;
|
|
||||||
});
|
|
||||||
__publicField(this, "validate", (userConfig) => validate(config, userConfig || this.config));
|
|
||||||
__publicField(this, "image", (input) => process2(input, this.config));
|
|
||||||
__publicField(this, "emit", (event) => {
|
__publicField(this, "emit", (event) => {
|
||||||
var _a;
|
var _a;
|
||||||
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
||||||
|
@ -12505,7 +12498,6 @@ var Human = class {
|
||||||
Object.seal(this.config);
|
Object.seal(this.config);
|
||||||
if (userConfig)
|
if (userConfig)
|
||||||
this.config = mergeDeep(this.config, userConfig);
|
this.config = mergeDeep(this.config, userConfig);
|
||||||
validate(config, this.config);
|
|
||||||
this.tf = tfjs_esm_exports;
|
this.tf = tfjs_esm_exports;
|
||||||
this.state = "idle";
|
this.state = "idle";
|
||||||
__privateSet(this, _numTensors, 0);
|
__privateSet(this, _numTensors, 0);
|
||||||
|
@ -12532,6 +12524,17 @@ var Human = class {
|
||||||
this.gl = config2;
|
this.gl = config2;
|
||||||
this.emit("create");
|
this.emit("create");
|
||||||
}
|
}
|
||||||
|
reset() {
|
||||||
|
const currentBackend = this.config.backend;
|
||||||
|
this.config = JSON.parse(JSON.stringify(config));
|
||||||
|
this.config.backend = currentBackend;
|
||||||
|
}
|
||||||
|
validate(userConfig) {
|
||||||
|
return validate(config, userConfig || this.config);
|
||||||
|
}
|
||||||
|
image(input) {
|
||||||
|
return process2(input, this.config);
|
||||||
|
}
|
||||||
similarity(embedding1, embedding2) {
|
similarity(embedding1, embedding2) {
|
||||||
return similarity(embedding1, embedding2);
|
return similarity(embedding1, embedding2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ var __privateSet = (obj, member, value, setter) => {
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
// src/helpers.ts
|
// src/util.ts
|
||||||
function join(folder, file) {
|
function join(folder, file) {
|
||||||
const separator = folder.endsWith("/") ? "" : "/";
|
const separator = folder.endsWith("/") ? "" : "/";
|
||||||
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
|
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
|
||||||
|
@ -64563,11 +64563,11 @@ function process2(input2, config3) {
|
||||||
let targetHeight = originalHeight;
|
let targetHeight = originalHeight;
|
||||||
if (targetWidth > maxSize) {
|
if (targetWidth > maxSize) {
|
||||||
targetWidth = maxSize;
|
targetWidth = maxSize;
|
||||||
targetHeight = targetWidth * originalHeight / originalWidth;
|
targetHeight = Math.trunc(targetWidth * originalHeight / originalWidth);
|
||||||
}
|
}
|
||||||
if (targetHeight > maxSize) {
|
if (targetHeight > maxSize) {
|
||||||
targetHeight = maxSize;
|
targetHeight = maxSize;
|
||||||
targetWidth = targetHeight * originalWidth / originalHeight;
|
targetWidth = Math.trunc(targetHeight * originalWidth / originalHeight);
|
||||||
}
|
}
|
||||||
if ((config3.filter.width || 0) > 0)
|
if ((config3.filter.width || 0) > 0)
|
||||||
targetWidth = config3.filter.width;
|
targetWidth = config3.filter.width;
|
||||||
|
@ -72551,13 +72551,6 @@ var Human = class {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
__publicField(this, "reset", () => {
|
|
||||||
const currentBackend = this.config.backend;
|
|
||||||
this.config = JSON.parse(JSON.stringify(config));
|
|
||||||
this.config.backend = currentBackend;
|
|
||||||
});
|
|
||||||
__publicField(this, "validate", (userConfig) => validate(config, userConfig || this.config));
|
|
||||||
__publicField(this, "image", (input2) => process2(input2, this.config));
|
|
||||||
__publicField(this, "emit", (event) => {
|
__publicField(this, "emit", (event) => {
|
||||||
var _a;
|
var _a;
|
||||||
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
||||||
|
@ -72573,7 +72566,6 @@ var Human = class {
|
||||||
Object.seal(this.config);
|
Object.seal(this.config);
|
||||||
if (userConfig)
|
if (userConfig)
|
||||||
this.config = mergeDeep(this.config, userConfig);
|
this.config = mergeDeep(this.config, userConfig);
|
||||||
validate(config, this.config);
|
|
||||||
this.tf = tfjs_esm_exports;
|
this.tf = tfjs_esm_exports;
|
||||||
this.state = "idle";
|
this.state = "idle";
|
||||||
__privateSet(this, _numTensors, 0);
|
__privateSet(this, _numTensors, 0);
|
||||||
|
@ -72600,6 +72592,17 @@ var Human = class {
|
||||||
this.gl = config2;
|
this.gl = config2;
|
||||||
this.emit("create");
|
this.emit("create");
|
||||||
}
|
}
|
||||||
|
reset() {
|
||||||
|
const currentBackend = this.config.backend;
|
||||||
|
this.config = JSON.parse(JSON.stringify(config));
|
||||||
|
this.config.backend = currentBackend;
|
||||||
|
}
|
||||||
|
validate(userConfig) {
|
||||||
|
return validate(config, userConfig || this.config);
|
||||||
|
}
|
||||||
|
image(input2) {
|
||||||
|
return process2(input2, this.config);
|
||||||
|
}
|
||||||
similarity(embedding1, embedding2) {
|
similarity(embedding1, embedding2) {
|
||||||
return similarity(embedding1, embedding2);
|
return similarity(embedding1, embedding2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ __export(exports, {
|
||||||
env: () => env
|
env: () => env
|
||||||
});
|
});
|
||||||
|
|
||||||
// src/helpers.ts
|
// src/util.ts
|
||||||
function join(folder, file) {
|
function join(folder, file) {
|
||||||
const separator = folder.endsWith("/") ? "" : "/";
|
const separator = folder.endsWith("/") ? "" : "/";
|
||||||
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
|
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
|
||||||
|
@ -4527,11 +4527,11 @@ function process2(input, config3) {
|
||||||
let targetHeight = originalHeight;
|
let targetHeight = originalHeight;
|
||||||
if (targetWidth > maxSize) {
|
if (targetWidth > maxSize) {
|
||||||
targetWidth = maxSize;
|
targetWidth = maxSize;
|
||||||
targetHeight = targetWidth * originalHeight / originalWidth;
|
targetHeight = Math.trunc(targetWidth * originalHeight / originalWidth);
|
||||||
}
|
}
|
||||||
if (targetHeight > maxSize) {
|
if (targetHeight > maxSize) {
|
||||||
targetHeight = maxSize;
|
targetHeight = maxSize;
|
||||||
targetWidth = targetHeight * originalWidth / originalHeight;
|
targetWidth = Math.trunc(targetHeight * originalWidth / originalHeight);
|
||||||
}
|
}
|
||||||
if ((config3.filter.width || 0) > 0)
|
if ((config3.filter.width || 0) > 0)
|
||||||
targetWidth = config3.filter.width;
|
targetWidth = config3.filter.width;
|
||||||
|
@ -12548,13 +12548,6 @@ var Human = class {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
__publicField(this, "reset", () => {
|
|
||||||
const currentBackend = this.config.backend;
|
|
||||||
this.config = JSON.parse(JSON.stringify(config));
|
|
||||||
this.config.backend = currentBackend;
|
|
||||||
});
|
|
||||||
__publicField(this, "validate", (userConfig) => validate(config, userConfig || this.config));
|
|
||||||
__publicField(this, "image", (input) => process2(input, this.config));
|
|
||||||
__publicField(this, "emit", (event) => {
|
__publicField(this, "emit", (event) => {
|
||||||
var _a;
|
var _a;
|
||||||
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
||||||
|
@ -12570,7 +12563,6 @@ var Human = class {
|
||||||
Object.seal(this.config);
|
Object.seal(this.config);
|
||||||
if (userConfig)
|
if (userConfig)
|
||||||
this.config = mergeDeep(this.config, userConfig);
|
this.config = mergeDeep(this.config, userConfig);
|
||||||
validate(config, this.config);
|
|
||||||
this.tf = tf26;
|
this.tf = tf26;
|
||||||
this.state = "idle";
|
this.state = "idle";
|
||||||
__privateSet(this, _numTensors, 0);
|
__privateSet(this, _numTensors, 0);
|
||||||
|
@ -12597,6 +12589,17 @@ var Human = class {
|
||||||
this.gl = config2;
|
this.gl = config2;
|
||||||
this.emit("create");
|
this.emit("create");
|
||||||
}
|
}
|
||||||
|
reset() {
|
||||||
|
const currentBackend = this.config.backend;
|
||||||
|
this.config = JSON.parse(JSON.stringify(config));
|
||||||
|
this.config.backend = currentBackend;
|
||||||
|
}
|
||||||
|
validate(userConfig) {
|
||||||
|
return validate(config, userConfig || this.config);
|
||||||
|
}
|
||||||
|
image(input) {
|
||||||
|
return process2(input, this.config);
|
||||||
|
}
|
||||||
similarity(embedding1, embedding2) {
|
similarity(embedding1, embedding2) {
|
||||||
return similarity(embedding1, embedding2);
|
return similarity(embedding1, embedding2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ __export(exports, {
|
||||||
env: () => env
|
env: () => env
|
||||||
});
|
});
|
||||||
|
|
||||||
// src/helpers.ts
|
// src/util.ts
|
||||||
function join(folder, file) {
|
function join(folder, file) {
|
||||||
const separator = folder.endsWith("/") ? "" : "/";
|
const separator = folder.endsWith("/") ? "" : "/";
|
||||||
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
|
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
|
||||||
|
@ -4528,11 +4528,11 @@ function process2(input, config3) {
|
||||||
let targetHeight = originalHeight;
|
let targetHeight = originalHeight;
|
||||||
if (targetWidth > maxSize) {
|
if (targetWidth > maxSize) {
|
||||||
targetWidth = maxSize;
|
targetWidth = maxSize;
|
||||||
targetHeight = targetWidth * originalHeight / originalWidth;
|
targetHeight = Math.trunc(targetWidth * originalHeight / originalWidth);
|
||||||
}
|
}
|
||||||
if (targetHeight > maxSize) {
|
if (targetHeight > maxSize) {
|
||||||
targetHeight = maxSize;
|
targetHeight = maxSize;
|
||||||
targetWidth = targetHeight * originalWidth / originalHeight;
|
targetWidth = Math.trunc(targetHeight * originalWidth / originalHeight);
|
||||||
}
|
}
|
||||||
if ((config3.filter.width || 0) > 0)
|
if ((config3.filter.width || 0) > 0)
|
||||||
targetWidth = config3.filter.width;
|
targetWidth = config3.filter.width;
|
||||||
|
@ -12549,13 +12549,6 @@ var Human = class {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
__publicField(this, "reset", () => {
|
|
||||||
const currentBackend = this.config.backend;
|
|
||||||
this.config = JSON.parse(JSON.stringify(config));
|
|
||||||
this.config.backend = currentBackend;
|
|
||||||
});
|
|
||||||
__publicField(this, "validate", (userConfig) => validate(config, userConfig || this.config));
|
|
||||||
__publicField(this, "image", (input) => process2(input, this.config));
|
|
||||||
__publicField(this, "emit", (event) => {
|
__publicField(this, "emit", (event) => {
|
||||||
var _a;
|
var _a;
|
||||||
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
||||||
|
@ -12571,7 +12564,6 @@ var Human = class {
|
||||||
Object.seal(this.config);
|
Object.seal(this.config);
|
||||||
if (userConfig)
|
if (userConfig)
|
||||||
this.config = mergeDeep(this.config, userConfig);
|
this.config = mergeDeep(this.config, userConfig);
|
||||||
validate(config, this.config);
|
|
||||||
this.tf = tf26;
|
this.tf = tf26;
|
||||||
this.state = "idle";
|
this.state = "idle";
|
||||||
__privateSet(this, _numTensors, 0);
|
__privateSet(this, _numTensors, 0);
|
||||||
|
@ -12598,6 +12590,17 @@ var Human = class {
|
||||||
this.gl = config2;
|
this.gl = config2;
|
||||||
this.emit("create");
|
this.emit("create");
|
||||||
}
|
}
|
||||||
|
reset() {
|
||||||
|
const currentBackend = this.config.backend;
|
||||||
|
this.config = JSON.parse(JSON.stringify(config));
|
||||||
|
this.config.backend = currentBackend;
|
||||||
|
}
|
||||||
|
validate(userConfig) {
|
||||||
|
return validate(config, userConfig || this.config);
|
||||||
|
}
|
||||||
|
image(input) {
|
||||||
|
return process2(input, this.config);
|
||||||
|
}
|
||||||
similarity(embedding1, embedding2) {
|
similarity(embedding1, embedding2) {
|
||||||
return similarity(embedding1, embedding2);
|
return similarity(embedding1, embedding2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ __export(exports, {
|
||||||
env: () => env
|
env: () => env
|
||||||
});
|
});
|
||||||
|
|
||||||
// src/helpers.ts
|
// src/util.ts
|
||||||
function join(folder, file) {
|
function join(folder, file) {
|
||||||
const separator = folder.endsWith("/") ? "" : "/";
|
const separator = folder.endsWith("/") ? "" : "/";
|
||||||
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
|
const skipJoin = file.startsWith(".") || file.startsWith("/") || file.startsWith("http:") || file.startsWith("https:") || file.startsWith("file:");
|
||||||
|
@ -4527,11 +4527,11 @@ function process2(input, config3) {
|
||||||
let targetHeight = originalHeight;
|
let targetHeight = originalHeight;
|
||||||
if (targetWidth > maxSize) {
|
if (targetWidth > maxSize) {
|
||||||
targetWidth = maxSize;
|
targetWidth = maxSize;
|
||||||
targetHeight = targetWidth * originalHeight / originalWidth;
|
targetHeight = Math.trunc(targetWidth * originalHeight / originalWidth);
|
||||||
}
|
}
|
||||||
if (targetHeight > maxSize) {
|
if (targetHeight > maxSize) {
|
||||||
targetHeight = maxSize;
|
targetHeight = maxSize;
|
||||||
targetWidth = targetHeight * originalWidth / originalHeight;
|
targetWidth = Math.trunc(targetHeight * originalWidth / originalHeight);
|
||||||
}
|
}
|
||||||
if ((config3.filter.width || 0) > 0)
|
if ((config3.filter.width || 0) > 0)
|
||||||
targetWidth = config3.filter.width;
|
targetWidth = config3.filter.width;
|
||||||
|
@ -12548,13 +12548,6 @@ var Human = class {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
__publicField(this, "reset", () => {
|
|
||||||
const currentBackend = this.config.backend;
|
|
||||||
this.config = JSON.parse(JSON.stringify(config));
|
|
||||||
this.config.backend = currentBackend;
|
|
||||||
});
|
|
||||||
__publicField(this, "validate", (userConfig) => validate(config, userConfig || this.config));
|
|
||||||
__publicField(this, "image", (input) => process2(input, this.config));
|
|
||||||
__publicField(this, "emit", (event) => {
|
__publicField(this, "emit", (event) => {
|
||||||
var _a;
|
var _a;
|
||||||
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
return (_a = this.events) == null ? void 0 : _a.dispatchEvent(new Event(event));
|
||||||
|
@ -12570,7 +12563,6 @@ var Human = class {
|
||||||
Object.seal(this.config);
|
Object.seal(this.config);
|
||||||
if (userConfig)
|
if (userConfig)
|
||||||
this.config = mergeDeep(this.config, userConfig);
|
this.config = mergeDeep(this.config, userConfig);
|
||||||
validate(config, this.config);
|
|
||||||
this.tf = tf26;
|
this.tf = tf26;
|
||||||
this.state = "idle";
|
this.state = "idle";
|
||||||
__privateSet(this, _numTensors, 0);
|
__privateSet(this, _numTensors, 0);
|
||||||
|
@ -12597,6 +12589,17 @@ var Human = class {
|
||||||
this.gl = config2;
|
this.gl = config2;
|
||||||
this.emit("create");
|
this.emit("create");
|
||||||
}
|
}
|
||||||
|
reset() {
|
||||||
|
const currentBackend = this.config.backend;
|
||||||
|
this.config = JSON.parse(JSON.stringify(config));
|
||||||
|
this.config.backend = currentBackend;
|
||||||
|
}
|
||||||
|
validate(userConfig) {
|
||||||
|
return validate(config, userConfig || this.config);
|
||||||
|
}
|
||||||
|
image(input) {
|
||||||
|
return process2(input, this.config);
|
||||||
|
}
|
||||||
similarity(embedding1, embedding2) {
|
similarity(embedding1, embedding2) {
|
||||||
return similarity(embedding1, embedding2);
|
return similarity(embedding1, embedding2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,14 +66,14 @@
|
||||||
"@tensorflow/tfjs-layers": "^3.9.0",
|
"@tensorflow/tfjs-layers": "^3.9.0",
|
||||||
"@tensorflow/tfjs-node": "^3.9.0",
|
"@tensorflow/tfjs-node": "^3.9.0",
|
||||||
"@tensorflow/tfjs-node-gpu": "^3.9.0",
|
"@tensorflow/tfjs-node-gpu": "^3.9.0",
|
||||||
"@types/node": "^16.9.6",
|
"@types/node": "^16.10.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.31.2",
|
"@typescript-eslint/eslint-plugin": "^4.31.2",
|
||||||
"@typescript-eslint/parser": "^4.31.2",
|
"@typescript-eslint/parser": "^4.31.2",
|
||||||
"@vladmandic/build": "^0.5.3",
|
"@vladmandic/build": "^0.5.3",
|
||||||
"@vladmandic/pilogger": "^0.3.3",
|
"@vladmandic/pilogger": "^0.3.3",
|
||||||
"canvas": "^2.8.0",
|
"canvas": "^2.8.0",
|
||||||
"dayjs": "^1.10.7",
|
"dayjs": "^1.10.7",
|
||||||
"esbuild": "^0.13.0",
|
"esbuild": "^0.13.2",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-config-airbnb-base": "^14.2.1",
|
"eslint-config-airbnb-base": "^14.2.1",
|
||||||
"eslint-plugin-import": "^2.24.2",
|
"eslint-plugin-import": "^2.24.2",
|
||||||
|
|
|
@ -2,3 +2,11 @@
|
||||||
|
|
||||||
Sample Images used by `Human` library demos and automated tests
|
Sample Images used by `Human` library demos and automated tests
|
||||||
Not required for normal funcioning of library
|
Not required for normal funcioning of library
|
||||||
|
|
||||||
|
Samples were generated using default configuration without any fine-tuning using command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
node test/test-node-canvas.js samples/in/ samples/out/
|
||||||
|
```
|
||||||
|
|
||||||
|
Samples galery viewer: <https://vladmandic.github.io/human/samples/samples.html>
|
||||||
|
|
Before Width: | Height: | Size: 238 KiB |
Before Width: | Height: | Size: 198 KiB |
Before Width: | Height: | Size: 352 KiB |
Before Width: | Height: | Size: 141 KiB |
Before Width: | Height: | Size: 178 KiB |
Before Width: | Height: | Size: 162 KiB |
Before Width: | Height: | Size: 270 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 621 KiB After Width: | Height: | Size: 621 KiB |
Before Width: | Height: | Size: 645 KiB After Width: | Height: | Size: 645 KiB |
Before Width: | Height: | Size: 601 KiB After Width: | Height: | Size: 601 KiB |
Before Width: | Height: | Size: 574 KiB After Width: | Height: | Size: 574 KiB |
Before Width: | Height: | Size: 601 KiB After Width: | Height: | Size: 601 KiB |
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 171 KiB |
Before Width: | Height: | Size: 215 KiB After Width: | Height: | Size: 215 KiB |
Before Width: | Height: | Size: 181 KiB After Width: | Height: | Size: 181 KiB |
Before Width: | Height: | Size: 544 KiB After Width: | Height: | Size: 544 KiB |
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 213 KiB After Width: | Height: | Size: 213 KiB |
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 204 KiB |
Before Width: | Height: | Size: 209 KiB After Width: | Height: | Size: 209 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 153 KiB |
Before Width: | Height: | Size: 756 KiB After Width: | Height: | Size: 756 KiB |
Before Width: | Height: | Size: 220 KiB After Width: | Height: | Size: 220 KiB |
Before Width: | Height: | Size: 535 KiB After Width: | Height: | Size: 535 KiB |
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
Before Width: | Height: | Size: 181 KiB After Width: | Height: | Size: 181 KiB |
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
Before Width: | Height: | Size: 681 KiB After Width: | Height: | Size: 681 KiB |
Before Width: | Height: | Size: 343 KiB After Width: | Height: | Size: 343 KiB |
Before Width: | Height: | Size: 157 KiB After Width: | Height: | Size: 157 KiB |
Before Width: | Height: | Size: 157 KiB After Width: | Height: | Size: 157 KiB |
Before Width: | Height: | Size: 256 KiB After Width: | Height: | Size: 256 KiB |
Before Width: | Height: | Size: 312 KiB After Width: | Height: | Size: 312 KiB |
Before Width: | Height: | Size: 578 KiB After Width: | Height: | Size: 578 KiB |
Before Width: | Height: | Size: 411 KiB After Width: | Height: | Size: 411 KiB |
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 167 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 381 KiB After Width: | Height: | Size: 381 KiB |
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
Before Width: | Height: | Size: 295 KiB After Width: | Height: | Size: 295 KiB |
Before Width: | Height: | Size: 359 KiB After Width: | Height: | Size: 359 KiB |
Before Width: | Height: | Size: 464 KiB After Width: | Height: | Size: 464 KiB |
Before Width: | Height: | Size: 216 KiB After Width: | Height: | Size: 216 KiB |
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 206 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 237 KiB |
After Width: | Height: | Size: 260 KiB |
After Width: | Height: | Size: 248 KiB |
After Width: | Height: | Size: 235 KiB |
After Width: | Height: | Size: 240 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 87 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 61 KiB |