Git Product home page Git Product logo

mesnico / learning-relationship-aware-visual-features Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 2.0 1.5 MB

Relational Content-Based Image Retrieval (R-CBIR) - Retrieving images with given relationships among objects

License: MIT License

Shell 10.04% Python 89.96%
eccv-2018 image-processing computer-vision deep-learning pytorch deep-features deep-feature-extraction clevr relationship-extraction relationships relational-reasoning

learning-relationship-aware-visual-features's Introduction

Learning Relationship-aware Visual Features

This repository contains the code for reproducing results from our paper (PDF preprint).

In this work we present a novel task called Relational Content-Based Image Retrieval (R-CBIR), that consists in retrieving images with given relationships among objects. We extracted visual relational features from Relation Network (RN) by Santoro et al. for use as a baseline on R-CBIR. Then, we slightly modified the original RN introducing a 2-stage RN (2S-RN). Features extracted from the 2S-RN architecture defined the current state-of-the-art on R-CBIR.

Please visit our paper website rcbir.org for an interactive browsing interface showing R-CBIR results for different query images. r-cbir

Get ready

  1. Download and extract CLEVR_v1.0 dataset: http://cs.stanford.edu/people/jcjohns/clevr/

  2. Download this repository and all submodules with

    git clone --recursive https://github.com/mesnico/learning-relationship-aware-visual-features
    

    This will also download RelationNetworks-CLEVR repository as a submodule in the cloned directory.

  3. Install virtualenv, if you haven't already:

    sudo pip3 install virtualenv 
    
  4. Move into the cloned repository and run:

    ./setup.sh path/to/CLEVR_v1.0
    

    substituting path/to/CLEVR_v1.0 with the path to your CLEVR extracted folder. This script will download RMAC features for CLEVR dataset and precalculated GED distances (ground-truth). Then, it will extract features from 2S-RN using pretrained IR model.

Results

Spearman-Rho correlation

In order to reproduce Spearman-Rho correlation values for RMAC, RN and 2S-RN features against the generated GT, run

./compute_results.sh -d path/to/CLEVR_v1.0

This script will compute distances, rankings and correlation values for both soft and hard matches.

NOTE:The first time this script is run may take some time; once finished, results are cached and final Spearman-Rho metrics will be immediately available at every successive run.

This script prints Spearman-Rho correlation values in the current terminal and creates a graphical visualization storing it in pdf files in the output folder.

In order to modify parameters such as start and end query indexes or number of processes used to compute GED distances, run

./compute_results.sh -h

Visual Feedback

It is possible to view the top relevant images using RMAC, RN and 2S-RN features, for a bunch of query images.

./compute_visual_results.sh -d path/to/CLEVR_v1.0

This script will create a pdf file in the output folder called visual_results.pdf showing retrieval results for every query image. By default, only 10 query images are used. In order to change the range for query images you can specify parameters -s and -e. For more informations, run

./compute_visual_results.sh -h

learning-relationship-aware-visual-features's People

Contributors

mesnico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.