Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cycle-handtrack-driver

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cycle-handtrack-driver - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

7

lib/es6/index.d.ts

@@ -1,2 +0,5 @@

export { makePoseDetectionDriver, PoseNetParameters } from "./makePoseDetectionDriver";
export { Keypoint, Pose } from "@tensorflow-models/posenet";
declare const makeHandTrackDriver: ({ model, modelParams }?: {
model?: any;
modelParams?: {};
}) => (command$: any) => any;
export { makeHandTrackDriver };

@@ -1,2 +0,60 @@

export { makePoseDetectionDriver } from "./makePoseDetectionDriver";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var xs = require("xstream").default;
var handTrack = require("handtrackjs/dist/handtrack.min.js"); // copied from v0.0.13
var makeHandTrackDriver = function (_a) {
var _b = _a === void 0 ? {} : _a, _c = _b.model, model = _c === void 0 ? null : _c, _d = _b.modelParams, modelParams = _d === void 0 ? {} : _d;
modelParams = __assign({ flipHorizontal: true, maxNumBoxes: 2, iouThreshold: 0.5, scoreThreshold: 0.6 }, modelParams);
var runDetection = function (model, video, canvas, listener) {
var context = canvas.getContext("2d");
var runDetectionHelper = function () {
model.detect(video).then(function (predictions) {
listener.next(predictions);
model.renderPredictions(predictions, canvas, context, video);
requestAnimationFrame(runDetectionHelper);
});
};
runDetectionHelper();
};
return function (command$) {
var output$ = xs.create({
start: function (listener) {
command$.addListener({
next: function (cmd) {
if (cmd.type === "start") {
var _a = cmd.elems, video_1 = _a[0], canvas_1 = _a[1];
handTrack.startVideo(video_1).then(function (status) {
if (status) {
if (!model) {
handTrack.load(modelParams).then(function (model) {
runDetection(model, video_1, canvas_1, listener);
});
}
else {
runDetection(model, video_1, canvas_1, listener);
}
}
else {
listener.error("Cannot start video");
}
});
}
}
});
},
stop: function () { }
});
return output$;
};
};
export { makeHandTrackDriver };
//# sourceMappingURL=index.js.map
{
"name": "cycle-handtrack-driver",
"version": "0.0.1",
"version": "0.0.2",
"description": "A Cycle.js driver for using victordibia's handtrackjs",

@@ -5,0 +5,0 @@ "author": "Michael Jae-Yoon Chung",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc