Coder Social home page Coder Social logo

Comments (17)

RobinReborn avatar RobinReborn commented on July 2, 2024 7

I've started working on testing. I'm using Mocha and Puppeteer.

I'm testing on an instance of webgazerExtractor.js because I can access everything there and eventually adapt the testing framework into something that compares accuracies of different models and regressions.

It's not ready for a PR request but you can see the basic code here:

https://github.com/RobinReborn/WebGazer/blob/testing/test/puppeteer.js

Am open for recommendations of what to test

from webgazer.

jsimonson2013 avatar jsimonson2013 commented on July 2, 2024

@Skylion007 Do you have a particular framework in mind?

from webgazer.

Skylion007 avatar Skylion007 commented on July 2, 2024

I'm open to suggestions. :)

from webgazer.

jsimonson2013 avatar jsimonson2013 commented on July 2, 2024

I started setting up karma + mocha over on this fork.

It looks like @TristanVALCKE has done work already with Karma + Jasmine in #52 which seems like a good route, too.

from webgazer.

Skylion007 avatar Skylion007 commented on July 2, 2024

So end2end the demos on the website and the calibration page should be tested and make sure it doesn't error.

Also a lot of low hanging fruit for unit testing the utilities and math functions, but we will likely rewrite those soon. Testing all the regressions modes would be good too.

Since this JavaScript, just testing to make sure the the websites don't error out would be a great improvement.

from webgazer.

RobinReborn avatar RobinReborn commented on July 2, 2024

Is there a way of generating input for the calibration demo?

from webgazer.

Skylion007 avatar Skylion007 commented on July 2, 2024

@RobinReborn Isn't that exactly what the dataset extractor does? ;)

from webgazer.

jeffhuang avatar jeffhuang commented on July 2, 2024

There's some glue needed to train the separate model and then make it work with the UI

from webgazer.

RobinReborn avatar RobinReborn commented on July 2, 2024

It looks like there are some differences between the current calibration and the study_dot-test.webm videos (based on the .mov file).

Aside from the differences in the size of and graphics of the dots, the dots are presented in an order for the study_dot-test experiment. Current calibration test let's the user pick them in any order except the center one which must be picked last.

So I'll have to change the current calibration test to use the existing dataset to test callibration.

from webgazer.

Skylion007 avatar Skylion007 commented on July 2, 2024

Oh yeah, I forgot we updated the calibration page. I mean you could record inputs in a similar way and play it back. Does puppeeter not support some similar functionality?

from webgazer.

RobinReborn avatar RobinReborn commented on July 2, 2024

I'm not sure how I would capture mouse input - and I've discovered that it's difficult to give two programs access to the webcam simultaneously in Ubuntu.

from webgazer.

Skylion007 avatar Skylion007 commented on July 2, 2024

Puppeter recorder or something similar could work: https://www.checklyhq.com/docs/puppeteer-recorder/

from webgazer.

RobinReborn avatar RobinReborn commented on July 2, 2024

That doesn't store mouse position.

Could we modify the existing calibration so that the center point can be clicked at any time? We could hide the point from the user.

from webgazer.

Skylion007 avatar Skylion007 commented on July 2, 2024

So perhaps we should start with a simpler tasks and just have some Unit Testing / Benchmarking for the Regression components? For instance, an easy way to evaluate they don't error / get an accuracy given a video and corresponding data.

from webgazer.

RobinReborn avatar RobinReborn commented on July 2, 2024

I am working on getting basic tests but the issue is that webgazer has so many dependencies it's not easy to test it at a basic level.

It needs webgl and canvas as well as a DOM.

I'm using puppeteer, and aside from examining the DOM I can also execute javascript on the page. So I can test anything but it will be executed on the videos from webgazerExtract. And anything puppeteer gets from a page is returned as a serializable object so there are some limits to how much I can easily inspect, but I can ensure that the functions work.

from webgazer.

Skylion007 avatar Skylion007 commented on July 2, 2024

from webgazer.

RobinReborn avatar RobinReborn commented on July 2, 2024

Right now I have puppeteer working and have managed to send video files as input to the webcam.

I'm using both webgazerExtractClient.html and calibration.html to test webgazer functions. I'm mainly using those pages to execute javascript within an appropriate context, I'm not testing the full functionality of those pages just yet. Benchmarking tests in this context isn't perfect because any results will include the amount of time it takes for the website to respond.

I don't want this PR to be too big so I won't try to get full code coverage. It will include top level webgazer functions (the ones in index.mjs) and some regression tests.

I look forward to any feedback on the testing structure, I did spend some time looking for alternate ways of testing before settling on puppeteer but it's possible that the format I'm writing my tests in isn't the best.

After we agree on the best way of writing the tests it won't be too hard to create new tests, though it will take a lot of work to get 100% code coverage.

from webgazer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.