DBFace is a real-time, single-stage face detector with high accuracy. orml-dbface provides the model and interface for easy use.
The model provided by orml-dbface allows for fast detection of faces in images. This enables applications that can detect and locate faces.
For a more detailed face extraction and face pose estimation look for orml-facemesh
First load the dbface model.
val dbface = DBFaceDetector.load()
Then for every frame.
val rectangles = dbface.detectFaces(videoFrame)
drawer.fill = null
drawer.stroke = ColorRGBa.PINK
for (r in rectangles) {
drawer.rectangle(r.area * Vector2(640.0, 480.0))
for (l in r.landmarks) {
drawer.circle(l.x * 640.0, l.y * 480.0, 10.0)
}
}
For a full example consult DemoDetector.kt
Based on