Skip to content

Commit 8d061ab

Browse files
author
Cesar Vargas Casaseca
committed
tweak readme file
1 parent 2092909 commit 8d061ab

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,19 @@ final class FaceView: UIView, CameraFrontView {
143143
144144
If you want to add images on top of each Face Features, you have to compose a ```FaceLayout``` object defining an ```ImageLayout``` object for each type of Face Landmark you want to draw. You can set the desired offset and Size Ratio for each feature. Once you have it, you should then pass it to the faceLayout property of the ```CameraFaceDetectionViewController```. Please notice that if you do that the ```cameraFrontView``` property gets overriden:
145145
146-
```
146+
```swift
147147
let cameraViewController = CameraFaceDetectionViewController()
148148
149-
let leftEye = ImageLayout(image: UIImage(named: "leftEye")!, sizeRatio: SizeRatio(width: 1, height: 4))
150-
let rightEye = ImageLayout(image: UIImage(named: "rightEye")!, sizeRatio: SizeRatio(width: 1, height: 4))
151-
let nose = ImageLayout(image: UIImage(named: "nose")!)
149+
let leftEye = ImageLayout(image: UIImage(named: "leftEye")!, sizeRatio: SizeRatio(width: 1, height: 4))
150+
let rightEye = ImageLayout(image: UIImage(named: "rightEye")!, sizeRatio: SizeRatio(width: 1, height: 4))
151+
let nose = ImageLayout(image: UIImage(named: "nose")!)
152152
153-
let faceLayout = FaceLayout(landmarkLayouts: [.leftEye: leftEye,
153+
let faceLayout = FaceLayout(landmarkLayouts: [.leftEye: leftEye,
154154
.rightEye: rightEye,
155155
.nose: nose])
156-
cameraViewController.faceLayout = faceLayout
156+
cameraViewController.faceLayout = faceLayout
157157
158-
present(cameraViewController, animated: true, completion: nil)
158+
present(cameraViewController, animated: true, completion: nil)
159159
```
160160
161161
Apart from that, you can implement the ```CameraFaceDetectionDelegate``` protocol to react to any change in the Face Dectection. This can be convenient for the case when you do not want to draw on top, but just get the face features (landmarks) coordinates. These are encapsulated in the given parameter ```FaceViewModel```.

0 commit comments

Comments
 (0)