cycle-posenet-driver
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -150,5 +150,5 @@ "use strict"; | ||
var _b = _a === void 0 ? {} : _a, _c = _b.videoWidth, videoWidth = _c === void 0 ? 640 : _c, _d = _b.videoHeight, videoHeight = _d === void 0 ? 480 : _d, _e = _b.flipHorizontal, flipHorizontal = _e === void 0 ? true : _e; | ||
var divID = "posenet"; | ||
var videoID = "posenet-video"; | ||
var canvasID = "posenet-canvas"; | ||
var divClass = "posenet"; | ||
var videoClass = "posenet-video"; | ||
var canvasClass = "posenet-canvas"; | ||
return function (params$) { | ||
@@ -286,12 +286,12 @@ var _this = this; | ||
case 0: | ||
if (!document.querySelector("#" + canvasID)) { | ||
console.debug("Waiting for #" + canvasID + " to appear..."); | ||
if (!document.querySelector("." + canvasClass)) { | ||
console.debug("Waiting for ." + canvasClass + " to appear..."); | ||
return [2 /*return*/]; | ||
} | ||
clearInterval(intervalID); | ||
return [4 /*yield*/, utils_1.setupCamera(document.querySelector("#" + videoID), videoWidth, videoHeight)]; | ||
return [4 /*yield*/, utils_1.setupCamera(document.querySelector("." + videoClass), videoWidth, videoHeight)]; | ||
case 1: | ||
video = _b.sent(); | ||
video.play(); | ||
canvas = document.querySelector("#" + canvasID); | ||
canvas = document.querySelector("." + canvasClass); | ||
context = canvas.getContext('2d'); | ||
@@ -339,3 +339,3 @@ canvas.width = videoWidth; | ||
stats.dom.style.setProperty('position', 'absolute'); | ||
document.querySelector("#" + divID).appendChild(stats.dom); | ||
document.querySelector("." + divClass).appendChild(stats.dom); | ||
gui = setupGui(video, params.net, params); | ||
@@ -345,3 +345,3 @@ gui.domElement.style.setProperty('position', 'absolute'); | ||
gui.domElement.style.setProperty('right', '0px'); | ||
document.querySelector("#" + divID) | ||
document.querySelector("." + divClass) | ||
.appendChild(gui.domElement); | ||
@@ -358,5 +358,5 @@ gui.closed = true; | ||
}); | ||
var vdom$ = xstream_1.default.of((snabbdom_pragma_1.default.createElement("div", { id: divID, style: { position: "relative" } }, | ||
snabbdom_pragma_1.default.createElement("video", { id: videoID, style: { display: 'none' }, autoPlay: true }), | ||
snabbdom_pragma_1.default.createElement("canvas", { id: canvasID })))); | ||
var vdom$ = xstream_1.default.of((snabbdom_pragma_1.default.createElement("div", { className: divClass, style: { position: "relative" } }, | ||
snabbdom_pragma_1.default.createElement("video", { className: videoClass, style: { display: 'none' }, autoPlay: true }), | ||
snabbdom_pragma_1.default.createElement("canvas", { className: canvasClass })))); | ||
return { | ||
@@ -363,0 +363,0 @@ DOM: adapt_1.adapt(vdom$), |
@@ -138,5 +138,5 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
var _b = _a === void 0 ? {} : _a, _c = _b.videoWidth, videoWidth = _c === void 0 ? 640 : _c, _d = _b.videoHeight, videoHeight = _d === void 0 ? 480 : _d, _e = _b.flipHorizontal, flipHorizontal = _e === void 0 ? true : _e; | ||
var divID = "posenet"; | ||
var videoID = "posenet-video"; | ||
var canvasID = "posenet-canvas"; | ||
var divClass = "posenet"; | ||
var videoClass = "posenet-video"; | ||
var canvasClass = "posenet-canvas"; | ||
return function (params$) { | ||
@@ -274,12 +274,12 @@ var _this = this; | ||
case 0: | ||
if (!document.querySelector("#" + canvasID)) { | ||
console.debug("Waiting for #" + canvasID + " to appear..."); | ||
if (!document.querySelector("." + canvasClass)) { | ||
console.debug("Waiting for ." + canvasClass + " to appear..."); | ||
return [2 /*return*/]; | ||
} | ||
clearInterval(intervalID); | ||
return [4 /*yield*/, setupCamera(document.querySelector("#" + videoID), videoWidth, videoHeight)]; | ||
return [4 /*yield*/, setupCamera(document.querySelector("." + videoClass), videoWidth, videoHeight)]; | ||
case 1: | ||
video = _b.sent(); | ||
video.play(); | ||
canvas = document.querySelector("#" + canvasID); | ||
canvas = document.querySelector("." + canvasClass); | ||
context = canvas.getContext('2d'); | ||
@@ -327,3 +327,3 @@ canvas.width = videoWidth; | ||
stats.dom.style.setProperty('position', 'absolute'); | ||
document.querySelector("#" + divID).appendChild(stats.dom); | ||
document.querySelector("." + divClass).appendChild(stats.dom); | ||
gui = setupGui(video, params.net, params); | ||
@@ -333,3 +333,3 @@ gui.domElement.style.setProperty('position', 'absolute'); | ||
gui.domElement.style.setProperty('right', '0px'); | ||
document.querySelector("#" + divID) | ||
document.querySelector("." + divClass) | ||
.appendChild(gui.domElement); | ||
@@ -346,5 +346,5 @@ gui.closed = true; | ||
}); | ||
var vdom$ = xs.of((Snabbdom.createElement("div", { id: divID, style: { position: "relative" } }, | ||
Snabbdom.createElement("video", { id: videoID, style: { display: 'none' }, autoPlay: true }), | ||
Snabbdom.createElement("canvas", { id: canvasID })))); | ||
var vdom$ = xs.of((Snabbdom.createElement("div", { className: divClass, style: { position: "relative" } }, | ||
Snabbdom.createElement("video", { className: videoClass, style: { display: 'none' }, autoPlay: true }), | ||
Snabbdom.createElement("canvas", { className: canvasClass })))); | ||
return { | ||
@@ -351,0 +351,0 @@ DOM: adapt(vdom$), |
{ | ||
"name": "cycle-posenet-driver", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "A Cycle.js driver for pose detection using TensorFlow.js-powered PoseNet", | ||
@@ -5,0 +5,0 @@ "author": "Michael Jae-Yoon Chung", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98093
14