Giter VIP home page Giter VIP logo

colorrecognizer's Introduction

Color Recognizer

This program is written for learning purpose of building the naturally inteligent system, e.g. cognitive architecture.

Goal is to classify the colors based on any neural network algorhytm with web camera input.

How it works

Program reads a web camera and analyze the images in real time while user can annotate images also in real time.

For annotation one has to place a object in front of camera. Best practice is to place object as close as possible to gain a flat color in camera window. The it is computed average RGB value from the image and a) predict the color or b) user can annotate the color by him/her self by pressing the keyboard as follows:

Color Shortcut
White w
Black k
Red r
Green g
Blue b
Orange o
Purple p
Violet v

For quit the program just press ESC key while focused on main window.

Neuronal network

It was used a Decision Tree Classifier for training neuronal network because of it is easy interpretation and exploring the meaning of the classification at the begining.

This is the setup (actually the basic one):

DecisionTreeClassifier(class_weight=None, criterion='gini', max_depth=None,
            max_features=None, max_leaf_nodes=None,
            min_impurity_decrease=0.0, min_impurity_split=None,
            min_samples_leaf=1, min_samples_split=2,
            min_weight_fraction_leaf=0.0, presort=False, random_state=None,
            splitter='best')

Each session is saved and on the start of another one classifier is trained again to strength the classification.

This is link to documentation page to Decision Tree Classifier in Scikit-learn library.

Decision tree classificator vizualization:

https://github.com/neuropacabra/ColorRecognizer/blob/doc/color_model_graph.png?raw=true

Dependecies

  • Python 3.6
  • OpenCV 2
  • NumPy
  • Scikit-learn
  • Web camera (obviously)

Running

Open the code color_recognizer.py in any Python IDE or editor and simply run it. Or you can navigate by terminal into direction of file and run it by python3 color_recognizer.py

Demo

This is a real demo of early training (e.g., 50-60 per training images per color)

https://github.com/neuropacabra/ColorRecognizer/blob/doc/cr_demo_training_01.gif?raw=true

colorrecognizer's People

Watchers

James Cloos avatar  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.