GithubHelp home page GithubHelp logo

panicooo / imgpedia Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scferrada/imgpedia

0.0 1.0 0.0 25 KB

Reference implementations for visual descriptors of IMGpedia

License: GNU General Public License v3.0

C++ 33.53% Java 39.66% Python 26.81%

imgpedia's Introduction

IMGpedia Descriptors

Reference implementations for visual descriptors used in the IMGpedia project. These are made publicly available as an effort to bring the Image Analysis process closer to the Semantic Web community. Although these implementations can be used by anyone under GNU GPL license

About the descriptors

######Gray Histogram Descriptor: Images are partitioned in a fixed amount of blocks. Per each block a histogram of gray intensity is computed, typically intensity takes 8 bit values. Finally, the descriptor is the concatenation of all histograms. ######Oriented Gradients Descriptor: Image gradient is calculated via convolution with Sobel kernels. A threshold is then applied to the gradient, and for those pixels that exceed it, the orientation of the gradient is calculated. Finally, a histogram of the orientations is computed and is used as the descriptor. ######Edge Histogram Descriptor: For each 2 ร— 2 pixel block, the dominant edge orientation is computed (horizontal, vertical, both diagonals or none), where the descriptor is a histogram of these orientations. ######DeCAF7: Uses a Caffe neural network pre-trained with the Imagenet dataset. To obtain the vector, each image is resized and ten overlapping patches are extracted, each patch is given as input to the neural network and the last selfconvolutional layer of the model is extracted as a descriptor, so the final vector is the average of the layers for all the patches

Dependencies

In order to get the code working a few dependencies are needed:

  • OpenCV This is the main dependency for all descriptors. Our code works with version 2.4.11 or superior. For installation instructions, please refer to the official documentation for OpenCV in Linux, Windows. Or Install just python bindigs if you like.

  • Caffe This is only needed for the neural networks used to extract DeCAF7, so, if you will not use it, there is no need to install Caffe. Otherwise, you can found installation instructions here

And that's it, once you've installed OpenCV and Caffe, all algorithms should run in your preferred language

Usage

Both python and java implementations are objects that inherits of superclass DescriptorComputer which defines the abstract method compute that is implemented following the algorithms for each descriptor so, in order to compute the descriptor vector of an image you should do something like (in python, java syntax can be inferred):

computer = GrayHistogramComputer(2,2,32)
img = cv2.imread("image.jpg")
descriptor = computer.compute(img) #so descriptor is a vector of 2 x 2 x 32 dimensions

C++ implementation consist only on functions that can be imported and used with no object orientation.

Finally, any doubt you have with the process, e-mail me to: sferrada [at] dcc [dot] uchile [dot] cl

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.