Pengi5659 commited on
Commit
1282fd8
·
verified ·
1 Parent(s): 719bcf3

Update frontend.html

Browse files
Files changed (1) hide show
  1. frontend.html +4 -3
frontend.html CHANGED
@@ -5,8 +5,9 @@
5
  <script src="https://cdn.jsdelivr.net/npm/@teachablemachine/image"></script>
6
  </head>
7
  <body>
 
8
  <video id="webcam" autoplay playsinline width="400" height="300"></video>
9
- <p id="label">Loading...</p>
10
  <script>
11
  const URL = "./";
12
  let model, webcam;
@@ -15,7 +16,7 @@
15
  model = await tmImage.load(URL + "model.json", URL + "metadata.json");
16
  const video = document.getElementById("webcam");
17
  const labelEl = document.getElementById("label");
18
-
19
  navigator.mediaDevices.getUserMedia({ video: true }).then(stream => {
20
  video.srcObject = stream;
21
  });
@@ -26,7 +27,7 @@
26
  labelEl.innerHTML = prediction
27
  .map(p => `${p.className}: ${(p.probability * 100).toFixed(1)}%`)
28
  .join("<br>");
29
- }, 200);
30
  });
31
  }
32
 
 
5
  <script src="https://cdn.jsdelivr.net/npm/@teachablemachine/image"></script>
6
  </head>
7
  <body>
8
+ <h2>Posture Detector</h2>
9
  <video id="webcam" autoplay playsinline width="400" height="300"></video>
10
+ <p id="label">Loading model...</p>
11
  <script>
12
  const URL = "./";
13
  let model, webcam;
 
16
  model = await tmImage.load(URL + "model.json", URL + "metadata.json");
17
  const video = document.getElementById("webcam");
18
  const labelEl = document.getElementById("label");
19
+
20
  navigator.mediaDevices.getUserMedia({ video: true }).then(stream => {
21
  video.srcObject = stream;
22
  });
 
27
  labelEl.innerHTML = prediction
28
  .map(p => `${p.className}: ${(p.probability * 100).toFixed(1)}%`)
29
  .join("<br>");
30
+ }, 300);
31
  });
32
  }
33