brownhci / WebGazer

WebGazer.js: Scalable Webcam EyeTracking Using User Interactions
https://webgazer.cs.brown.edu
Other
3.49k stars 524 forks source link

Consider different Multidimensional Arrays Implementations #37

Open Skylion007 opened 8 years ago

Skylion007 commented 8 years ago

So after looking through the optimizations of this library, we are more or less at a local minimum when it comes to our naive representation of multidimensional arrays. They are currently untyped and simply use the classic Array of Array implementation. We should consider ways of storing our arrays in alternative ways and possibly typing them to get better performance. There is a case to be made that we might want to implement something similar to NDArray, but doing so it contingent on issue #35 . LU decomposition still takes up a rather large portion of the run time.

Currently here are three areas of optimization to focus on:

  1. track() inside of CLMR tracker
  2. getPupilFeatures()
  3. LUDecomposition() and the entire ridge methods

Optimizing these areas will be important if we want to make it practical to run on mobile.

Some reading on the topic: https://0fps.net/2013/05/22/implementing-multidimensional-arrays-in-javascript/ https://github.com/mikolalysenko/ndarray-experiments

sneha-belkhale commented 5 years ago

Hey , I was thinking about helping out on this issue ( I really like this project and was planning to use it for a little web experience ) .

It looks like the functions you mentioned are outside the WebGazer repo? It looks like you are using LUDecomposition from the numeric.js library, and tracking is from the clmtracker repo?

jeffhuang commented 5 years ago

That's correct @sneha-belkhale . Those can be optimized separately, or specifically for WebGazer. Would love to see what you come up with.

jeffhuang commented 4 years ago

note that we're not using clmtrackr anymore so the first area is not as impactful

Skylion007 commented 4 years ago

Something in WASM like Eigen-JS may be a good candidate for CPU implementations: https://github.com/BertrandBev/eigen-js