forked from jaysalvat/jquery.facedetection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
87 lines (83 loc) · 2.59 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Face Detection jQuery Plugin</title>
<link rel="stylesheet" type="text/css" href="css/styles.css"/>
<script src="http://code.jquery.com/jquery-1.5.1.min.js"></script>
<script src="js/facedetection/ccv.js"></script>
<script src="js/facedetection/face.js"></script>
<script src="js/jquery.facedetection.js"></script>
<script>
$(function() {
$('#try').click(function() {
var $this = $(this);
var coords = $('img').faceDetection({
complete:function() {
$this.text('Done!');
},
error:function(img, code, message) {
$this.text('error!');
alert('Error: '+message);
}
});
for (var i = 0; i < coords.length; i++) {
$('<div>', {
'class':'face',
'css': {
'position': 'absolute',
'left': coords[i].positionX +'px',
'top': coords[i].positionY +'px',
'width': coords[i].width +'px',
'height': coords[i].height +'px'
}
})
.appendTo('#content');
}
});
return false;
});
</script>
<style>
.face {
border:2px solid #FFF;
}
</style>
</head>
<body>
<div id="container">
<div id="header">
<h1>jQuery Face detection</h1>
<p><a href="http://facedetection.jaysalvat.com">Visit the website</a></p>
</div>
<div id="content">
<pre>var coords = $('#myPicture').faceDetection();</pre>
<a href="#" id="try">TRY IT NOW!</a>
<img src="img/faces.jpg" id="myPicture"/>
<ul>
<li>Plugin by <a href="http://jaysalvat.com">Jay Salvat</a></li>
<li>Source on <a href="https://github.com/jaysalvat/jquery.facedetection">Github</a></li>
<li>Original algorithm by <a href="https://github.com/liuliu/ccv">Liu Liu</a>.</li>
</ul>
</div>
<div id="footer">
<h2>Like it? Buy me a beer!</h2>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="text" name="amount" value="3.00" size="4" style="text-align:right;" />
<strong>$</strong>
<input type="submit" name="submit" value="Thanks!" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="[email protected]" />
<input type="hidden" name="item_name" value="facedetection_plugin" />
<input type="hidden" name="item_number" value="FACEDETECTION-DONATE" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="tax" value="0" />
<input type="hidden" name="bn" value="PP-DonationsBF" />
<input type="hidden" name="lc" value="US" />
</form>
</div>
</div>
</body>
</html>