-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
face-detection.html
78 lines (77 loc) · 4.47 KB
/
face-detection.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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Face Detection</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" >
<link rel="stylesheet" href="style/face-detection.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src='js/face-api.min.js'></script>
<script type="text/javascript" src="https://unpkg.com/webcam-easy/dist/webcam-easy.min.js"></script>
</head>
<body>
<main>
<div class="container mt-1">
<div class="row">
<div class="col-12 col-md-4 col-xl-3 align-top">
<div class="row mb-3">
<div class="col-md-10 col-6 form-control">
<label class="form-switch">
<input type="checkbox" id="webcam-switch">
<i></i> Webcam </label>
<button id="cameraFlip" class="btn d-none"></button>
</div>
<div class="col-md-10 col-6 form-control">
<label class="form-switch disabled">
<input type="checkbox" disabled id="detection-switch">
<i></i> Detect Face </label>
</div>
<div class="col-md-10 col-6 form-control">
<label class="form-switch disabled">
<input type="checkbox" disabled id="box-switch">
<i></i> Bounding Box </label>
</div>
<div class="col-md-10 col-6 form-control">
<label class="form-switch disabled">
<input type="checkbox" disabled id="landmarks-switch">
<i></i> Landmarks </label>
</div>
<div class="col-md-10 col-6 form-control">
<label class="form-switch disabled">
<input type="checkbox" disabled id="expression-switch">
<i></i> Expression </label>
</div>
<div class="col-md-10 col-6 form-control">
<label class="form-switch disabled">
<input type="checkbox" disabled id="age-gender-switch">
<i></i> Age & Gender </label>
</div>
<div class="col-md-10 col-6 mt-2">
More on <a href="https://bensonruan.com" target="_blank">bensonruan.com</a>
</div>
</div>
</div>
<div class="col-12 col-md-8 col-xl-9 align-top" id="webcam-container">
<div class="loading d-none">
Loading Model
<div class="spinner-border" role="status">
<span class="sr-only"></span>
</div>
</div>
<div id="video-container">
<video id="webcam" autoplay muted playsinline></video>
</div>
<div id="errorMsg" class="col-12 alert-danger d-none">
Fail to start camera <br>
1. Please allow permission to access camera. <br>
2. If you are browsing through social media built in browsers, look for the ... or browser icon on the right top/bottom corner, and open the page in Sarafi (iPhone)/ Chrome (Android)
</div>
</div>
</div>
</div>
</main>
<script src="js/face-detection.js"></script>
</body>
</html>