-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
98 lines (81 loc) · 3.42 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
<!DOCTYPE html>
<html ng-app="faceAPI">
<head>
<meta charset="UTF-8">
<title>Face++ JavaScript SDK</title>
<script type="text/javascript" src="lib/js/jquery-2.2.1.min.js"></script>
<script type="text/javascript" src="lib/js/angular.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}
div {
margin: 5px;
}
h4 {
color: red;
}
.person {
width: 100px;
height: 140px;
display: inline-block;
border: 1px solid slategrey;
font-size: 10px;
overflow: hidden;
}
.person.found {
border: 1px solid green;
background-color: lightgreen;
}
.face {
width: 50px;
height: 80px;
display: inline-block;
border: 1px solid slategrey;
font-size: 10px;
overflow: hidden;
}
</style>
</head>
<body data-ng-controller="FaceController as fc">
<!-- For output results -->
<!-- Import libraries -->
<h4>{{fc.error}}</h4>
<div class='person' data-ng-repeat="face in fc.listfaces" data-ng-click="fc.face = face">
<div>{{face.persistedFaceId}}</div>
<div data-ng-show="fc.face == face">SELECTED</div>
</div>
<div></div>
<img style="float:right; width: 200px;" data-ng-src="{{fc.url}}" data-ng-show="fc.url"/>
<div class='person' data-ng-class="{found:(fc.foundperson == person.personId)}"data-ng-repeat="person in fc.persons" data-ng-click="fc.person = person">
<div>{{person.name}}</div>
<div>{{person.personId}}</div>
<button data-ng-click="fc.deletePerson(person)">X</button>
<div data-ng-show="fc.person == person">SELECTED</div>
</div>
<div data-ng-show="fc.person">Faces of {{fc.person.name}}</div>
<div class='face' data-ng-repeat="face in fc.person.persistedFaceIds" data-ng-click="fc.face = face; fc.getFace(fc.person.personId,face)">
<div>{{face}}</div>
<button data-ng-click="fc.deletePersonFace(fc.person,face)">X</button>
<div data-ng-show="fc.face == face">SELECTED</div>
</div>
<div>
<button data-ng-click="fc.createPerson()">Create Person</button>
<input data-ng-model="fc.name" placeholder="Name"/>
<button data-ng-disabled="!fc.person" data-ng-click="fc.addFace()">Add Face to person</button>
<input data-ng-model="fc.faceUrl" placeholder="URL"/>
</div>
<div>
<button data-ng-click="fc.trainGroup()">Train Group</button>
</div>
<div>
<button data-ng-disabled="!fc.faceUrl" data-ng-click="fc.detectAndCheck()">Check</button>
<input data-ng-model="fc.faceUrl" placeholder="URL"/>
</div>
<h3>REQUEST</h3>
<pre id="request"></pre>
<h3>RESPONSE</h3>
<pre id="response"></pre>
</body>
</html>