-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
110 lines (100 loc) · 4.27 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Yawn – mouth openness</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Detect Mouth Openness" />
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script src="camera/libs/utils.js" type="text/javascript"></script>
</head>
<body>
<div class="toast" data-autohide="false" style="position: absolute; top: 0; right: 0; z-index: 9999">
<div class="toast-header">
<strong class="mr-auto"><i class="fa fa-grav"></i>Alert</strong>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="toast-body">
<div>TensorFlowJS model was not loaded!</div>
</div>
</div>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Mouth Openness</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<a id="type_image" class="nav-link" href="/">Image <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a id="type_camera" class="nav-link" href="/camera">Camera</a>
</li>
</ul>
</div>
</nav>
<script>
overrideUrls();
</script>
<main role="main" class="container mt-5">
<div class="row">
<div class="col-12">
<div class="progress progress-bar progress-bar-striped progress-bar-animated mb-2">
Loading Model
</div>
</div>
</div>
<div class="row col-6">
<div class="dropdown" id="myDropdown">
Model:
<button class="btn btn-primary btn-sm dropdown-toggle status" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Full
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Full</a>
<a class="dropdown-item" href="#">Lite</a>
</div>
</div>
</div>
<div class="row" style='margin-top:10px'>
<div class="col-6">
<div class="form-group">
<div class="custom-file">
<input type="file" id="image-selector" class="custom-file-input">
<label class="custom-file-label">Choose image</label>
</div>
</div>
</div>
<div class="col-6">
<button id="predictBtn" class="btn btn-primary float-right">
Predict
</button>
</div>
</div>
<hr />
<div class="row ml-3">
<p style='color:red'>Warning</p>: First inference can be slow. Try several times.
</div>
<div class="row">
<div class="col-6">
<h2 class="ml-3">Image</h2>
<img id="selected-image" class="ml-3" width="250" alt="" />
</div>
<div class="col-6">
<h2 class="ml-3">Predictions</h2>
<ol id="prediction-list"></ol>
</div>
</div>
</main>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" integrity="sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@2.0.0/dist/tf.min.js"></script>
<script src="image_predict.js"></script>
</body>
</html>