Skip to content

Commit cd26c90

Browse files
committed
up version to v3 to signal potential breaking change, getPupilFeatures can use internal var instead of needed it as a param, fix collision.html
1 parent 6a43030 commit cd26c90

File tree

8 files changed

+11
-13
lines changed

8 files changed

+11
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webgazer",
3-
"version": "2.2.0",
3+
"version": "3.0.0",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/brownhci/WebGazer.git"

src/facemesh.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ TFFaceMesh.prototype.positionsArray = null;
1919

2020
/**
2121
* Isolates the two patches that correspond to the user's eyes
22+
* @param {Object} video - the video element itself
2223
* @param {Canvas} imageCanvas - canvas corresponding to the webcam stream
2324
* @param {Number} width - of imageCanvas
2425
* @param {Number} height - of imageCanvas

src/index.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,16 @@ function drawCoordinates(colour,x,y){
192192
/**
193193
* Gets the pupil features by following the pipeline which threads an eyes object through each call:
194194
* curTracker gets eye patches -> blink detector -> pupil detection
195-
* @param {Object} video - the video element itself
196195
* @param {Canvas} canvas - a canvas which will have the video drawn onto it
197196
* @param {Number} width - the width of canvas
198197
* @param {Number} height - the height of canvas
199198
*/
200-
function getPupilFeatures(video, canvas, width, height) {
199+
function getPupilFeatures(canvas, width, height) {
201200
if (!canvas) {
202201
return;
203202
}
204203
try {
205-
return curTracker.getEyePatches(video, canvas, width, height);
204+
return curTracker.getEyePatches(videoElement, canvas, width, height);
206205
} catch(err) {
207206
console.log("can't get pupil features ", err);
208207
return null;
@@ -235,7 +234,7 @@ function paintCurrentFrame(canvas, width, height) {
235234
async function getPrediction(regModelIndex) {
236235
var predictions = [];
237236
// [20200617 xk] TODO: this call should be made async somehow. will take some work.
238-
latestEyeFeatures = await getPupilFeatures(videoElement, videoElementCanvas, videoElementCanvas.width, videoElementCanvas.height);
237+
latestEyeFeatures = await getPupilFeatures(videoElementCanvas, videoElementCanvas.width, videoElementCanvas.height);
239238

240239
if (regs.length === 0) {
241240
console.log('regression not set, call setRegression()');

www/collision.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<body>
77
<script src="https://d3js.org/d3.v3.min.js"></script>
88
<script src="https://cdnjs.cloudflare.com/ajax/libs/localforage/1.8.1/localforage.js"></script>
9-
<!-- <script src="./tensorflow.js"></script> -->
109
<script src="./webgazer.js"></script>
1110
<script src="js/collision.js"></script>
1211
</body>

www/js/collision.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@
151151
webgazerCanvas = webgazer.getVideoElementCanvas();
152152
}
153153

154-
await webgazer.getTracker().getEyePatches(webgazerCanvas, webgazerCanvas.width, webgazerCanvas.height);
155154
var fmPositions = await webgazer.getTracker().getPositions();
156155

157156
var whr = webgazer.getVideoPreviewToCameraResolutionRatio();

www/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webgazer-www",
3-
"version": "2.2.0",
3+
"version": "3.0.0",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/brownhci/WebGazer.git"

www/webgazer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146366,6 +146366,7 @@ TFFaceMesh.prototype.positionsArray = null;
146366146366

146367146367
/**
146368146368
* Isolates the two patches that correspond to the user's eyes
146369+
* @param {Object} video - the video element itself
146369146370
* @param {Canvas} imageCanvas - canvas corresponding to the webcam stream
146370146371
* @param {Number} width - of imageCanvas
146371146372
* @param {Number} height - of imageCanvas
@@ -148027,17 +148028,16 @@ function drawCoordinates(colour,x,y){
148027148028
/**
148028148029
* Gets the pupil features by following the pipeline which threads an eyes object through each call:
148029148030
* curTracker gets eye patches -> blink detector -> pupil detection
148030-
* @param {Object} video - the video element itself
148031148031
* @param {Canvas} canvas - a canvas which will have the video drawn onto it
148032148032
* @param {Number} width - the width of canvas
148033148033
* @param {Number} height - the height of canvas
148034148034
*/
148035-
function getPupilFeatures(video, canvas, width, height) {
148035+
function getPupilFeatures(canvas, width, height) {
148036148036
if (!canvas) {
148037148037
return;
148038148038
}
148039148039
try {
148040-
return curTracker.getEyePatches(video, canvas, width, height);
148040+
return curTracker.getEyePatches(videoElement, canvas, width, height);
148041148041
} catch(err) {
148042148042
console.log("can't get pupil features ", err);
148043148043
return null;
@@ -148070,7 +148070,7 @@ function paintCurrentFrame(canvas, width, height) {
148070148070
async function getPrediction(regModelIndex) {
148071148071
var predictions = [];
148072148072
// [20200617 xk] TODO: this call should be made async somehow. will take some work.
148073-
latestEyeFeatures = await getPupilFeatures(videoElement, videoElementCanvas, videoElementCanvas.width, videoElementCanvas.height);
148073+
latestEyeFeatures = await getPupilFeatures(videoElementCanvas, videoElementCanvas.width, videoElementCanvas.height);
148074148074

148075148075
if (regs.length === 0) {
148076148076
console.log('regression not set, call setRegression()');

www/webgazer.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)