AppleWatchFaceAIColorPicker Logo

AppleWatchFaceAIColorPicker (Beta)

Overview

This is a collection of tools that integrate the RaspberryPi computer, the Open-CV library, Apple Shortcuts, and either Apache web server or GitHub pages (depending on your preference) to take a picture of you, analyze three points on your shirt for color, and make that color avaialble to the Apple Shortcut to read and change your watch face to match.

The setup can be as efficient as standing in front of the camera and saying Hey Siri, change your face to have your watch face match your outfit every day

Required Hardware

  1. Raspberry Pi (Any model should do)
  2. USB Camera

Installation

Local Web Server Version (Recommended)

This version hosts a local web server that executes the camera, analysis, and results all locally. This is the most efficient version which uses an Apple Watch shortcut to initialize the camera, take a photo, analyze, retrieve the results, and change the watch face in one efficient shortcut.

Clone and Make the Package

  1. Run git clone https://github.com/organic-penguin/AppleWatchFaceAIColorPicker.git from your RaspberryPi
  2. Change directories into the newly created folder - cd AppleWatchFaceAIColorPicker
  3. Run the make file configuration for the local web server installation - make local_web

Apple Watch Shortcut

  1. Download the 'Change Your Face WEB' shortcut to your iPhone using this QR:

2. Adjust the shortcut with the approrpaite local hostname link and map your watch faces to the available colors 3. Edit the watch face sections to match your watch faces. Don't have a face to match the color? Just set it to your favorite color neutral face.

GitHub Version

This version uses a physical button to execute the camera, analysis, and push the results to a GitHub repo page. The Apple Watch shortcut will then have to be executed to retrieve the results from the GitHub page and change your watch face.

Setup a GitHub repository to host your GitHub page

  1. From your internet browser, log into GitHub
  2. Navigate to 'Your repositories'
  3. Click 'New'
  4. Enter a repository name
  5. Click 'Create Repository'
  6. Copy your new repositories .git url
  7. Move on to the next section

Clone and make the package

  1. Run git clone https://github.com/organic-penguin/AppleWatchFaceAIColorPicker.git from your RaspberryPi
  2. Change directories into the newly created folder - cd AppleWatchFaceAIColorPicker
  3. Edit the makefile to include your new github repo url in line 13 under 'add-to-repo:'
  4. Save and close the makefile
  5. Config your git global variables with your information $ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com
  6. Run the make file configuration for the GitHub installation - make git
  7. Push a commit - git push origin
  8. Enter your username and password (This will be saved locally so that the script can continually push to your repo)

Setup GitHub Pages

This step will setup your GitHub page so that the results pushed to your repo will be displayed as a webpage

  1. Return to your repo's settings tab
  2. Scroll down to 'GitHub Pages'
  3. Set the Source to your main branch
  4. Click 'Save'

Setup Camera Execution Button

Use your favorite starting framework to run the initializeButton.py on boot. The button is defaulted to pin GPIO pin 21 EX: rc.local

  1. Edit rc.local - sudo nano /etc/rc.local
  2. Add sudo python <path to initializeButton.py to the second to last line before exit 0
  3. Reboot to test button function

Apple Watch Shortcut

This shortcut will reachout to your GitHub page and analyze the results generated by the camera's execution button. Based upon the results it will set your watch to the appropriate face

  1. Download the 'Change Your Face GIT' shortcut to your iPhone using this QR:

2. Adjust the shortcut with the appropriate GitHub page link and map your watch faces to the available colors 3. Edit the watch face sections to match your watch faces. Don't have a face to match the color? Just set it to your favorite color neutral face.

Current Issues

  1. Color identification isn't 100% accurate in differentiating between similar colors
  2. Color identification is very dependent upon the quality of camera and lighting. If the image the camera captures shows a dark color, it may be interpreted as black (e.g. a blue shirt in dim lighting looks black in the captured image, but blue when in good light)

Credit

The OpenCV development community Murtaza Hassan's introductory courses