Skip to content

Commit

Permalink
tweak readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesar Vargas Casaseca committed May 3, 2020
1 parent 2092909 commit 8d061ab
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,19 @@ final class FaceView: UIView, CameraFrontView {
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:
```
```swift
let cameraViewController = CameraFaceDetectionViewController()
let leftEye = ImageLayout(image: UIImage(named: "leftEye")!, sizeRatio: SizeRatio(width: 1, height: 4))
let rightEye = ImageLayout(image: UIImage(named: "rightEye")!, sizeRatio: SizeRatio(width: 1, height: 4))
let nose = ImageLayout(image: UIImage(named: "nose")!)
let leftEye = ImageLayout(image: UIImage(named: "leftEye")!, sizeRatio: SizeRatio(width: 1, height: 4))
let rightEye = ImageLayout(image: UIImage(named: "rightEye")!, sizeRatio: SizeRatio(width: 1, height: 4))
let nose = ImageLayout(image: UIImage(named: "nose")!)
let faceLayout = FaceLayout(landmarkLayouts: [.leftEye: leftEye,
let faceLayout = FaceLayout(landmarkLayouts: [.leftEye: leftEye,
.rightEye: rightEye,
.nose: nose])
cameraViewController.faceLayout = faceLayout
cameraViewController.faceLayout = faceLayout
present(cameraViewController, animated: true, completion: nil)
present(cameraViewController, animated: true, completion: nil)
```
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```.
Expand Down

0 comments on commit 8d061ab

Please sign in to comment.