Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.
/ pin-head Public archive

📌 Pin with face sentiments! (Angular 2, Material, RxJS 5, Google Vision API)

License

Notifications You must be signed in to change notification settings

cyk/pin-head

Repository files navigation

PinHead
PinHead

Repin based on your face's emotion captured by webcam

Angular 2 Style Guide Build Status MIT license Dependency Status devDependency Status

Introduction

PinHead is an Angular2 app based on mgechev's seed project that repins based on your face's emotion captured by webcam and analyzed by Google's Vision API. This project is my active exploration of AngularJS and RxJS.

A little while ago I set out on a journey learning about this extremely sweet and clever kitten that is Angular 2. Not too long ago Google released its Vision API sentiment analysis. I wanted to focus on Angular 2 with RxJS, so a server-less backend was a convenient way to avoid scope creep. I took a brief detour to set up a rudimentary server-less API endpoint that analyzes an image for facial sentiment. For more details on this, check out the gist on Face Sentiments with Google Vision API via AWS API Gateway and Lambda.

⚠️ Work in progress Though the basic functionality is implemented, there is still much to do (and for me to learn). Pull requests are welcome and appreciated!

You can check out the latest version by visiting pin-head.cyk.im — it requires camera access and a Pinterest account with boards (owned and followed).

How does it work?

After choosing a board to pin from and a board to pin to, a pin will be presented every few seconds. Then, behind the scenes...

  1. A snapshot from your browser camera is taken
  2. The snapshot is encoded and sent off to a sentiment endpoint
  3. The Google Vision API then analyzes the image for faces and their sentiments
  4. If the likeliest sentiment is JOY then the related pin in pinned to you board.

Obviously, it works best with kittens and puppies. 😉

Screenshot

Demo

How to Contribute

Prerequisites

You'll need a Pinterest App and the Google Vision API via AWS API Gateway and Lambda. Once you have a Pinterest app id and a sentiments endpoint, update the project.config.ts file.

Install dependencies

$ npm install

Run app

$ npm start

Please refer to the mgechev/angular2-seed documentation for additional setup and usage instructions.

Technologies

Frameworks, libraries, and web APIs used:

Pinhead icon by Icons8

License

MIT