forked from justadudewhohacks/face-api.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFaceLandmarks68.ts
41 lines (33 loc) · 899 Bytes
/
FaceLandmarks68.ts
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
import { getCenterPoint } from '../utils';
import { FaceLandmarks } from './FaceLandmarks';
import { Point } from './Point';
export class FaceLandmarks68 extends FaceLandmarks {
public getJawOutline(): Point[] {
return this.positions.slice(0, 17)
}
public getLeftEyeBrow(): Point[] {
return this.positions.slice(17, 22)
}
public getRightEyeBrow(): Point[] {
return this.positions.slice(22, 27)
}
public getNose(): Point[] {
return this.positions.slice(27, 36)
}
public getLeftEye(): Point[] {
return this.positions.slice(36, 42)
}
public getRightEye(): Point[] {
return this.positions.slice(42, 48)
}
public getMouth(): Point[] {
return this.positions.slice(48, 68)
}
protected getRefPointsForAlignment(): Point[] {
return [
this.getLeftEye(),
this.getRightEye(),
this.getMouth()
].map(getCenterPoint)
}
}