From 8caa76682e83d3483080a57d991783ad471785a5 Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Sun, 17 Sep 2023 16:49:04 +0200 Subject: [PATCH] docs --- .changeset/dry-mice-admire.md | 5 ++++ packages/face-detection/README.md | 12 +++++----- packages/face-detection/src/definitions.ts | 8 +++---- packages/face-mesh-detection/README.md | 24 +++++++++++-------- .../face-mesh-detection/src/definitions.ts | 11 ++++----- 5 files changed, 33 insertions(+), 27 deletions(-) create mode 100644 .changeset/dry-mice-admire.md diff --git a/.changeset/dry-mice-admire.md b/.changeset/dry-mice-admire.md new file mode 100644 index 0000000..60dbd5b --- /dev/null +++ b/.changeset/dry-mice-admire.md @@ -0,0 +1,5 @@ +--- +'@capacitor-mlkit/face-mesh-detection': minor +--- + +Initial release 🎉 diff --git a/packages/face-detection/README.md b/packages/face-detection/README.md index 27c08ae..6340774 100644 --- a/packages/face-detection/README.md +++ b/packages/face-detection/README.md @@ -118,12 +118,12 @@ Represents a face detected by `FaceDetector`. 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 | +| 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 diff --git a/packages/face-detection/src/definitions.ts b/packages/face-detection/src/definitions.ts index 236cf9a..b554af8 100644 --- a/packages/face-detection/src/definitions.ts +++ b/packages/face-detection/src/definitions.ts @@ -265,25 +265,25 @@ export interface Face { */ export interface Rect { /** - * The X coordinate of the left side of the rectangle + * The X coordinate of the left side of the rectangle. * * @since 5.1.0 */ left: number; /** - * The Y coordinate of the top of the rectangle + * The Y coordinate of the top of the rectangle. * * @since 5.1.0 */ top: number; /** - * The X coordinate of the right side of the rectangle + * The X coordinate of the right side of the rectangle. * * @since 5.1.0 */ right: number; /** - * The Y coordinate of the bottom of the rectangle + * The Y coordinate of the bottom of the rectangle. * * @since 5.1.0 */ diff --git a/packages/face-mesh-detection/README.md b/packages/face-mesh-detection/README.md index c536d21..100da6f 100644 --- a/packages/face-mesh-detection/README.md +++ b/packages/face-mesh-detection/README.md @@ -28,10 +28,14 @@ A working example can be found here: [robingenz/capacitor-mlkit-plugin-demo](htt ## Usage ```typescript -import { FaceMeshDetection } from '@capacitor-mlkit/face-mesh-detection'; - -const echo = async () => { - await FaceMeshDetection.echo(); +import { FaceMeshDetection, UseCase } from '@capacitor-mlkit/face-mesh-detection'; + +const processImage = async () => { + const { faceMeshs } = await FaceMeshDetection.processImage({ + path: 'path/to/image.jpg', + useCase: UseCase.FaceMesh, + }); + return faceMeshs; }; ``` @@ -101,12 +105,12 @@ The triangle information is a group of 3 `FaceMeshPoint`s representing a valid s 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.3.0 | -| **`top`** | number | The Y coordinate of the top of the rectangle | 5.3.0 | -| **`right`** | number | The X coordinate of the right side of the rectangle | 5.3.0 | -| **`bottom`** | number | The Y coordinate of the bottom of the rectangle | 5.3.0 | +| Prop | Type | Description | Since | +| ------------ | ------------------- | ---------------------------------------------------- | ----- | +| **`left`** | number | The X coordinate of the left side of the rectangle. | 5.3.0 | +| **`top`** | number | The Y coordinate of the top of the rectangle. | 5.3.0 | +| **`right`** | number | The X coordinate of the right side of the rectangle. | 5.3.0 | +| **`bottom`** | number | The Y coordinate of the bottom of the rectangle. | 5.3.0 | #### Contours diff --git a/packages/face-mesh-detection/src/definitions.ts b/packages/face-mesh-detection/src/definitions.ts index 6823905..f6269aa 100644 --- a/packages/face-mesh-detection/src/definitions.ts +++ b/packages/face-mesh-detection/src/definitions.ts @@ -19,7 +19,6 @@ export interface ProcessImageOptions { * @since 5.3.0 */ path: string; - /** * Sets the use case. * @@ -90,14 +89,12 @@ export interface FaceMesh { * @since 5.3.0 */ bounds: Rect; - /** * Returns contours with a list of `FaceMeshPoint` representing the detected face. * * @since 5.3.0 */ contours?: Contours; - /** * Returns a list of `FaceMeshPoint` representing the whole detected face. * @@ -123,25 +120,25 @@ export interface FaceMesh { */ export interface Rect { /** - * The X coordinate of the left side of the rectangle + * The X coordinate of the left side of the rectangle. * * @since 5.3.0 */ left: number; /** - * The Y coordinate of the top of the rectangle + * The Y coordinate of the top of the rectangle. * * @since 5.3.0 */ top: number; /** - * The X coordinate of the right side of the rectangle + * The X coordinate of the right side of the rectangle. * * @since 5.3.0 */ right: number; /** - * The Y coordinate of the bottom of the rectangle + * The Y coordinate of the bottom of the rectangle. * * @since 5.3.0 */