MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / handler

Function handler

webcam-transfer-learning/ui.js:76–88  ·  view source on GitHub ↗
(label)

Source from the content-addressed store, hash-verified

74const thumbDisplayed = {};
75
76async function handler(label) {
77 mouseDown = true;
78 const className = CONTROLS[label];
79 const button = document.getElementById(className);
80 const total = document.getElementById(className + '-total');
81 while (mouseDown) {
82 addExampleHandler(label);
83 document.body.setAttribute('data-active', CONTROLS[label]);
84 total.innerText = ++totals[label];
85 await tf.nextFrame();
86 }
87 document.body.removeAttribute('data-active');
88}
89
90upButton.addEventListener('mousedown', () => handler(0));
91upButton.addEventListener('mouseup', () => mouseDown = false);

Callers 1

ui.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected