Skip to content

sammoh94/cuddly-guacamole

Repository files navigation

Entrance Music

Connects to a camera and runs facial recognition software to play specific songs/artists/playlists on Spotify

Getting Started

Pre-Requisites

  1. face-recognition: 1.3.0
    • Python 3.3+ or Python 2.7 (Note: This library works in Python 2.7, but the project runs Python 3+)
    • macOS or Linux (Windows not officially supported, but might work)
    • have dlib installed
  2. spotipy: 2.16.1
  3. Have a Spotify Premium account
  4. Sign up for a Spotify developer account

Setup

Clone this repository

git clone git@github.com:sammoh94/cuddly-guacamole.git

Create a new app in your Spotify developer account and take note of your client ID and secret key. Make sure to also add a Redirect URI to your project by clicking the edit button on your app (the default used for this project is https://www.google.com, but any valid URL should work).

API Reference

face-recognition download
face-recognition documentation

Run the following in your terminal/command prompt:

pip install face-recognition
or
python3 -m pip install face-recognition

spotipy download
spotipy documentation

Run the following in your terminal/command prompt:

pip install spotipy
or
python3 -m pip install spotipy

How to Use

  1. Navigate to the local repository:

    cd cuddly_guacamole/

  2. Run make setup from the terminal to create required files and directories if they do not already exist:

    make setup

  3. In your text editor, manually enter your client ID and secret ID into the keys.txt file (see keys.txt.sample file for proper formatting)

  4. Manually add images of people you want to store in your database to the known_people directory that was just created. Files must be named with the form 'firstName lastName.jpg' (e.g. Alec Echevarria.jpg).

  5. Run make build from the terminal to build your database that maps names to face encodings and music selections:

    make build

Note The user will be prompted to input song and artist information for every .jpg file in the known_people directory. If the song is not found (spelled incorrectly or not on Spotify), the user will be prompted to try again.

  1. Run make test-playback from the terminal to ensure that you can connect to the Spotify web API and playback music:

    make test-playback

  2. Run make run from the terminal to run the facial recognition program and playback music from Spotify for all recognized faces.

    make run

Note The user will be asked if they want to update favorite track information for anyone in the known_people directory. If so, type Y and input the new information. Else, type N.

  1. Whenever you add new photos to your known_people directory, be sure to update the database by running make build in the terminal:

    make build

Note Type make or make help in the terminal to see what each rule in the Makefile does:

make or make help

Contributors

Alec Echevarria
Samarth Mohan

License

This project is licensed under the MIT License - see the LICENSE file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors