Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
334 changes: 334 additions & 0 deletions README.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions content/actions/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
"open-camera": {
"title": "Open Camera"
},
"open-face-camera": {
"title": "Open Face Camera"
},
"open-plaid-link": {
"title": "Open Plaid Link"
},
Expand Down
1 change: 1 addition & 0 deletions content/actions/directory.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ When an event is triggered (e.g. button is tapped), you can perform actions such
| Property | Description |
| :---------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [openCamera](open-camera.md) | openCamera action allows users to access their device's camera within the app for capturing images and videos. |
| [openFaceCamera](open-face-camera.md) | openFaceCamera action provides a camera plugin that detects face in real-time. flows. |
| [getLocation](get-location.md) | getLocation action retrieves the device's current location, enabling location-based functionalities within the app. |
| [requestNotificationAccess](request-notification-access.md) | requestNotificationAccess action prompts users to grant permission for the app to send notifications to their device. |
| [showNotification](show-notification.md) | showNotification action displays local notifications within the app, notifying users of important events or information. |
Expand Down
96 changes: 0 additions & 96 deletions content/actions/open-camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
| assistSpeed | object | Show assist message whenever camera is moving faster than maxSpeed. [see properties](#values-for-optionsassistspeed) |
| autoCaptureInterval | integer | If set any number n, on each n interval camera will capture |
| captureOverlay | boolean | If set picture will be cropped according to overlay widget |
| faceDetection | object | Enable face detection. [see properties](#values-for-optionsfacedetection) |

##### Values for options.assistAngle

Expand All @@ -54,52 +53,8 @@
| maxSpeed | number | Maximum speed in km/hr. |
| assistSpeedMessage | number | Custom message to show when condition is hit. |

##### Values for options.faceDetection

| Property | Type | Description |
| :------------------------ | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------ |
| enabled | boolean | Enable face detection. |
| message | string | use this pass a message above the camera |
| messageStyle | object | style applied to the message widget |
| showControls | boolean | set false to hide all controls |
| showCaptureControl | boolean | set false to hide capture control icon |
| showFlashControl | boolean | set false to hide flash control control icon |
| showCameraLensControl | boolean | set false to hide camera lens control icon |
| indicatorShape | string | use this to change the shape of the face indicator `circle`, `square` |
| autoDisableCaptureControl | boolean | set true to disable capture control widget when no face is detected |
| autoCapture | boolean | set true to capture image on face detected |
| imageResolution | string | use this to set image resolution `low`, `medium`, `high` |
| defaultFlashMode | string | use this to set initial flash mode `off`, `auto`, `always` |
| performanceMode | string | Use this to set your preferred performance mode. `accurate`, `fast` |
| accuracyConfig | object | Use this to set accuracy config for face detection. Accuracy config is only supported on web. [see properties](#values-for-optionsfacedetectionaccuracyconfig) |

##### Values for options.faceDetection.accuracyConfig

> [Note]
> Accuracy config is only supported on web.

| Property | Type | Description |
| :------------------------- | :----- | :--------------------------------------------------------------------------- |
| detectionThreshold | number | Minimum confidence score required to consider a face detection valid. |
| intersectionRatioThreshold | number | Minimum allowed overlap ratio between the detected face and expected region. |
| extraHeightFactor | number | Additional height factor added to the face bounding box. |
| inputSize | number | Size of the input image used for face detection. |
| landmarkRatio | number | Minimum acceptable alignment accuracy for facial landmarks. |
| frameMargin | number | Margin ratio to ensure face is not too close to frame edges. |
| tiltAngleThreshold | number | Maximum allowed tilt angle of the detected face (in degrees). |
| horizontalCenterTolerance | number | Allowed tolerance for how centered the face must be horizontally. |
| earThreshold | number | Minimum Eye Aspect Ratio (EAR) to detect open eyes. |
| minFaceWidthRatio | number | Minimum ratio of face width relative to the frame. |
| maxFaceWidthRatio | number | Maximum ratio of face width relative to the frame. |
| qualityPassThreshold | number | Minimum quality score required for a face to pass detection. |
| yawLowerThreshold | number | Lower bound of acceptable yaw (left-right head rotation) ratio. |
| yawUpperThreshold | number | Upper bound of acceptable yaw (left-right head rotation) ratio. |


**Usage Examples**



```yaml
View:
header:
Expand Down Expand Up @@ -273,55 +228,4 @@ You can clear previous camera results while recapturing using `cameraId.clear()`
id: captureLatest
```

Capture image on face detected

```yaml
- Button:
label: Open Camera
onTap:
openCamera:
id: cameraWithFaceDetection
options:
initialCamera: front
faceDetection:
enabled: true
autoCapture: false
performanceMode: accurate
accuracyConfig: # accuracyConfig is only supported on web
detectionThreshold: 0.5
intersectionRatioThreshold: 0.9
extraHeightFactor: 0.6
inputSize: 224
landmarkRatio: 0.95
frameMargin: 0.05
tiltAngleThreshold: 6
horizontalCenterTolerance: 0.08
earThreshold: 0.25
minFaceWidthRatio: 0.18
maxFaceWidthRatio: 0.82
qualityPassThreshold: 0.8
yawLowerThreshold: 0.85
yawUpperThreshold: 1.15
message: "Align your face in the square"
messageStyle:
color: "#FF0000"
fontSize: 20
onCapture:
uploadFiles:
id: uploader
files: ${cameraWithFaceDetection.files[0]}
uploadApi: fileUploadApi
fieldName: file
onComplete:
showDialog:
body:
Column:
children:
- TextInput:
value: ${cameraWithFaceDetection.files[0]}
- Image:
source: ${cameraWithFaceDetection.files[0].path}
```


To learn more about openCamera functionalities, test it out here in [Ensemble Kitchen Sink](https://studio.ensembleui.com/app/e24402cb-75e2-404c-866c-29e6c3dd7992/screen/USuOaOZApSgzE2uVrqlv) app.
Loading