-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathFacefy.kt
More file actions
63 lines (51 loc) · 1.78 KB
/
Copy pathFacefy.kt
File metadata and controls
63 lines (51 loc) · 1.78 KB
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
package ai.cyberlabs.yoonit.facefy
import ai.cyberlabs.yoonit.facefy.model.FaceDetected
import ai.cyberlabs.yoonit.facefy.model.FacefyOptions
import android.graphics.RectF
import com.google.mlkit.vision.common.InputImage
class Facefy {
private val facefyController = FacefyController()
var classification: Boolean = FacefyOptions.classification
set(value) {
FacefyOptions.classification = value
field = value
}
var contours: Boolean = FacefyOptions.contours
set(value) {
FacefyOptions.contours = value
field = value
}
var boundingBox: Boolean = FacefyOptions.boundingBox
set(value) {
FacefyOptions.boundingBox = value
field = value
}
var roiEnable: Boolean = FacefyOptions.faceROI.enable
set(value) {
FacefyOptions.faceROI.enable = value
field = value
}
var roiRect: RectF = FacefyOptions.faceROI.rectOffset
set(value) {
FacefyOptions.faceROI.rectOffset = value
field = value
}
var roiDetectMinSize: Float = FacefyOptions.faceROI.minimumSize
set(value) {
FacefyOptions.faceROI.minimumSize = value
field = value
}
var detectMinSize: Float = FacefyOptions.faceCaptureMinSize
set(value) {
FacefyOptions.faceCaptureMinSize = value
field = value
}
var detectMaxSize: Float = FacefyOptions.faceCaptureMaxSize
set(value) {
FacefyOptions.faceCaptureMaxSize = value
field = value
}
fun detect(image: InputImage, onFaceDetected: (FaceDetected) -> Unit, onMessage: (String) -> Unit) {
facefyController.detect(image, onFaceDetected, onMessage)
}
}