hjweide / pygist Goto Github PK
View Code? Open in Web Editor NEWImage classifier using Lear's GIST implementation
Image classifier using Lear's GIST implementation
##### 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.