-
Notifications
You must be signed in to change notification settings - Fork 0
/
jqueryface.html
56 lines (46 loc) · 1.32 KB
/
jqueryface.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
<html>
<head>
<style>
.face{
position: absolute;
border: 2px solid #009900;
}
#detect{
margin-left: 15%;
cursor: pointer;
cursor: hand;
}
</style>
<img src="https://www.sciencenews.org/sites/default/files/2017/06/main/articles/060117_LH_face-neuron_main.jpg" class="pic" width="50%">
<h2 id="detect">Detect Face</h2>
</head>
<body>
<script type="text/javascript" src="<script type="text/javascript" src="C:/Users/mk/Desktop/test/jq.js"></script>"></script>
<script type="text/javascript" src="C:/Users/mk/Desktop/test/f.js">
$("#detect").click(function(){
alert("Detecting Face ..............");
$(".pic").faceDetection({
complete:function(faces){
alert("Detection Complete");
for(var i=0;i<faces.length;i++){
$('<div>',{
'class':'face',
'css':{
'position':'absolute',
'left':faces[i].x*faces[i].scaleX+'px',
'top':faces[i].y*faces[i].scaleY+'px',
'width':faces[i].width*faces[i].scaleX+'px',
'height':faces[i].height*faces[i].scaleY+'px'
}
})
.insertAfter(this);
}
},
error:function(code,message){
alert("Error: "+message);
}
});
});
</script>
</body>
</html>