Skip to content

Commit d2caaa7

Browse files
authored
Merge pull request #101 from EnsembleUI/face-camera-docs
Add openFaceCamera documentation
2 parents 41c1a08 + 1257450 commit d2caaa7

9 files changed

Lines changed: 944 additions & 96 deletions

File tree

README.md

Lines changed: 334 additions & 0 deletions
Large diffs are not rendered by default.

content/actions/_meta.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
"open-camera": {
9999
"title": "Open Camera"
100100
},
101+
"open-face-camera": {
102+
"title": "Open Face Camera"
103+
},
101104
"open-plaid-link": {
102105
"title": "Open Plaid Link"
103106
},

content/actions/directory.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ When an event is triggered (e.g. button is tapped), you can perform actions such
2828
| Property | Description |
2929
| :---------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
3030
| [openCamera](open-camera.md) | openCamera action allows users to access their device's camera within the app for capturing images and videos. |
31+
| [openFaceCamera](open-face-camera.md) | openFaceCamera action provides a camera plugin that detects face in real-time. flows. |
3132
| [getLocation](get-location.md) | getLocation action retrieves the device's current location, enabling location-based functionalities within the app. |
3233
| [requestNotificationAccess](request-notification-access.md) | requestNotificationAccess action prompts users to grant permission for the app to send notifications to their device. |
3334
| [showNotification](show-notification.md) | showNotification action displays local notifications within the app, notifying users of important events or information. |

content/actions/open-camera.md

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
| assistSpeed | object | Show assist message whenever camera is moving faster than maxSpeed. [see properties](#values-for-optionsassistspeed) |
3838
| autoCaptureInterval | integer | If set any number n, on each n interval camera will capture |
3939
| captureOverlay | boolean | If set picture will be cropped according to overlay widget |
40-
| faceDetection | object | Enable face detection. [see properties](#values-for-optionsfacedetection) |
4140

4241
##### Values for options.assistAngle
4342

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

57-
##### Values for options.faceDetection
58-
59-
| Property | Type | Description |
60-
| :------------------------ | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------ |
61-
| enabled | boolean | Enable face detection. |
62-
| message | string | use this pass a message above the camera |
63-
| messageStyle | object | style applied to the message widget |
64-
| showControls | boolean | set false to hide all controls |
65-
| showCaptureControl | boolean | set false to hide capture control icon |
66-
| showFlashControl | boolean | set false to hide flash control control icon |
67-
| showCameraLensControl | boolean | set false to hide camera lens control icon |
68-
| indicatorShape | string | use this to change the shape of the face indicator `circle`, `square` |
69-
| autoDisableCaptureControl | boolean | set true to disable capture control widget when no face is detected |
70-
| autoCapture | boolean | set true to capture image on face detected |
71-
| imageResolution | string | use this to set image resolution `low`, `medium`, `high` |
72-
| defaultFlashMode | string | use this to set initial flash mode `off`, `auto`, `always` |
73-
| performanceMode | string | Use this to set your preferred performance mode. `accurate`, `fast` |
74-
| accuracyConfig | object | Use this to set accuracy config for face detection. Accuracy config is only supported on web. [see properties](#values-for-optionsfacedetectionaccuracyconfig) |
75-
76-
##### Values for options.faceDetection.accuracyConfig
77-
78-
> [Note]
79-
> Accuracy config is only supported on web.
80-
81-
| Property | Type | Description |
82-
| :------------------------- | :----- | :--------------------------------------------------------------------------- |
83-
| detectionThreshold | number | Minimum confidence score required to consider a face detection valid. |
84-
| intersectionRatioThreshold | number | Minimum allowed overlap ratio between the detected face and expected region. |
85-
| extraHeightFactor | number | Additional height factor added to the face bounding box. |
86-
| inputSize | number | Size of the input image used for face detection. |
87-
| landmarkRatio | number | Minimum acceptable alignment accuracy for facial landmarks. |
88-
| frameMargin | number | Margin ratio to ensure face is not too close to frame edges. |
89-
| tiltAngleThreshold | number | Maximum allowed tilt angle of the detected face (in degrees). |
90-
| horizontalCenterTolerance | number | Allowed tolerance for how centered the face must be horizontally. |
91-
| earThreshold | number | Minimum Eye Aspect Ratio (EAR) to detect open eyes. |
92-
| minFaceWidthRatio | number | Minimum ratio of face width relative to the frame. |
93-
| maxFaceWidthRatio | number | Maximum ratio of face width relative to the frame. |
94-
| qualityPassThreshold | number | Minimum quality score required for a face to pass detection. |
95-
| yawLowerThreshold | number | Lower bound of acceptable yaw (left-right head rotation) ratio. |
96-
| yawUpperThreshold | number | Upper bound of acceptable yaw (left-right head rotation) ratio. |
97-
98-
9956
**Usage Examples**
10057

101-
102-
10358
```yaml
10459
View:
10560
header:
@@ -273,55 +228,4 @@ You can clear previous camera results while recapturing using `cameraId.clear()`
273228
id: captureLatest
274229
```
275230

276-
Capture image on face detected
277-
278-
```yaml
279-
- Button:
280-
label: Open Camera
281-
onTap:
282-
openCamera:
283-
id: cameraWithFaceDetection
284-
options:
285-
initialCamera: front
286-
faceDetection:
287-
enabled: true
288-
autoCapture: false
289-
performanceMode: accurate
290-
accuracyConfig: # accuracyConfig is only supported on web
291-
detectionThreshold: 0.5
292-
intersectionRatioThreshold: 0.9
293-
extraHeightFactor: 0.6
294-
inputSize: 224
295-
landmarkRatio: 0.95
296-
frameMargin: 0.05
297-
tiltAngleThreshold: 6
298-
horizontalCenterTolerance: 0.08
299-
earThreshold: 0.25
300-
minFaceWidthRatio: 0.18
301-
maxFaceWidthRatio: 0.82
302-
qualityPassThreshold: 0.8
303-
yawLowerThreshold: 0.85
304-
yawUpperThreshold: 1.15
305-
message: "Align your face in the square"
306-
messageStyle:
307-
color: "#FF0000"
308-
fontSize: 20
309-
onCapture:
310-
uploadFiles:
311-
id: uploader
312-
files: ${cameraWithFaceDetection.files[0]}
313-
uploadApi: fileUploadApi
314-
fieldName: file
315-
onComplete:
316-
showDialog:
317-
body:
318-
Column:
319-
children:
320-
- TextInput:
321-
value: ${cameraWithFaceDetection.files[0]}
322-
- Image:
323-
source: ${cameraWithFaceDetection.files[0].path}
324-
```
325-
326-
327231
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.

0 commit comments

Comments
 (0)