Documentation ¶
Index ¶
- Constants
- func SaveJPG(path string, im image.Image, quality int) error
- func TensorFromJpeg(bytes []byte) (*tf.Tensor, error)
- type AestheticsEvaluator
- type Face
- func (f *Face) AffineMatrix(width, height uint16) Matrix
- func (f Face) Angle() float64
- func (f Face) EyesCenter() (x float64, y float64)
- func (f Face) LeftEye() (x float64, y float64)
- func (f Face) LeftMouth() (x float64, y float64)
- func (f Face) Nose() (x float64, y float64)
- func (f Face) RightEye() (x float64, y float64)
- func (f Face) RightMouth() (x float64, y float64)
- func (f Face) Size() (width int, height int)
- func (f Face) String() string
- func (f Face) ToImage(srcImage image.Image, kernel draw.Interpolator, width uint16, height uint16) image.Image
- type FaceDetector
- type FaceDetectorOptions
- type FaceResults
- type Matrix
- func (m *Matrix) AdjustPosition(x, y float64)
- func (m Matrix) AdjustScale(scale float64) Matrix
- func (m Matrix) Multiply(b Matrix) Matrix
- func (m Matrix) Rotate(angle float64) Matrix
- func (m Matrix) Scale(x, y float64) Matrix
- func (m Matrix) Shear(x, y float64) Matrix
- func (m Matrix) ToAffineMatrix() f64.Aff3
- func (m Matrix) TransformPoint(x, y float64) (tx, ty float64)
- func (m Matrix) TransformVector(x, y float64) (tx, ty float64)
- func (m Matrix) Translate(x, y float64) Matrix
Constants ¶
const (
ErrLoadFile string = "Unable to Load MTCNN model file: %v\n"
)
Errors
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AestheticsEvaluator ¶
type AestheticsEvaluator struct {
// contains filtered or unexported fields
}
Evaluator - Evaluator for aesthetic image quality. Uses a MobileNet modified CNN trained from: https://github.com/idealo/image-quality-assessment/ Apache 2.0 License
func NewAestheticsEvaluator ¶
func NewAestheticsEvaluator(modelFile string) (*AestheticsEvaluator, error)
NewAestheticsEvaluator - Creates a new Aesthetics Evaluator
func (*AestheticsEvaluator) Close ¶
func (eval *AestheticsEvaluator) Close()
Close closes the Aesthetics Evaluator's Session
type Face ¶
type Face struct {
// contains filtered or unexported fields
}
Face
func (*Face) AffineMatrix ¶
AffineMatrix builds a Face Warp Affine Matrix
func (Face) Angle ¶
Angle caculates the angle of the face using the LeftEye and RightEye returns radians
func (Face) EyesCenter ¶
EyesCenter returns the (x,y) center between the eyes
func (Face) RightMouth ¶
RightMouth returns the (x,y) of the right corner of the mouth
type FaceDetector ¶
type FaceDetector struct { Options FaceDetectorOptions // contains filtered or unexported fields }
FaceDetector - Detector for faces in an image based on an MTCNN model. Uses a Multi-task Cascaded Convolutional Network Detector trained from: https://kpzhang93.github.io/MTCNN_face_detection_alignment/
func NewFaceDetector ¶
func NewFaceDetector(modelFile string, options FaceDetectorOptions) (*FaceDetector, error)
NewFaceDetector - Create a New FaceDetector from a model file
func (*FaceDetector) DetectFaces ¶
func (det *FaceDetector) DetectFaces(tensor *tf.Tensor) (*FaceResults, error)
DetectFaces runs the tensorflow detection session and outputs a FacesResults
type FaceDetectorOptions ¶
FaceDetectorOptions -
type FaceResults ¶
type FaceResults struct {
// contains filtered or unexported fields
}
func (*FaceResults) DrawDebugJPEG ¶
func (fr *FaceResults) DrawDebugJPEG(path string, src image.Image) error
func (FaceResults) Len ¶
func (fr FaceResults) Len() int
func (FaceResults) String ¶
func (fr FaceResults) String() string
type Matrix ¶
type Matrix struct {
XX, YX, XY, YY, X0, Y0 float64
}
Matrix -
func RotationMatrix2D ¶
RotationMatrix2D creates a Rotation and Transformation Matrix. This is similiar to OpenCV's function. Angle in Radians
func (*Matrix) AdjustPosition ¶
AdjustPosition adjust position of the matrix by x and y
func (Matrix) ToAffineMatrix ¶
func (Matrix) TransformPoint ¶
TransformPoint using a Matrix and x and y
func (Matrix) TransformVector ¶
TransformVector using a Matrix and x and y