{"id":18961687,"url":"https://github.com/yoonit-labs/ios-yoonit-facefy","last_synced_at":"2025-04-19T11:41:31.053Z","repository":{"id":46322127,"uuid":"333837760","full_name":"Yoonit-Labs/ios-yoonit-facefy","owner":"Yoonit-Labs","description":"The face detection's module for iOS with a lot of awesome features","archived":false,"fork":false,"pushed_at":"2021-10-30T20:17:19.000Z","size":20778,"stargazers_count":33,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"development","last_synced_at":"2025-03-29T07:22:43.805Z","etag":null,"topics":["computer-vision","face-analysis","face-detection","face-movement","face-undertanding","hacktoberfest","head-movement","ios-facefy","ios-lib-face","mlkit-ios","pods-face-detection","undertanding-face-ios","yoonit-ios-facefy"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yoonit-Labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-28T17:44:11.000Z","updated_at":"2024-03-25T03:43:24.000Z","dependencies_parsed_at":"2022-08-31T03:53:39.683Z","dependency_job_id":null,"html_url":"https://github.com/Yoonit-Labs/ios-yoonit-facefy","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoonit-Labs%2Fios-yoonit-facefy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoonit-Labs%2Fios-yoonit-facefy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoonit-Labs%2Fios-yoonit-facefy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoonit-Labs%2Fios-yoonit-facefy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yoonit-Labs","download_url":"https://codeload.github.com/Yoonit-Labs/ios-yoonit-facefy/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249195415,"owners_count":21228193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","face-analysis","face-detection","face-movement","face-undertanding","hacktoberfest","head-movement","ios-facefy","ios-lib-face","mlkit-ios","pods-face-detection","undertanding-face-ios","yoonit-ios-facefy"],"created_at":"2024-11-08T14:14:02.197Z","updated_at":"2025-04-16T04:32:56.833Z","avatar_url":"https://github.com/Yoonit-Labs.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eiOS Yoonit Facefy\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/tag/Yoonit-Labs/ios-yoonit-facefy?color=lightgrey\u0026label=version\u0026style=for-the-badge\" /\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/Yoonit-Labs/ios-yoonit-facefy?color=lightgrey\u0026style=for-the-badge\" /\u003e  \n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ctable\u003e\n        \u003ctbody\u003e\n            \u003ctr\u003e\n                \u003ctd align=\"left\" valign=\"middle\"\u003e\n                    \u003cp\u003e◻ \u003ca href=\"https://developers.google.com/ml-kit\"\u003eGoogle MLKit\u003c/a\u003e integration\u003c/p\u003e                    \n                    \u003cp\u003e◻ Face detection\u003c/p\u003e\n                    \u003cp\u003e◻ Face contours\u003c/p\u003e\n                    \u003cp\u003e◻ Face expressions\u003c/p\u003e\n                    \u003cp\u003e◻ Face movement\u003c/p\u003e\n                \u003c/td\u003e\n                \u003ctd align=\"center\" valign=\"middle\"\u003e                    \n                    \u003cimg src=\"https://raw.githubusercontent.com/Yoonit-Labs/ios-yoonit-facefy/development/facefy.gif\" width=\"300\" /\u003e\n                \u003c/td\u003e\n            \u003c/tr\u003e\n        \u003ctbody\u003e\n    \u003c/table\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch3\u003eSponsors\u003c/h3\u003e\n    \u003ctable\u003e\n        \u003ctbody\u003e\n            \u003ctr\u003e\n                \u003ctd\u003e\n                    \u003cb\u003ePlatinum\u003c/b\u003e\n                \u003c/td\u003e\n            \u003c/tr\u003e\n            \u003ctr\u003e\n                \u003ctd align=\"center\" valign=\"middle\"\u003e\n                    \u003ca \n                        href=\"https://cyberlabs.ai\"\n                    \u003e\n                        \u003cimg \n                            src=\"https://raw.githubusercontent.com/Yoonit-Labs/ios-yoonit-facefy/main/sponsor_cyberlabs.png\"\n                            width=\"300\" \n                        /\u003e\n                    \u003c/a\u003e\n                \u003c/td\u003e\n            \u003c/tr\u003e\n        \u003c/tbody\u003e\n    \u003c/table\u003e\n    \u003ch5\u003e\u003ca href=\"mailto:about@yoonit.dev\"\u003eBecome a sponsor!\u003c/a\u003e\u003c/h5\u003e\n\u003c/div\u003e\n\n## Table of Contents\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [API](#api)\n  * [Methods](#methods)\n  * [FaceDetected](#facedetected)\n    * [Head Movements](#head-movements)\n* [To contribute and make it better](#to-contribute-and-make-it-better)\n\n## Install\n\nAdd the following line to your `Podfile` file:\n\n```  \npod 'YoonitFacefy'\n```\n\nAnd run in the root of your project:\n\n```\npod install\n```  \n\n## Usage\n\nThis is a basic usage to the `FacefyYoonit`.\nFeel free to use the demo.\n\n```swift\nimport YoonitFacefy\n\n...\n\nlet image = UIImage(contentsOfFile: \"image path\")\nlet facefy: Facefy = Facefy()\n\nself.facefy.detect(image!) { faceDetected in                                      \n    if let faceDetected: FaceDetected = faceDetected {\n        \n        if let leftEyeOpenProbability = faceDetected.leftEyeOpenProbability {\n            print(String(format: \"%.2f\", leftEyeOpenProbability))\n        }\n        if let rightEyeOpenProbability = faceDetected.rightEyeOpenProbability {\n            print(String(format: \"%.2f\", rightEyeOpenProbability))\n        }\n        if let smilingProbability = faceDetected.smilingProbability {\n            print(String(format: \"%.2f\", faceDetected.smilingProbability))\n        }\n        if let hasHeadEulerAngleX = faceDetected.hasHeadEulerAngleX {\n            print(String(format: \"%.2f\", hasHeadEulerAngleX))\n        }\n        if let hasHeadEulerAngleY = faceDetected.hasHeadEulerAngleY {\n            print(String(format: \"%.2f\", hasHeadEulerAngleY))\n        }                \n        if let hasHeadEulerAngleZ = faceDetected.hasHeadEulerAngleZ {\n            print(String(format: \"%.2f\", hasHeadEulerAngleZ))\n        }\n                    \n        if let cgImage = image?.cgImage {                                                        \n            \n            // Crop the face image from the camera frame.\n            let faceImage = UIImage(\n                cgImage: cgImage.cropping(to: faceDetected.boundingBox)!\n            ).withHorizontallyFlippedOrientation()\n        }\n    }\n} onError: { message in\n    print(message)\n}\n```\n\n## API\n\n### Methods\n\n| Function | Parameters                                                                                                                                                                                               | Return Type | Description |\n| -              | -                                                                                                                                                                                                                | -                   | -                 |\n| detect     |  `image: UIImage, onSuccess: @escaping (FaceDetected?) -\u003e Void, onError: @escaping (String) -\u003e Void` | void             | Detect a face from image and return the result in the [`FaceDetected`](#facedetected) as a closure. |\n\n### FaceDetected\n\n| Attribute | Type | Description |\n| -             | -        | -                  |\n| boundingBox | `CGRect` | The face bounding box related to the image input. |\n| leftEyeOpenProbability | `Float?` | The left eye open probability. |\n| rightEyeOpenProbability | `Float?` | The right eye open probability. |\n| smilingProbability | `Float?` | The smiling probability. |\n| headEulerAngleX | `Float?` | The angle in degrees that indicate the vertical head direction. See [Head Movements](#headmovements). |\n| headEulerAngleY | `Float?` | The angle in degrees that indicate the horizontal head direction. See [Head Movements](#headmovements). |\n| headEulerAngleZ | `Float?` | The angle in degrees that indicate the tilt head direction. See [Head Movements](#headmovements). |\n| contours | `[CGPoint]` | List of points that represents the shape of the detected face. |\n\n#### Head Movements\n\nHere we explaining the above gif and how reached the \"results\". Each \"movement\" (vertical, horizontal and tilt) is a state, based in the angle in degrees that indicate head direction;\n\n| Head Direction | Attribute         |  _v_ \u003c -36° | -36° \u003c _v_ \u003c -12° | -12° \u003c _v_ \u003c 12° | 12° \u003c _v_ \u003c 36° |  36° \u003c _v_  |\n| -              | -                 | -           | -                 | -                | -               | -           |\n| Vertical       | `headEulerAngleX` | Super Down  | Down              | Frontal          | Up              | Super Up    |\n| Horizontal     | `headEulerAngleY` | Super Left  | Left              | Frontal          | Right           | Super Right |\n| Tilt           | `headEulerAngleZ` | Super Right | Right             | Frontal          | Left            | Super Left  |\n\n\n## To contribute and make it better\n\nClone the repo, change what you want and send PR. For commit messages we use \u003ca href=\"https://www.conventionalcommits.org/\"\u003eConventional Commits\u003c/a\u003e.\n\nContributions are always welcome!\n\n\u003ca href=\"https://github.com/Yoonit-Labs/ios-yoonit-facefy/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=Yoonit-Labs/ios-yoonit-facefy\" /\u003e\n\u003c/a\u003e\n\n---\n\nCode with ❤ by the [**Yoonit**](https://yoonit.dev/) Team\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoonit-labs%2Fios-yoonit-facefy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoonit-labs%2Fios-yoonit-facefy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoonit-labs%2Fios-yoonit-facefy/lists"}