Coder Social home page Coder Social logo

ls-simon / smart-mirror Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 0.0 12.29 MB

Smart Mirror app predicting and suggesting cloth items.

JavaScript 91.14% CSS 2.20% HTML 6.26% Shell 0.40%
raspberry-pi nodejs watson-conversation watson-tone-analyzer watson-speech watson-conversation-service clothes-detector watson-visual-recognition smart-mirror

smart-mirror's Introduction

Smart Mirror

This smart mirror is a voice chatbot who can tell which cloth item the user is wearing and suggest an additional cloth item that fits.

Hardware

There are many examples on how to build your own smart mirror. The hardware requirements for this project are:

  • Raspberry Pi
  • Camera compenent
  • USB microphone
  • Monitor
  • Speaker or sound through HDMI.

Installation

To install all required libraries, run npm install

To try out the app, run npm start. Next, open up a browser and go to localhost:6005

Notes:

  • The app only works after setting up the IBM Watson service environment (see IBM Watson)
  • If the project does not run, try installing nodemon globally by running npm install -g nodemon or simply run npm run index.js

Unit test

Chai is the testing framework used for this project.

All tests are found in /test

To see the test results, run npm test

IBM Watson

Smart Mirror is relying on IBM Watson services for chatbot, text and speech translation, tone analyzation and visual recognition functionality.

Bluemix console

To connect the app with the services, make an account at IBM and go to the Bluemix developer console.

Create a Bluemix app and tie instances of the following services to it:

  • Text-to-Speech
  • Speech-to-Text
  • Tone Analyzer
  • Cloud Storage (optional if other database will be provided for the classification model)
  • Conversation
  • Visual Recognition

Smart mirror app

Copy all the credentials provided with each instance and paste them into
controller/watson_environment.json

Conversation API

Make a workspace with cURL or the Watson Assistant tool. The flow should consist of nodes with sets of clothes that match, and associated child nodes with the result cases.

Example

Intents

The conversation flow and behaviour of the app is relying heavily on intents for user messages and communication between Conversation and Visual Recognition API. All classification results are sent to Conversation with an intent that tells Conversation whether it was the first or second picture. This is in order to customize a response to a given classification.

Main intents in Conversation for critical functionality are:

  • #pictureAnalyzeRequest: the user wishes to take a picture.

  • #suggestClothing: an intent sent with one classification result from the app. This will be targeted to an entry node.

  • #takeSecondPicture: the user wishes to take a second and final picture to evaluate the first and second cloth choice.

  • #clothResult: an intent sent with two classification results. This intent is targeted at a child node of a given cloth item node.

Error handling in Conversation

The app is set up to handling certain errors with a customized response in Conversation. To catch these errors, make separate nodes catching the intents:

  • #ERRORINCLASSIFICATION: response from Visual Recognition is empty.

  • #ERRORTRANSCRIBING response from Speech-to-Text is empty.

Visual Recognition

Make a model within a project and paste the model ID into controller/watson_environment.json

Note: be sure to name the classes identical to your targeted entities in the Conversation workspace.

smart-mirror's People

Contributors

ls-simon avatar

Stargazers

Entrapta Jones avatar Yasin ATEŞ avatar BC 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.