GithubHelp home page GithubHelp logo

oscarlorentzon / repstruct Goto Github PK

View Code? Open in Web Editor NEW
2.0 0.0 0.0 4.15 MB

Python library for finding representative structures in image collections

License: Other

Python 99.80% Shell 0.20%
image-retrieval descriptor pca-analysis python bag-of-visual-words

repstruct's Introduction

About repstruct

Repstruct is a python library for finding representative structures in large image collections. It is implemented according to the theory of the Master's thesis Finding reprensentative structures in large image collections by Oscar Lorentzon and Nils Lundahl.

The results are obtained by an approach using bags of visual words and colors. The implementation extracts SIFT descriptors as well as colors from the images in the collection and creates feature vectors from histograms created by classifying the features against training data. A collection of images is downloaded from Flickr for a specified tag and the results of the algorithm are presented by plotting the group of closest images and then the most representative.

Running

To be able to download images from Flickr an API key is required. An API key can be requested from Flickr's App Garden.

The rsbundler file can be run from the command line in the following way:

bin/run TAG -a FLICKR_API_KEY

The API key can also be provided by adding a text file called flickr_key.txt with the API key in the root of the project. Then the bundler can be run as follows:

bin/run TAG

To view additional bundler options run the bundler with the -h flag:

bin/run -h

Continuous integration

Build Status Coverage Status

Dependencies

You need to have Python 2.7+ and the following libraries to run the algorithm:

The following libraries are required to run the tests:

Installing dependencies on Ubuntu

  1. OpenCV - Install by following the steps in the Ubuntu OpenCV installation guide.

  2. NumPy, SciPy, PyYAML, Enum34, Setuptools, Mock, Nose and Matplotlib - Install pip and run:

     sudo apt-get install gfortran
     sudo pip install -r requirements.txt
     sudo apt-get install python-matplotlib
    

Example output

The images below show the result from a run using the tag steppyramid. The first output image shows the collection images plotted against their feature vector projection onto the third and fourth principal components.

PCA

The second output image shows the result after running the algorithm. On top all collection images are shown, in the middle the thirty closest images are shown and at the bottom the five most representative images are shown.

Representative

The third output image shows the result for finding all structures ordered according to a score based on the representative result.

Structures

repstruct's People

Contributors

oscarlorentzon avatar

Stargazers

 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.