-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathyoloface.go
More file actions
46 lines (36 loc) · 800 Bytes
/
yoloface.go
File metadata and controls
46 lines (36 loc) · 800 Bytes
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
package yoloface
import (
"github.com/dev6699/face/model"
"gocv.io/x/gocv"
)
type Model struct {
faceDetectorScore float32
iouThreshold float64
ratioHeight float32
ratioWidth float32
}
type Input struct {
Img gocv.Mat
}
type Output struct {
Detections []Detection
}
type ModelT = model.Model[*Input, *Output]
var _ ModelT = &Model{}
func NewFactory(faceDetectorScore float32, iouThreshold float64) func() ModelT {
return func() ModelT {
return New(faceDetectorScore, iouThreshold)
}
}
func New(faceDetectorScore float32, iouThreshold float64) *Model {
return &Model{
faceDetectorScore: faceDetectorScore,
iouThreshold: iouThreshold,
}
}
func (m *Model) ModelName() string {
return "yoloface"
}
func (m *Model) ModelVersion() string {
return "1"
}