npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mat2718/capacitor-face-detection

v0.0.7

Published

Live face detection for Capacitor

Downloads

3

Readme

@mat2718/face-detection

Live face detection for Capacitor

Install

npm install @mat2718/face-detection
npx cap sync

API

startActiveScan(...)

startActiveScan(options: StartActiveScanOptions) => Promise<void>

| Param | Type | | ------------- | ------------------------------------------------------------------------- | | options | StartActiveScanOptions |


readFaceFromImage(...)

readFaceFromImage(options: readFaceFromImageOptions) => Promise<FaceDetectionResults>

| Param | Type | | ------------- | ----------------------------------------------------------------------------- | | options | readFaceFromImageOptions |

Returns: Promise<FaceDetectionResults>


stopScan()

stopScan() => Promise<void>

addListener('faceScanned', ...)

addListener(eventName: 'faceScanned', listenerFunc: (event: ActiveFaceSanResult) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

| Param | Type | | ------------------ | --------------------------------------------------------------------------------------- | | eventName | 'faceScanned' | | listenerFunc | (event: ActiveFaceSanResult) => void |

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


addListener('scanError', ...)

addListener(eventName: 'scanError', listenerFunc: (event: ScanErrorEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

| Param | Type | | ------------------ | ----------------------------------------------------------------------------- | | eventName | 'scanError' | | listenerFunc | (event: ScanErrorEvent) => void |

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


removeAllListeners()

removeAllListeners() => Promise<void>

enableTorch()

enableTorch() => Promise<void>

disableTorch()

disableTorch() => Promise<void>

toggleTorch()

toggleTorch() => Promise<void>

isTorchEnabled()

isTorchEnabled() => Promise<IsTorchEnabledResult>

Returns: Promise<IsTorchEnabledResult>


isTorchAvailable()

isTorchAvailable() => Promise<IsTorchAvailableResult>

Returns: Promise<IsTorchAvailableResult>


openSettings()

openSettings() => Promise<void>

isSupported()

isSupported() => Promise<IsSupportedResult>

Returns: Promise<IsSupportedResult>


checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


requestPermissions()

requestPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


Interfaces

StartActiveScanOptions

| Prop | Type | | ---------------- | ------------------------------------------------- | | lensFacing | LensFacing |

FaceDetectionResults

| Prop | Type | | ----------- | ------------------- | | faces | Face[] |

Face

Represents a face detected by FaceDetector.

| Prop | Type | Description | | ----------------------------- | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | bounds | Rect | Returns the axis-aligned bounding rectangle of the detected face. | | landmarks | FaceLandmark[] | Returns a list of face landmarks. | | contours | FaceContour[] | Returns a list of face contours. | | trackingId | number | Returns the tracking ID if the tracking is enabled. | | headEulerAngleX | number | Returns the rotation of the face about the horizontal axis of the image. Positive euler X is the face is looking up. | | headEulerAngleY | number | Returns the rotation of the face about the vertical axis of the image. Positive euler y is when the face turns toward the right side of the image that is being processed. | | headEulerAngleZ | number | Returns the rotation of the face about the axis pointing out of the image. Positive euler z is a counter-clockwise rotation within the image plane. | | smilingProbability | number | Returns a value between 0.0 and 1.0 giving a probability that the face is smiling. | | leftEyeOpenProbability | number | Returns a value between 0.0 and 1.0 giving a probability that the face's left eye is open. | | rightEyeOpenProbability | number | Returns a value between 0.0 and 1.0 giving a probability that the face's right eye is open. |

Rect

Rect holds four integer coordinates for a rectangle.

| Prop | Type | Description | Since | | ------------ | ------------------- | ---------------------------------------------------- | ----- | | left | number | The X coordinate of the left side of the rectangle. | 5.1.0 | | top | number | The Y coordinate of the top of the rectangle. | 5.1.0 | | right | number | The X coordinate of the right side of the rectangle. | 5.1.0 | | bottom | number | The Y coordinate of the bottom of the rectangle. | 5.1.0 |

FaceLandmark

Represent a face landmark. A landmark is a point on a detected face, such as an eye, nose, or mouth.

| Prop | Type | Description | Since | | -------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ----- | | type | LandmarkType | Gets the FaceLandmark.LandmarkType type. | 5.1.0 | | position | Point | Gets a 2D point for landmark position, where (0, 0) is the upper-left corner of the image. | 5.1.0 |

Point

Point holds two coordinates

| Prop | Type | | ------- | ------------------- | | x | number | | y | number |

FaceContour

Represent a face contour. A contour is a list of points on a detected face, such as the mouth.

| Prop | Type | Description | Since | | ------------ | --------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ----- | | type | ContourType | Gets the FaceContour.ContourType type. | 5.1.0 | | points | Point[] | Gets a list of 2D points for this face contour, where (0, 0) is the upper-left corner of the image. | 5.1.0 |

readFaceFromImageOptions

| Prop | Type | | ---------- | ------------------- | | path | string |

PluginListenerHandle

| Prop | Type | | ------------ | ----------------------------------------- | | remove | () => Promise<void> |

ActiveFaceSanResult

| Prop | Type | | ---------- | ------------------------------------- | | face | Face |

ScanErrorEvent

| Prop | Type | | ------------- | ------------------- | | message | string |

IsTorchEnabledResult

| Prop | Type | | ------------- | -------------------- | | enabled | boolean |

IsTorchAvailableResult

| Prop | Type | | --------------- | -------------------- | | available | boolean |

IsSupportedResult

| Prop | Type | | --------------- | -------------------- | | supported | boolean |

PermissionStatus

| Prop | Type | | ------------ | ----------------------------------------------------------------------- | | camera | CameraPermissionState |

Type Aliases

CameraPermissionState

PermissionState | 'limited'

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

Enums

LensFacing

| Members | Value | | ----------- | -------------------- | | Front | 'FRONT' | | Back | 'BACK' |

LandmarkType

| Members | Value | Description | Since | | ----------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | | MouthBottom | 0 | The center of the subject's bottom lip. | 5.1.0 | | LeftCheek | 1 | The midpoint between the subject's left mouth corner and the outer corner of the subject's left eye. For full profile faces, this becomes the centroid of the nose base, nose tip, left ear lobe and left ear tip. | 5.1.0 | | LeftEar | 3 | The midpoint of the subject's left ear tip and left ear lobe. | 5.1.0 | | LeftEye | 4 | The center of the subject's left eye cavity. | 5.1.0 | | MouthLeft | 5 | The subject's left mouth corner where the lips meet. | 5.1.0 | | NoseBase | 6 | The midpoint between the subject's nostrils where the nose meets the face. | 5.1.0 | | RightCheek | 7 | The midpoint between the subject's right mouth corner and the outer corner of the subject's right eye. For full profile faces, this becomes the centroid of the nose base, nose tip, right ear lobe and right ear tip. | 5.1.0 | | RightEar | 9 | The midpoint of the subject's right ear tip and right ear lobe. | 5.1.0 | | RightEye | 10 | The center of the subject's right eye cavity. | 5.1.0 | | MouthRight | 11 | The subject's right mouth corner where the lips meet. | 5.1.0 |

ContourType

| Members | Value | Description | Since | | ------------------------ | --------------- | -------------------------------------------------- | ----- | | Face | 1 | The outline of the subject's face. | 5.1.0 | | LeftEyebrowTop | 2 | The top outline of the subject's left eyebrow. | 5.1.0 | | LeftEyebrowBottom | 3 | The bottom outline of the subject's left eyebrow. | 5.1.0 | | RightEyebrowTop | 4 | The top outline of the subject's right eyebrow. | 5.1.0 | | RightEyebrowBottom | 5 | The bottom outline of the subject's right eyebrow. | 5.1.0 | | LeftEye | 6 | The outline of the subject's left eye cavity. | 5.1.0 | | RightEye | 7 | The outline of the subject's right eye cavity. | 5.1.0 | | UpperLipTop | 8 | The top outline of the subject's upper lip. | 5.1.0 | | UpperLipBottom | 9 | The bottom outline of the subject's upper lip. | 5.1.0 | | LowerLipTop | 10 | The top outline of the subject's lower lip. | 5.1.0 | | LowerLipBottom | 11 | The bottom outline of the subject's lower lip. | 5.1.0 | | NoseBridge | 12 | The outline of the subject's nose bridge. | 5.1.0 | | NoseBottom | 13 | The outline of the subject's nose bridge. | 5.1.0 | | LeftCheek | 14 | The center of the left cheek. | 5.1.0 | | RightCheek | 15 | The center of the right cheek. | 5.1.0 |