Skip to content

Commit

Permalink
make sure model is loaded before proceed
Browse files Browse the repository at this point in the history
  • Loading branch information
peilingjiang committed Jun 5, 2024
1 parent 9216c9c commit 79194cb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/RemoteCalibrator.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/RemoteCalibrator.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/WebGazer4RC
Submodule WebGazer4RC updated 1 files
+27 −3 src/facemesh.mjs
4 changes: 2 additions & 2 deletions src/distance/distanceTrack.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import RemoteCalibrator from '../core'

import { blindSpotTest } from './distance'
Expand Down Expand Up @@ -203,6 +201,8 @@ const startTrackingPupils = async (
callbackTrack,
trackingConfig,
) => {
await RC.gazeTracker.webgazer.getTracker().loadModel()

RC.gazeTracker.beginVideo({ pipWidthPx: trackingOptions.pipWidthPx }, () => {
RC._removeFloatInstructionElement()
safeExecuteFunc(beforeCallbackTrack)
Expand Down
3 changes: 2 additions & 1 deletion src/distance/interPupillaryDistance.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ const formatVideo = (RC, video, canvas, container, stream = null) => {
// ? stream.getTracks()[0].getSettings()
// : [video.videoWidth, video.videoHeight]
const h =
((window.innerWidth * videoHeightFactor) / Number.parseInt(video.style.width)) *
((window.innerWidth * videoHeightFactor) /
Number.parseInt(video.style.width)) *
Number.parseInt(video.style.height)

originalStyles.videoWidth = container.style.width
Expand Down
3 changes: 2 additions & 1 deletion src/gaze/gazeCalibration.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ export class GazeCalibrationDot {

_randomOrder() {
this.order = []
for (const i of [0, 1, 2]) for (const j of [0, 1, 2]) this.order.push([i, j])
for (const i of [0, 1, 2])
for (const j of [0, 1, 2]) this.order.push([i, j])
shuffle(this.order)
}

Expand Down

0 comments on commit 79194cb

Please sign in to comment.