Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 1fa29b0

Browse files
committed
update tfjs and rebuild
1 parent 472f2e4 commit 1fa29b0

File tree

198 files changed

+1781
-1660
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+1781
-1660
lines changed

CHANGELOG.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @vladmandic/face-api
22

3-
Version: **1.7.11**
3+
Version: **1.7.12**
44
Description: **FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS**
55

66
Author: **Vladimir Mandic <mandic00@live.com>**
@@ -9,10 +9,13 @@
99

1010
## Changelog
1111

12-
### **1.7.11** 2023/05/08 mandic00@live.com
12+
### **1.7.12** 2023/06/12 mandic00@live.com
13+
1314

15+
### **origin/master** 2023/05/08 mandic00@live.com
1416

15-
### **origin/master** 2023/03/21 mandic00@live.com
17+
18+
### **1.7.11** 2023/05/08 mandic00@live.com
1619

1720

1821
### **1.7.10** 2023/03/21 mandic00@live.com

demo/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function faces(name, title, id, data) {
3535
canvas.style.top = `${img.offsetTop}px`;
3636
canvas.width = img.width;
3737
canvas.height = img.height;
38-
const ctx = canvas.getContext('2d');
38+
const ctx = canvas.getContext('2d', { willReadFrequently: true });
3939
if (!ctx) return;
4040
// draw title
4141
ctx.font = '1rem sans-serif';
@@ -94,7 +94,7 @@ async function image(url) {
9494
const canvas = document.createElement('canvas');
9595
canvas.height = img.height;
9696
canvas.width = img.width;
97-
const ctx = canvas.getContext('2d');
97+
const ctx = canvas.getContext('2d', { willReadFrequently: true });
9898
if (ctx) ctx.drawImage(img, 0, 0, img.width, img.height);
9999
// return generated canvas to be used by tfjs during detection
100100
resolve(canvas);

demo/webcam.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function log(...txt) {
3030

3131
// helper function to draw detected faces
3232
function drawFaces(canvas, data, fps) {
33-
const ctx = canvas.getContext('2d');
33+
const ctx = canvas.getContext('2d', { willReadFrequently: true });
3434
if (!ctx) return;
3535
ctx.clearRect(0, 0, canvas.width, canvas.height);
3636
// draw title

dist/face-api.esm-nobundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/face-api.esm.js

+315-307
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/face-api.esm.js.map

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/face-api.js

+315-307
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/face-api.node-gpu.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/face-api.node-wasm.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/face-api.node.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tfjs.esm.js

+270-262
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tfjs.version.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
author: <https://github.com/vladmandic>'
55
*/
66

7-
var e="4.5.0";var s="4.5.0";var t="4.5.0";var n="4.5.0";var i="4.5.0";var w={tfjs:e,"tfjs-core":e,"tfjs-converter":s,"tfjs-backend-cpu":t,"tfjs-backend-webgl":n,"tfjs-backend-wasm":i};export{w as version};
7+
var e="4.7.0";var s="4.7.0";var t="4.7.0";var n="4.7.0";var i="4.7.0";var w={tfjs:e,"tfjs-core":e,"tfjs-converter":s,"tfjs-backend-cpu":t,"tfjs-backend-webgl":n,"tfjs-backend-wasm":i};export{w as version};

src/dom/getContext2dOrThrow.ts

+4-15
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,10 @@ import { resolveInput } from './resolveInput';
33

44
export function getContext2dOrThrow(canvasArg: string | HTMLCanvasElement | CanvasRenderingContext2D): CanvasRenderingContext2D {
55
const { Canvas, CanvasRenderingContext2D } = env.getEnv();
6-
7-
if (canvasArg instanceof CanvasRenderingContext2D) {
8-
return canvasArg;
9-
}
10-
6+
if (canvasArg instanceof CanvasRenderingContext2D) return canvasArg;
117
const canvas = resolveInput(canvasArg);
12-
13-
if (!(canvas instanceof Canvas)) {
14-
throw new Error('resolveContext2d - expected canvas to be of instance of Canvas');
15-
}
16-
17-
const ctx = canvas.getContext('2d');
18-
if (!ctx) {
19-
throw new Error('resolveContext2d - canvas 2d context is null');
20-
}
21-
8+
if (!(canvas instanceof Canvas)) throw new Error('resolveContext2d - expected canvas to be of instance of Canvas');
9+
const ctx = canvas.getContext('2d', { willReadFrequently: true });
10+
if (!ctx) throw new Error('resolveContext2d - canvas 2d context is null');
2211
return ctx;
2312
}

typedoc/classes/AgeGenderNet.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>AgeGenderNet | @vladmandic/face-api - v1.7.11</title><meta name="description" content="Documentation for @vladmandic/face-api - v1.7.11"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
1+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>AgeGenderNet | @vladmandic/face-api - v1.7.12</title><meta name="description" content="Documentation for @vladmandic/face-api - v1.7.12"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
22
<div class="tsd-toolbar-contents container">
33
<div class="table-cell" id="tsd-search" data-base="..">
44
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
55
<div class="field">
66
<div id="tsd-toolbar-links"></div></div>
77
<ul class="results">
88
<li class="state loading">Preparing search index...</li>
9-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@vladmandic/face-api - v1.7.11</a></div>
9+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@vladmandic/face-api - v1.7.12</a></div>
1010
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
1111
<div class="container container-main">
1212
<div class="col-8 col-content">
1313
<div class="tsd-page-title">
1414
<ul class="tsd-breadcrumb">
15-
<li><a href="../index.html">@vladmandic/face-api - v1.7.11</a></li>
15+
<li><a href="../index.html">@vladmandic/face-api - v1.7.12</a></li>
1616
<li><a href="AgeGenderNet.html">AgeGenderNet</a></li></ul>
1717
<h1>Class AgeGenderNet</h1></div>
1818
<section class="tsd-panel tsd-hierarchy">
@@ -396,7 +396,7 @@ <h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option
396396
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
397397
<div class="tsd-accordion-details">
398398
<ul>
399-
<li><a href="../index.html">@vladmandic/face-<wbr/>api -<wbr/> v1.7.11</a>
399+
<li><a href="../index.html">@vladmandic/face-<wbr/>api -<wbr/> v1.7.12</a>
400400
<ul>
401401
<li class="tsd-kind-namespace"><a href="../modules/draw.html">draw</a></li>
402402
<li class="tsd-kind-namespace"><a href="../modules/utils.html">utils</a></li></ul></li></ul></div></details></nav>

typedoc/classes/BoundingBox.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BoundingBox | @vladmandic/face-api - v1.7.11</title><meta name="description" content="Documentation for @vladmandic/face-api - v1.7.11"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
1+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BoundingBox | @vladmandic/face-api - v1.7.12</title><meta name="description" content="Documentation for @vladmandic/face-api - v1.7.12"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
22
<div class="tsd-toolbar-contents container">
33
<div class="table-cell" id="tsd-search" data-base="..">
44
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
55
<div class="field">
66
<div id="tsd-toolbar-links"></div></div>
77
<ul class="results">
88
<li class="state loading">Preparing search index...</li>
9-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@vladmandic/face-api - v1.7.11</a></div>
9+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@vladmandic/face-api - v1.7.12</a></div>
1010
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
1111
<div class="container container-main">
1212
<div class="col-8 col-content">
1313
<div class="tsd-page-title">
1414
<ul class="tsd-breadcrumb">
15-
<li><a href="../index.html">@vladmandic/face-api - v1.7.11</a></li>
15+
<li><a href="../index.html">@vladmandic/face-api - v1.7.12</a></li>
1616
<li><a href="BoundingBox.html">BoundingBox</a></li></ul>
1717
<h1>Class BoundingBox</h1></div>
1818
<section class="tsd-panel tsd-hierarchy">
@@ -403,7 +403,7 @@ <h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option
403403
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
404404
<div class="tsd-accordion-details">
405405
<ul>
406-
<li><a href="../index.html">@vladmandic/face-<wbr/>api -<wbr/> v1.7.11</a>
406+
<li><a href="../index.html">@vladmandic/face-<wbr/>api -<wbr/> v1.7.12</a>
407407
<ul>
408408
<li class="tsd-kind-namespace"><a href="../modules/draw.html">draw</a></li>
409409
<li class="tsd-kind-namespace"><a href="../modules/utils.html">utils</a></li></ul></li></ul></div></details></nav>

typedoc/classes/Box.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Box | @vladmandic/face-api - v1.7.11</title><meta name="description" content="Documentation for @vladmandic/face-api - v1.7.11"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
1+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Box | @vladmandic/face-api - v1.7.12</title><meta name="description" content="Documentation for @vladmandic/face-api - v1.7.12"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
22
<div class="tsd-toolbar-contents container">
33
<div class="table-cell" id="tsd-search" data-base="..">
44
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
55
<div class="field">
66
<div id="tsd-toolbar-links"></div></div>
77
<ul class="results">
88
<li class="state loading">Preparing search index...</li>
9-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@vladmandic/face-api - v1.7.11</a></div>
9+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@vladmandic/face-api - v1.7.12</a></div>
1010
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
1111
<div class="container container-main">
1212
<div class="col-8 col-content">
1313
<div class="tsd-page-title">
1414
<ul class="tsd-breadcrumb">
15-
<li><a href="../index.html">@vladmandic/face-api - v1.7.11</a></li>
15+
<li><a href="../index.html">@vladmandic/face-api - v1.7.12</a></li>
1616
<li><a href="Box.html">Box</a></li></ul>
1717
<h1>Class Box&lt;BoxType&gt;</h1></div>
1818
<section class="tsd-panel tsd-type-parameters">
@@ -389,7 +389,7 @@ <h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option
389389
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
390390
<div class="tsd-accordion-details">
391391
<ul>
392-
<li><a href="../index.html">@vladmandic/face-<wbr/>api -<wbr/> v1.7.11</a>
392+
<li><a href="../index.html">@vladmandic/face-<wbr/>api -<wbr/> v1.7.12</a>
393393
<ul>
394394
<li class="tsd-kind-namespace"><a href="../modules/draw.html">draw</a></li>
395395
<li class="tsd-kind-namespace"><a href="../modules/utils.html">utils</a></li></ul></li></ul></div></details></nav>

0 commit comments

Comments
 (0)