-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgfpgan.go
More file actions
47 lines (36 loc) · 733 Bytes
/
gfpgan.go
File metadata and controls
47 lines (36 loc) · 733 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
47
package gfpgan
import (
"github.com/dev6699/face/model"
"gocv.io/x/gocv"
)
type Model struct {
faceEnhancerBlend float64
img gocv.Mat
cropSize model.Size
affineMatrix gocv.Mat
}
type Input struct {
Img gocv.Mat
FaceLandmark5 []gocv.Point2f
}
type Output struct {
OutFrame gocv.Mat
}
type ModelT = model.Model[*Input, *Output]
var _ ModelT = &Model{}
func NewFactory(faceEnhancerBlend float64) func() ModelT {
return func() ModelT {
return New(faceEnhancerBlend)
}
}
func New(faceEnhancerBlend float64) *Model {
return &Model{
faceEnhancerBlend: faceEnhancerBlend,
}
}
func (m *Model) ModelName() string {
return "gfpgan_1.4"
}
func (m *Model) ModelVersion() string {
return "1"
}