Giter Club home page Giter Club logo

automaticdj's Introduction

Automatic DJ

AutomaticDJ

Automatic music selection system for people who love great music (even if they don't know it yet). Uses facial recognition and the Hunch API to build a custom playlist based on the tastes of the people at the party.

Take a picture of one of your friends at a party. The Face.com API maps the face to a Facebook ID. Given this ID, the Hunch API provides music (or movie, or picture, or food) recommendations (and it's scary accurate). Tailor your entire party to the taste of your guests. Play their theme song when they enter the room. Or discover new music recommendations that they would like. Note that you don't need to have music likes on your Facebook page, the Hunch API can infer taste based solely on the social graph.

The current version uses Spotify to play the songs (controlled via AppleScript), but once the playlist is generated you can use any music player to play the track. There is also minimal support in the code for playing songs through the GrooveShark API.

Other libraries used include:

Getting started

  1. In visage.py

    • Edit the section titled "edit me!" with youe Face.com API key and secret, Facebook session key, Facebook ID, and Hunch auth token
  2. Train your friends' faces

    • import visage
    • visage.train("http://www.facebook.com/gleitz")
  3. Take a photo, get the Facebook id of the user, get music recommendations from Hunch, and play the song using Spotify

    • visage.musicify()

Notes and gotchas

  • If you just want to test the photo -> FB id functionality, try calling visage.recognize()

  • Getting a FB session is a bit of a pain. Here's what I did:

    1. Create a Facebook App (make sure the Canvas Type is IFrame and Application Type is HTML5
    2. Set your site URL to http://gleitzman.com/faces/ (or a link of your choosing, I am just using this as a dummy)
    3. Go to this link, inserting your client_id where I have 'XXX' https://graph.facebook.com/oauth/authorize?client_id=XXX&redirect_uri=http%3A//gleitzman.com/faces/&scope=offline_access,email,user_birthday,user_about_me,user_education_history,user_interests,user_likes,user_location,user_religion_politics,user_website,user_work_history,user_checkins,friends_about_me,friends_likes,friends_birthday,friends_education_history,friends_checkins,user_photo_video_tags,user_photos,friends_photo_video_tags,friends_photos,friends_birthday,friends_location,friends_work_history,friends_education_history,friends_activities,friends_hometown,friends_interests,friends_location,friends_likes
    4. Note the code that is returned in the URL
    5. Exchange the code, your Facebook client id, and Facebook client secret for an infinite session https://graph.facebook.com/oauth/access_token?client_id=XXX&client_secret=XXX&code=XXX&redirect_uri=http%3A//gleitzman.com/faces/

automaticdj's People

Contributors

gleitz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.