validate UI done?
This commit is contained in:
parent
14985a70f1
commit
ebf18f19e8
|
|
@ -49,11 +49,21 @@ class PersonList(Resource):
|
||||||
|
|
||||||
session = Session()
|
session = Session()
|
||||||
|
|
||||||
|
# this indicates that the captured face should be use for identification / validation
|
||||||
if "useFace" in args and args["useFace"]:
|
if "useFace" in args and args["useFace"]:
|
||||||
|
if id is not None:
|
||||||
# replace by Biometric function
|
# validate
|
||||||
data = list(session.query(Person).all())[1].serialize()
|
data = list(session.query(Person).filter_by(person_id=id))[0].serialize()
|
||||||
return flask.make_response(flask.jsonify({'data': data}), 200)
|
data["matching_score"] = 0.95
|
||||||
|
# return identified person object + matching score
|
||||||
|
return flask.make_response(flask.jsonify({'data': data}), 200)
|
||||||
|
else:
|
||||||
|
# replace by Biometric function
|
||||||
|
# identify
|
||||||
|
# return identified person object + matching score
|
||||||
|
data = list(session.query(Person).all())[1].serialize()
|
||||||
|
data["matching_score"] = 0.95
|
||||||
|
return flask.make_response(flask.jsonify({'data': data}), 200)
|
||||||
|
|
||||||
if id is None:
|
if id is None:
|
||||||
data = list(session.query(Person).all())
|
data = list(session.query(Person).all())
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,6 @@ function focusPerson(id) {
|
||||||
renderPersonRight()
|
renderPersonRight()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function loadPersonList(data) {
|
function loadPersonList(data) {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
data = data["data"]
|
data = data["data"]
|
||||||
|
|
@ -38,6 +36,7 @@ function loadPersonList(data) {
|
||||||
Gender: ${item["gender"]} <br>
|
Gender: ${item["gender"]} <br>
|
||||||
YoB: ${item["yob"]} <br>
|
YoB: ${item["yob"]} <br>
|
||||||
Available FP: ${item["fingerprints"].length} <br>
|
Available FP: ${item["fingerprints"].length} <br>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -61,10 +60,12 @@ function renderPersonRight(data){
|
||||||
<img src="${data["face"]}" id="image-right"> </img>
|
<img src="${data["face"]}" id="image-right"> </img>
|
||||||
|
|
||||||
<h4 class="heroInfo">
|
<h4 class="heroInfo">
|
||||||
Gender: ${data["gender"]} <br>
|
Gender: ${data["gender"]} <br>
|
||||||
YoB: ${data["yob"]} <br>
|
YoB: ${data["yob"]} <br>
|
||||||
Available FP: ${data["fingerprints"].length} <br>
|
Available FP: ${data["fingerprints"].length} <br>
|
||||||
</div>
|
<h3>Score: ${data["matching_score"]} </h3>
|
||||||
|
</h4>
|
||||||
|
|
||||||
`
|
`
|
||||||
mr.innerHTML = string;
|
mr.innerHTML = string;
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +82,7 @@ function identify(){
|
||||||
|
|
||||||
function validate(){
|
function validate(){
|
||||||
snapShot()
|
snapShot()
|
||||||
getJSON(rootKontext + "/api/v1/person/?useFace=True&?validateId="+selected,
|
getJSON(rootKontext + "/api/v1/person/" + selected + "?useFace=True",
|
||||||
function (error, data) {
|
function (error, data) {
|
||||||
data = data["data"]
|
data = data["data"]
|
||||||
renderPersonRight(data)
|
renderPersonRight(data)
|
||||||
|
|
@ -89,33 +90,6 @@ function validate(){
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderValidate(){
|
|
||||||
string = `
|
|
||||||
<img src="${rootKontext + "/api/v1/camera/stream"}" id="image-left"> </img>
|
|
||||||
|
|
||||||
<button onclick="validate()" class="btn btn-primary float-right middle-controls">Validate</button>
|
|
||||||
<button onclick="renderValidate()" class="btn btn-warning float-right middle-controls">Retry</button>
|
|
||||||
`
|
|
||||||
ml.innerHTML = string;
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderChange(){
|
|
||||||
console.log("change")
|
|
||||||
}
|
|
||||||
function renderEnrole(){
|
|
||||||
console.log("enrole")
|
|
||||||
}
|
|
||||||
function renderIdentify(){
|
|
||||||
string = `
|
|
||||||
<img src="${rootKontext + "/api/v1/camera/stream"}" id="image-left"> </img>
|
|
||||||
|
|
||||||
<button onclick="identify()" class="btn btn-primary float-right middle-controls">Identify</button>
|
|
||||||
<button onclick="renderIdentify()" class="btn btn-warning float-right middle-controls">Retry</button>
|
|
||||||
`
|
|
||||||
ml.innerHTML = string;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function loadStream() {
|
function loadStream() {
|
||||||
string = `
|
string = `
|
||||||
<img src="${rootKontext + "/api/v1/camera/stream"}" id="image-left"> </img>
|
<img src="${rootKontext + "/api/v1/camera/stream"}" id="image-left"> </img>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
|
function clearMiddle(){
|
||||||
|
ml.innerHTML = ""
|
||||||
|
mr.innerHTML = ""
|
||||||
|
}
|
||||||
|
|
||||||
function renderValidate(){
|
function renderValidate(){
|
||||||
|
clearMiddle()
|
||||||
string = `
|
string = `
|
||||||
<img src="${rootKontext + "/api/v1/camera/stream"}" id="image-left"> </img>
|
<img src="${rootKontext + "/api/v1/camera/stream"}" id="image-left"> </img>
|
||||||
|
|
||||||
|
|
@ -9,12 +15,15 @@ function renderValidate(){
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderChange(){
|
function renderChange(){
|
||||||
|
clearMiddle()
|
||||||
console.log("change")
|
console.log("change")
|
||||||
}
|
}
|
||||||
function renderEnrole(){
|
function renderEnrole(){
|
||||||
|
clearMiddle()
|
||||||
console.log("enrole")
|
console.log("enrole")
|
||||||
}
|
}
|
||||||
function renderIdentify(){
|
function renderIdentify(){
|
||||||
|
clearMiddle()
|
||||||
string = `
|
string = `
|
||||||
<img src="${rootKontext + "/api/v1/camera/stream"}" id="image-left"> </img>
|
<img src="${rootKontext + "/api/v1/camera/stream"}" id="image-left"> </img>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
<script src="/static/coms.js"></script>
|
<script src="/static/coms.js"></script>
|
||||||
|
<script src="/static/render.js"></script>
|
||||||
<script src="/static/main.js"></script>
|
<script src="/static/main.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue