Git Product home page Git Product logo

pyimageclassification's Introduction

Sentimagi Python Image Analysis Library

Requirements

sudo apt-get install python-skimage sudo pip install svgwrite sudo apt-get install python-pywt

General

This library can be used for general image classification and feature extraction.

Feature extraction:

Extract and plot features from a single file

python featureExtraction.py -featuresFile sampledata/spectrograms/music/m_5_r_139.png

Extract features from two files and compare

python featureExtraction.py -featuresFilesCompare sampledata/spectrograms/music/m_5_r_139.png sampledata/spectrograms/speech/kill_bill_2_speech_17.png

Extract features from a set of images stored in a folder

python featureExtraction.py -featuresDir sampledata/spectrograms2/music/

Extract features from a set of directories, each one defining an image class

python featureExtraction.py -featuresDirs spectrograms sampledata/spectrograms/music sampledata/spectrograms/speech

(Features are stored in file "sectrograms_features")

Training and testing classification - regression models:

Train an image classification model

Models are trained from samples stored in folders (one folder per class).

Examples:

  • kNN model training
python train.py -train knn knnSpeechMusicSpecs  sampledata/spectrograms/music sampledata/spectrograms/speech

The above example trains a kNN classification model, does cross validation to estimate the best parameter (k value) and stores the model in a file (named knn3Classes).

  • SVM model training
python train.py -train svm svmSpeechMusicSpecs  sampledata/spectrograms/music sampledata/spectrograms/speech

The above example trains an SVM classification model, does cross validation to estimate the best parameter (C value) and stores the model in a file (named svmSentimentAds).

Classify an unknown image examples

python train.py -classifyFile knn knnSpeechMusicSpecs sampledata/music.melodies_snatch_0081.png
python train.py -classifyFile knn knnSpeechMusicSpecs sampledata/s_30_r_335.png

pyimageclassification's People

Contributors

tyiannak avatar

Watchers

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