File size: 2,001 Bytes
9b56ece
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>Curl Detector</title>
  <link rel="stylesheet" href="./style.css">

</head>
<body>

<link href="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css" rel="stylesheet">
<script src="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.js"></script>
</script>

<body>
  <h1>Excercise counter with Mediapipe</h1>

  <section id="demos" class="invisible">
    <p>Stand in front of your webcam to get real-time pose landmarker detection.</br>Click <b>enable webcam</b> below and grant access to the webcam if prompted.</p>

    <div id="liveView" class="videoView">
      <button id="webcamButton" class="mdc-button mdc-button--raised">
        <span class="mdc-button__ripple"></span>
        <span class="mdc-button__label">ENABLE WEBCAM</span>
      </button>
      <button id="startButton" class="mdc-button mdc-button--raised">
        START COUNTING
      </button>
      <button id="stopButton" class="mdc-button mdc-button--raised">
        STOP COUNTING
      </button>
      <button id="restartButton" class="mdc-button mdc-button--raised">
        RESTART COUNTING
      </button>
      <div style="position: relative;">
        <video id="webcam" style="width: 1280px; height: 720px; position: abso" autoplay playsinline></video>
        <canvas class="output_canvas" id="output_canvas" width="1280" height="720" style="position: absolute; left: 0px; top: 0px;"></canvas>
      </div>
    </div>
    <fieldset>
      <legend>Choose your excercise</legend>
      <div>
        <input type="radio" id="curl" name="excercise" value="curl" />
        <label for="curl">curl</label>
      </div>
      <div>
        <input type="radio" id="squat" name="excercise" value="squat" />
        <label for="squat">squat</label>
      </div>
    </fieldset>
    <div id="counter"></div>
  </section>
  <script type="module" src="./script.js"></script>

</body>
</html>