-
Notifications
You must be signed in to change notification settings - Fork 1
/
train.html
160 lines (139 loc) · 6.15 KB
/
train.html
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Icons -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#00aba9">
<meta name="theme-color" content="#ffffff">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- p5.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/addons/p5.dom.min.js"></script>
<!-- ml5.js -->
<script src="https://unpkg.com/[email protected]/dist/ml5.min.js" type="text/javascript"></script>
<title>Dr. Posture</title>
</head>
<style>
.container {
margin-top: 65px;
}
.card {
box-shadow: 4px 4px 10px grey;
}
.badge-light {
display: inline-block;
position: absolute;
right: 0;
margin-right: 20px;
}
#videoContainer {
display: inline-block;
}
</style>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="#"><b>Dr. Posture</b></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse"
aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">Home </a>
</li>
<li class="nav-item active">
<a class="nav-link" href="train.html">Train </a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<!-- left column -->
<div class="col-md-8 col-sm-12">
<div id="videoContainer" class="content"></div>
<p id="status">Loading Model...</p>
<div>
<button type="button" id="buttonPredict" class="btn btn-primary">Start predicting!</button>
<button type="button" class="btn btn-danger" id="clearAll">Clear all classes</button>
<button type="button" class="btn btn-success" id="saveDataset">Save Dataset</button>
<br /> <br />
</div>
</div>
<!-- right column -->
<div class="col-md-4 col-sm-12">
<div class="card text-white bg-info mb-3" style="max-width: 19rem;">
<br />
<img class="card-img-top" src="./assets/img/good-posture.svg" alt="Dr. posture" />
<div class="card-header">Training</div>
<div class="card-body">
<h6 class="card-title">Class <b>Correct</b> Posture: <span class="badge badge-light" id="exampleA">0</span>
</h6>
<button type="button" class="btn btn-primary btn-sm" id="addClassA">Add Example</button>
<button type="button" class="btn btn-danger btn-sm" id="resetA">Reset</button>
<br /> <br />
<h6 class="card-title">Class <b>Incorrect</b> Posture: <span class="badge badge-light"
id="exampleB">0</span></h6>
<button type="button" class="btn btn-primary btn-sm" id="addClassB">Add Example</button>
<button type="button" class="btn btn-danger btn-sm" id="resetB">Reset</button>
</div>
<div class="card-footer">
<h5 class="card-title">Result: <span id="result"></span></h5>
<p class="card-text">
Correct %: <span id="confidenceA"></span>
<br />
Incorrect %: <span id="confidenceB"></span>
</p>
</div>
</div>
</div>
</div>
<!-- <div id="videoContainer"></div>
<p id="status">Loading Model...</p>
<br>
<p>
<button type="button" class="btn btn-primary" id="addClassA">Add an Example to Class Correct</button>
<button type="button" class="btn btn-primary" id="resetA">Reset Class Correct</button>
<p><span id="exampleA">0</span> Correct examples | Confidence in Correct is: <span id="confidenceA">0</span></p>
<br><button type="button" class="btn btn-primary" id="addClassB">Add an Example to Class Incorrect</button>
<button type="button" class="btn btn-primary" id="resetB">Reset Class Incorrect</button>
<p><span id="exampleB">0</span> Incorrect examples | Confidence in Incorrect is: <span id="confidenceB">0</span>
</p>
</p>
<br />
<p>
<button type="button" class="btn btn-primary" id="buttonPredict">Start predicting!</button><br>
<button type="button" class="btn btn-danger" id="clearAll">Clear all classes</button><br>
<button type="button" class="btn btn-success" id="saveDataset">Save Dataset</button><br>
</p>
<p>
KNN Classifier with mobileNet model labeled this
as Class: <span id="result">...</span>
with a confidence of <span id="confidence">...</span>
</p>
</div> -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous">
</script>
<!-- index.js -->
<script src="assets/js/train.js"></script>
</body>
</html>