mirror of https://github.com/vladmandic/human
fix demo when used with video files
parent
678a58e166
commit
3c45347f10
|
@ -9,12 +9,13 @@
|
|||
|
||||
## Changelog
|
||||
|
||||
### **HEAD -> main** 2022/05/09 mandic00@live.com
|
||||
|
||||
|
||||
### **2.7.1** 2022/05/09 mandic00@live.com
|
||||
|
||||
- support 4k input
|
||||
|
||||
### **origin/main** 2022/04/18 mandic00@live.com
|
||||
|
||||
- add attention draw methods
|
||||
- fix coloring function
|
||||
- enable precompile as part of warmup
|
||||
- prepare release beta
|
||||
|
|
|
@ -187,9 +187,9 @@ function status(msg) {
|
|||
}
|
||||
}
|
||||
|
||||
async function videoPlay() {
|
||||
async function videoPlay(videoElement = document.getElementById('video')) {
|
||||
document.getElementById('btnStartText').innerHTML = 'pause video';
|
||||
await document.getElementById('video').play();
|
||||
await videoElement.play();
|
||||
// status();
|
||||
}
|
||||
|
||||
|
@ -630,12 +630,14 @@ async function processImage(input, title) {
|
|||
|
||||
async function processVideo(input, title) {
|
||||
status(`processing video: ${title}`);
|
||||
const video = document.createElement('video');
|
||||
// const video = document.getElementById('video-file') || document.createElement('video');
|
||||
const video = document.getElementById('video');
|
||||
const canvas = document.getElementById('canvas');
|
||||
video.id = 'video-file';
|
||||
video.controls = true;
|
||||
video.loop = true;
|
||||
// video.onerror = async () => status(`video loading error: ${video.error.message}`);
|
||||
// video.id = 'video-file';
|
||||
// video.controls = true;
|
||||
// video.loop = true;
|
||||
// video.style.display = 'none';
|
||||
// document.body.appendChild(video);
|
||||
video.addEventListener('error', () => status(`video loading error: ${video.error.message}`));
|
||||
video.addEventListener('canplay', async () => {
|
||||
for (const m of Object.values(menu)) m.hide();
|
||||
|
@ -644,6 +646,7 @@ async function processVideo(input, title) {
|
|||
await videoPlay();
|
||||
if (!ui.detectThread) runHumanDetect(video, canvas);
|
||||
});
|
||||
video.srcObject = null;
|
||||
video.src = input;
|
||||
}
|
||||
|
||||
|
|
10
package.json
10
package.json
|
@ -53,7 +53,7 @@
|
|||
"tensorflow"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "^7.23.1",
|
||||
"@microsoft/api-extractor": "^7.23.2",
|
||||
"@tensorflow/tfjs": "^3.16.0",
|
||||
"@tensorflow/tfjs-backend-cpu": "^3.16.0",
|
||||
"@tensorflow/tfjs-backend-wasm": "^3.16.0",
|
||||
|
@ -65,16 +65,16 @@
|
|||
"@tensorflow/tfjs-layers": "^3.16.0",
|
||||
"@tensorflow/tfjs-node": "^3.16.0",
|
||||
"@tensorflow/tfjs-node-gpu": "^3.16.0",
|
||||
"@types/node": "^17.0.31",
|
||||
"@types/node": "^17.0.32",
|
||||
"@types/offscreencanvas": "^2019.6.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.22.0",
|
||||
"@typescript-eslint/parser": "^5.22.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
||||
"@typescript-eslint/parser": "^5.23.0",
|
||||
"@vladmandic/build": "^0.7.3",
|
||||
"@vladmandic/pilogger": "^0.4.4",
|
||||
"@vladmandic/tfjs": "github:vladmandic/tfjs",
|
||||
"canvas": "^2.9.1",
|
||||
"dayjs": "^1.11.2",
|
||||
"esbuild": "^0.14.38",
|
||||
"esbuild": "^0.14.39",
|
||||
"eslint": "8.15.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-html": "^6.2.0",
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
2022-05-09 08:14:02 [36mINFO: [39m Application: {"name":"@vladmandic/human","version":"2.7.1"}
|
||||
2022-05-09 08:14:02 [36mINFO: [39m Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
|
||||
2022-05-09 08:14:02 [36mINFO: [39m Toolchain: {"build":"0.7.3","esbuild":"0.14.38","typescript":"4.6.4","typedoc":"0.22.15","eslint":"8.15.0"}
|
||||
2022-05-09 08:14:02 [36mINFO: [39m Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
|
||||
2022-05-09 08:14:02 [35mSTATE:[39m Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
|
||||
2022-05-09 08:14:02 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":102,"outputBytes":595}
|
||||
2022-05-09 08:14:02 [35mSTATE:[39m Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":72,"inputBytes":606670,"outputBytes":297893}
|
||||
2022-05-09 08:14:02 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":599}
|
||||
2022-05-09 08:14:02 [35mSTATE:[39m Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":72,"inputBytes":606674,"outputBytes":297897}
|
||||
2022-05-09 08:14:02 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":149,"outputBytes":651}
|
||||
2022-05-09 08:14:02 [35mSTATE:[39m Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":72,"inputBytes":606726,"outputBytes":297947}
|
||||
2022-05-09 08:14:02 [35mSTATE:[39m Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1069,"outputBytes":358}
|
||||
2022-05-09 08:14:02 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1032,"outputBytes":583}
|
||||
2022-05-09 08:14:02 [35mSTATE:[39m Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":72,"inputBytes":606658,"outputBytes":296806}
|
||||
2022-05-09 08:14:03 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":1351141}
|
||||
2022-05-09 08:14:03 [35mSTATE:[39m Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":72,"inputBytes":1957216,"outputBytes":1646998}
|
||||
2022-05-09 08:14:03 [35mSTATE:[39m Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":72,"inputBytes":1957216,"outputBytes":2129196}
|
||||
2022-05-09 08:14:08 [35mSTATE:[39m Typings: {"input":"src/human.ts","output":"types/lib","files":114}
|
||||
2022-05-09 08:14:10 [35mSTATE:[39m TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":73,"generated":true}
|
||||
2022-05-09 08:14:10 [35mSTATE:[39m Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6021,"outputBytes":3024}
|
||||
2022-05-09 08:14:10 [35mSTATE:[39m Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15174,"outputBytes":7820}
|
||||
2022-05-09 08:14:18 [35mSTATE:[39m Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":104,"errors":0,"warnings":0}
|
||||
2022-05-09 08:14:18 [35mSTATE:[39m ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
|
||||
2022-05-09 08:14:18 [36mINFO: [39m Done...
|
||||
2022-05-12 16:46:38 [36mINFO: [39m Application: {"name":"@vladmandic/human","version":"2.7.1"}
|
||||
2022-05-12 16:46:38 [36mINFO: [39m Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true}
|
||||
2022-05-12 16:46:38 [36mINFO: [39m Toolchain: {"build":"0.7.3","esbuild":"0.14.39","typescript":"4.6.4","typedoc":"0.22.15","eslint":"8.15.0"}
|
||||
2022-05-12 16:46:38 [36mINFO: [39m Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Clean: {"locations":["dist/*","types/lib/*","typedoc/*"]}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":102,"outputBytes":595}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":72,"inputBytes":606670,"outputBytes":297893}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":599}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":72,"inputBytes":606674,"outputBytes":297897}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":149,"outputBytes":651}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":72,"inputBytes":606726,"outputBytes":297947}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1069,"outputBytes":358}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1032,"outputBytes":583}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":72,"inputBytes":606658,"outputBytes":296806}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"tfjs/browser/esm/custom","format":"esm","platform":"browser","input":"tfjs/tf-custom.ts","output":"dist/tfjs.esm.js","files":1,"inputBytes":110,"outputBytes":1351141}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":72,"inputBytes":1957216,"outputBytes":1646998}
|
||||
2022-05-12 16:46:38 [35mSTATE:[39m Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":72,"inputBytes":1957216,"outputBytes":2129196}
|
||||
2022-05-12 16:46:43 [35mSTATE:[39m Typings: {"input":"src/human.ts","output":"types/lib","files":114}
|
||||
2022-05-12 16:46:45 [35mSTATE:[39m TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":73,"generated":true}
|
||||
2022-05-12 16:46:45 [35mSTATE:[39m Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6021,"outputBytes":3024}
|
||||
2022-05-12 16:46:45 [35mSTATE:[39m Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":15174,"outputBytes":7820}
|
||||
2022-05-12 16:46:52 [35mSTATE:[39m Lint: {"locations":["*.json","src/**/*.ts","test/**/*.js","demo/**/*.js"],"files":104,"errors":0,"warnings":0}
|
||||
2022-05-12 16:46:52 [35mSTATE:[39m ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"}
|
||||
2022-05-12 16:46:52 [36mINFO: [39m Done...
|
||||
|
|
Loading…
Reference in New Issue