@regulaforensics/face-sdk
Version:
This is an npm module for Regula Face SDK. It allows you to easily compaire faces using your phone's camera.
33 lines (28 loc) • 915 B
JavaScript
import { ComparedFace } from './compared_face'
import { MatchFacesException } from './match_faces_exception'
export class ComparedFacesPair {
first
second
similarity
score
error
static fromJson(jsonObject) {
if (jsonObject == null) return null
const result = new ComparedFacesPair()
result.first = ComparedFace.fromJson(jsonObject["first"])
result.second = ComparedFace.fromJson(jsonObject["second"])
result.similarity = jsonObject["similarity"]
result.score = jsonObject["score"]
result.error = MatchFacesException.fromJson(jsonObject["error"])
return result
}
toJson() {
return {
"first": this.first?.toJson(),
"second": this.second?.toJson(),
"similarity": this.similarity,
"score": this.score,
"error": this.error?.toJson(),
}
}
}