UNPKG

2.43 kBSource Map (JSON)View Raw
1{"version":3,"file":"FaceDetector.js","sourceRoot":"","sources":["../src/FaceDetector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAoDlD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAW,EACX,UAA4B,EAAE;IAE9B,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE;QACjC,MAAM,IAAI,mBAAmB,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC;KACpE;IACD,OAAO,MAAM,gBAAgB,CAAC,WAAW,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,gBAAgB,CAAC,IAAI;IAC3B,SAAS,EAAE,gBAAgB,CAAC,SAAS;IACrC,eAAe,EAAE,gBAAgB,CAAC,eAAe;CAClD,CAAC","sourcesContent":["import { UnavailabilityError } from '@unimodules/core';\n\nimport ExpoFaceDetector from './ExpoFaceDetector';\n\ntype Point = { x: number; y: number };\n\nexport type FaceFeature = {\n bounds: {\n size: {\n width: number;\n height: number;\n };\n origin: Point;\n };\n smilingProbability?: number;\n leftEarPosition?: Point;\n rightEarPosition?: Point;\n leftEyePosition?: Point;\n leftEyeOpenProbability?: number;\n rightEyePosition?: Point;\n rightEyeOpenProbability?: number;\n leftCheekPosition?: Point;\n rightCheekPosition?: Point;\n leftMouthPosition?: Point;\n mouthPosition?: Point;\n rightMouthPosition?: Point;\n bottomMouthPosition?: Point;\n noseBasePosition?: Point;\n yawAngle?: number;\n rollAngle?: number;\n faceID?: number;\n};\n\ntype ValuesOf<T extends any[]> = T[number];\n\nexport type FaceDetectorMode = string[];\n\nexport type FaceDetectorLandmarks = ValuesOf<typeof ExpoFaceDetector.Landmarks>;\n\nexport type FaceDetectorClassifications = ValuesOf<typeof ExpoFaceDetector.Classifications>;\n\nexport interface Image {\n uri: string;\n width: number;\n height: number;\n orientation: number;\n}\n\nexport type DetectionOptions = {\n mode?: FaceDetectorMode;\n detectLandmarks?: FaceDetectorLandmarks;\n runClassifications?: FaceDetectorClassifications;\n};\n\nexport async function detectFacesAsync(\n uri: string,\n options: DetectionOptions = {}\n): Promise<{ faces: FaceFeature[]; image: Image }> {\n if (!ExpoFaceDetector.detectFaces) {\n throw new UnavailabilityError('expo-face-detector', 'detectFaces');\n }\n return await ExpoFaceDetector.detectFaces({ ...options, uri });\n}\n\nexport const Constants = {\n Mode: ExpoFaceDetector.Mode,\n Landmarks: ExpoFaceDetector.Landmarks,\n Classifications: ExpoFaceDetector.Classifications,\n};\n"]}
\No newline at end of file