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

Function setupCamera

gpu-pipeline/ui-util.js:30–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28}
29
30async function setupCamera() {
31 video = document.getElementById('video');
32
33 const stream = await navigator.mediaDevices.getUserMedia({
34 'audio': false,
35 'video': {
36 facingMode: 'user',
37 width: videoWidth,
38 height: videoHeight
39 },
40 });
41 video.srcObject = stream;
42
43 await new Promise((resolve) => {
44 video.onloadedmetadata = () => {
45 resolve(video);
46 };
47 });
48
49 video.play();
50 video.width = videoWidth;
51 video.height = videoHeight;
52}
53
54function createStatsPanel() {
55 stats = new Stats();

Callers 1

setupPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected