Giter Club home page Giter Club logo

pygist's Introduction

                    ##### pygist #####
A gist-based SVM image classifier based on Lear's GIST implementation.
For more information, see the README in the gist directory, or visit
http://people.csail.mit.edu/torralba/code/spatialenvelope/

This is part of the larger IBEIS project, which is available at
https://github.com/Erotemic/ibeis

To use pygist, first clone the repository:

git clone https://github.com/hjweide/pygist.git

cd pygist
mkdir test

Copy the images from ~/ibeis/ibeis/testdb1 into the test directory,
any other images are fine too, but these are easily available in the
IBEIS project.

Download a pre-trained model (approximately 75MB)
wget https://www.dropbox.com/s/mbqovlwsk2j1tws/.learned_model.pickle

In the terminal, run: python pygist.py

This will output the names of all files in your test directory, along
with a 1 or -1 classification of each.  An image marked with 1 indicates
that the image was accepted as consistent with the training set, and an 
image marked as -1 indicates that the image is not considered consistent
with the training set.

Example output using the above commands:

:~/ibeis/pygist$ time python pygist.py 
Stage 1: pre-classifying data using 5 classifiers...
Stage 2: final classification on 13 datapoints...
~/ibeis/pygist/test/hard2.JPG 1
~/ibeis/pygist/test/jeff.png -1
~/ibeis/pygist/test/polar1.jpg -1
~/ibeis/pygist/test/zebra.jpg 1
~/ibeis/pygist/test/hard1.JPG -1
~/ibeis/pygist/test/easy1.JPG 1
~/ibeis/pygist/test/easy2.JPG 1
~/ibeis/pygist/test/hard3.JPG -1
~/ibeis/pygist/test/lena.jpg -1
~/ibeis/pygist/test/polar2.jpg -1
~/ibeis/pygist/test/occl2.JPG -1
~/ibeis/pygist/test/occl1.JPG 1
~/ibeis/pygist/test/easy3.JPG 1

real    0m0.960s
user    0m0.820s
sys     0m0.136s

This model was trained using the IBEIS2014 dataset created by Jason Parham
and Hendrik Weideman as positive training examples, and a collection of images
posted under the most popular tags on Flickr as negative training examples.

Using 80% of the data as a training set and the remaining 20% for testing, the
classifier achieves an accuracy of approximately 90%.

To integrate this code with your own project is very simple:

import os
import pygist
target_dir = '~/ibeis/pygist/test'
imgpaths = [os.path.join(target_dir, f) for f in os.listdir(target_dir)]
results = pygist.test(imgpaths)
for img_name, result in zip(imgpaths, results):
    print img_name, result

pygist's People

Contributors

erotemic avatar hjweide avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

xieyanfu rzel

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.