Git Product home page Git Product logo

gray-image-retrieval's Introduction

Gray Image Retrieval

This is the implementation of "Color Reference Recommendation" in the paper Deep Exemplar-based Colorization.

Introduction

Given a gray input image, Gray Image Retrieval is to search its similar images in semantic content and photometric luminance from ImageNet.

image

The proposed method consists of two ranking steps, Global Ranking which filters out dissimilar images within the same class, and Local Ranking which further prunes the candidates with large difference in spatial layouts and illuminance.

The input is either gray or color image (but it will be automatically converted to gray in the code), and the output is a text file saving the names of its top-N similar images in ImageNet.

Getting Started

Prerequisites

  • Windows (64bit)
  • NVIDIA GPU (CUDA 8.0 & CuDNN 6.0)
  • Visual Studio 2013
  • Python 2.7
  • Matlab R2017
  • OpenCV 2.4.10

Build

(1) Compile pycaffe:

(2) Install the Matlab engine for Python:

(3) Compile Search.dll:

  • Compile source/search/main.cpp (OpenCV 2.4.10 library required) in Visual Studio 2013 to generate Search.dll;
  • Replace the precompiled Search.dll in build/search/.

Download Models

You need to download models and compressed feature database of ImageNet before running a demo.

Demo

  • We prepare an example under the folder demo/ with an input gray images folder test/imgs/ and its output folder test/pairs/.

  • Go to root directory and run test.py:

    python test.py --in_path [INPUT_IMAGE_FOLDER] --out_path [OUTPUT_FILE_FOLDER] --model_path [MODEL_FOLDER] --imagenet_path [IMAGENET_FEATURE_DATABASE] --gpu_id [GPU_ID]
    
    e.g., python test.py --in_path demo/test/imgs/ --out_path demo/test/pairs/ --model_path model/vgg_19_gray_bn/ --imagenet_path demo/ImageNet/ --gpu_id 0
    

Note

To serve for the purpose of colorization reference recommendation, the input images will be converted to gray images for searching whether it is colorful or not. The classification on gray images may be worse than color images.

Citation

If you find Gray Image Retrieval helpful for your research, please consider citing:

@article{he2018deep,
  title={Deep exemplar-based colorization},
  author={He, Mingming and Chen, Dongdong and Liao, Jing and Sander, Pedro V and Yuan, Lu},
  journal={ACM Transactions on Graphics (TOG)},
  volume={37},
  number={4},
  pages={47},
  year={2018},
  publisher={ACM}
}

gray-image-retrieval's People

Contributors

hmmlillian 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.