{"id":13468395,"url":"https://github.com/eBay/HeadGazeLib","last_synced_at":"2025-03-26T05:31:08.707Z","repository":{"id":41530707,"uuid":"148201914","full_name":"eBay/HeadGazeLib","owner":"eBay","description":"A library to empower iOS app control through head gaze without a finger touch","archived":true,"fork":false,"pushed_at":"2019-12-16T19:53:17.000Z","size":12195,"stargazers_count":754,"open_issues_count":1,"forks_count":73,"subscribers_count":34,"default_branch":"master","last_synced_at":"2024-10-29T22:56:26.551Z","etag":null,"topics":["accessibility","arkit","headtracking","ios","swift"],"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/eBay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.TXT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-10T18:37:40.000Z","updated_at":"2024-05-03T13:16:18.000Z","dependencies_parsed_at":"2022-09-13T02:32:11.869Z","dependency_job_id":null,"html_url":"https://github.com/eBay/HeadGazeLib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2FHeadGazeLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2FHeadGazeLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2FHeadGazeLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2FHeadGazeLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eBay","download_url":"https://codeload.github.com/eBay/HeadGazeLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245597219,"owners_count":20641859,"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":["accessibility","arkit","headtracking","ios","swift"],"created_at":"2024-07-31T15:01:10.047Z","updated_at":"2025-03-26T05:31:03.944Z","avatar_url":"https://github.com/eBay.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# HeadGazeLib\n\n![Platform iOS](https://img.shields.io/badge/platform-iOS-orange.svg)\n![license MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)\n## What is the Project\n`HeadGazeLib` is a pure Swift library to empower iOS app control through head gaze without a finger touch.  \nSee the story behind it [here](https://www.ebayinc.com/stories/news/ebay-open-sources-technology-that-uses-head-motion-to-navigate-user-interface-on-iphone-x/)\n\n![](https://github.com/ebay/HeadGazeLib/blob/master/examples/demo/demo/video/teaser.gif)  \nThe above teaser is available at [example/demo](https://github.com/ebay/HeadGazeLib/tree/master/examples/demo).\n\n## Who May Wish to Use the Project\nAny iOS developer who would like to introduce head-based control to their app. Ideal for accessibility and game control.\n\n## Dependencies\niPhone X, iOS 11, Swift 4\n\n## How to use the library\n1. Simply copy and paste the entire folder `HeadGazeLib` to your xcode project.\n2. Extend your ViewController from `UIHeadGazeViewController` and change the button outlet reference class from `UIButton` to `UIHoverableButton` or `UIBubbleButton`\n```swift\nclass MyViewController: UIHeadGazeViewController{\n    @IBOutlet weak var myButton: UIBubbleButton! // UIButton!\n}\n```\n3. Similarily, change the button class from `UIButton` to `UIHoverableButton` or `UIBubbleButton` in the identity inspector of storyboard\n\n4. Define head gaze event handler through `UIHeadGazeRecognizer` instance in `MyViewController` class\n```swift\nclass MyViewController: UIHeadGazeViewController{\n//.....\n  private var headGazeRecognizer: UIHeadGazeRecognizer? = nil\n\n  override func viewDidLoad() {\n    super.viewDidLoad()\n    setupGestureRecognizer()\n  }\n  private func setupGestureRecognizer() {\n    // set button dwell duration\n    self.myButton.dwellDuration = 1 // in second\n    \n    // add head gaze recognizer to handle head gaze event\n    self.headGazeRecognizer = UIHeadGazeRecognizer()\n    \n    //Between [0,9]. Stablize the cursor reducing the wiggling noise.\n    //The higher the value the more smoothly the cursor moves.\n    super.virtualCursorView?.smoothness = 9\n    \n    super.virtualCursorView?.addGestureRecognizer(headGazeRecognizer)\n    self.headGazeRecognizer?.move = { [weak self] gaze in\n\n        self?.buttonAction(button: (self?.myButton)!, gaze: gaze)\n\n    }\n  }\n  private func buttonAction(button: UIButton, gaze: UIHeadGaze){\n    guard let button = button as? UIHoverableButton else { return }\n    // The button instance would trigger TouchUpInside event after user specified seconds\n    button.hover(gaze: gaze) \n  }\n  \n  @IBAction func myBtnTouchUpInside(_ sender: UIBubbleButton) {\n     print(\"Button clicked by head gaze.\")\n  }\n//....\n}\n```\n\nFor working demo, we have prepared three examples:\n1. demo: A simple jump start example showing how to empower a regular iOS app with head control with minimum code change.  \n2. HeadSwipe: A more serious example - swipe daily deal on eBay with head control  \n3. Sensitivity: An example on how to use `UIMultiFuncButton` to track the location and timestamp of the cursor as user is \"clicking\" the button. Useful for sensitivity analysis.  \n\n## Citation\n\nIf you find this work useful in your research, please consider citing:\n\nCicek, Muratcan, Jinrong Xie, Qiaosong Wang, and Robinson Piramuthu. \"Mobile Head Tracking for eCommerce and Beyond.\" arXiv preprint [arXiv:1812.07143 (2018)](http://arxiv.org/abs/1812.07143).\n\nBibTeX entry:\n```\n@article{cicek2018mobile,\n  title={Mobile Head Tracking for eCommerce and Beyond},\n  author={Cicek, Muratcan and Xie, Jinrong and Wang, Qiaosong and Piramuthu, Robinson},\n  journal={arXiv preprint arXiv:1812.07143},\n  year={2018}\n}\n```\n\n## License\nCopyright 2018 eBay Inc.  \nHeadGazeLib is available under the MIT license. See the LICENSE file for more info.\n\n## Developers\n[Jinrong Xie](http://jinrongxie.net/), [Muratcan Cicek](https://users.soe.ucsc.edu/~cicekm/), [Qiaosong Wang](https://github.com/qiaosongwang), [Robinson Piramuthu](https://github.com/rpiramuthu)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeBay%2FHeadGazeLib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FeBay%2FHeadGazeLib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeBay%2FHeadGazeLib/lists"}