All Projects → mahmoudnafifi → Image_recoloring

mahmoudnafifi / Image_recoloring

Licence: MIT license
Image Recoloring Based on Object Color Distributions (Eurographics 2019)

Programming Languages

matlab
3953 projects
C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Image recoloring

HistoGAN
Reference code for the paper HistoGAN: Controlling Colors of GAN-Generated and Real Images via Color Histograms (CVPR 2021).
Stars: ✭ 158 (+426.67%)
Mutual labels:  image-editing, style-transfer, image-manipulation, color-transfer, image-recoloring
color-aware-style-transfer
Reference code for the paper CAMS: Color-Aware Multi-Style Transfer.
Stars: ✭ 36 (+20%)
Mutual labels:  style-transfer, image-manipulation, color-transfer
ManTraNet-pytorch
Implementation of the famous Image Manipulation\Forgery Detector "ManTraNet" in Pytorch
Stars: ✭ 47 (+56.67%)
Mutual labels:  image-editing, image-manipulation
Tsit
[ECCV 2020 Spotlight] A Simple and Versatile Framework for Image-to-Image Translation
Stars: ✭ 141 (+370%)
Mutual labels:  style-transfer, image-manipulation
SDEdit
PyTorch implementation for SDEdit: Image Synthesis and Editing with Stochastic Differential Equations
Stars: ✭ 394 (+1213.33%)
Mutual labels:  image-editing, image-manipulation
Jspaint
🎨 Classic MS Paint, REVIVED + ✨Extras
Stars: ✭ 5,972 (+19806.67%)
Mutual labels:  image-editing, image-manipulation
HFGI
CVPR 2022 HFGI: High-Fidelity GAN Inversion for Image Attribute Editing
Stars: ✭ 384 (+1180%)
Mutual labels:  image-editing, image-manipulation
simsg
Semantic Image Manipulation using Scene Graphs (CVPR 2020)
Stars: ✭ 49 (+63.33%)
Mutual labels:  image-manipulation
badgemaker
Telegram bot that turns your pictures into Ingress badges
Stars: ✭ 13 (-56.67%)
Mutual labels:  image-manipulation
scikit tt
Tensor Train Toolbox
Stars: ✭ 52 (+73.33%)
Mutual labels:  data-driven
ColorTranslator
A JavaScript library, written in TypeScript, to convert among different color models
Stars: ✭ 34 (+13.33%)
Mutual labels:  color-manipulation
image-titler
An image title generator using The Renegade Coder style
Stars: ✭ 15 (-50%)
Mutual labels:  image-manipulation
Wasserstein2GenerativeNetworks
PyTorch implementation of "Wasserstein-2 Generative Networks" (ICLR 2021)
Stars: ✭ 38 (+26.67%)
Mutual labels:  style-transfer
Hidden-Eye
Hide data into Picture
Stars: ✭ 39 (+30%)
Mutual labels:  image-manipulation
STYLER
Official repository of STYLER: Style Factor Modeling with Rapidity and Robustness via Speech Decomposition for Expressive and Controllable Neural Text to Speech, INTERSPEECH 2021
Stars: ✭ 105 (+250%)
Mutual labels:  style-transfer
VoxelGamesLibv2
Powerful, feature-packed, abstract and expandable Minecraft minigames framework.
Stars: ✭ 67 (+123.33%)
Mutual labels:  data-driven
linguistic-style-transfer-pytorch
Implementation of "Disentangled Representation Learning for Non-Parallel Text Style Transfer(ACL 2019)" in Pytorch
Stars: ✭ 55 (+83.33%)
Mutual labels:  style-transfer
lewis
Official code for LEWIS, from: "LEWIS: Levenshtein Editing for Unsupervised Text Style Transfer", ACL-IJCNLP 2021 Findings by Machel Reid and Victor Zhong
Stars: ✭ 22 (-26.67%)
Mutual labels:  style-transfer
ImagingKit
Java library for imaging tasks that integrates well with the java.awt.image environment
Stars: ✭ 16 (-46.67%)
Mutual labels:  image-manipulation
uploadcare-ios
UploadcareKit: iOS SDK for Uploadcare API
Stars: ✭ 24 (-20%)
Mutual labels:  image-manipulation

Image Recoloring Based on Object Color Distributions

Mahmoud Afifi1, Brian Price2, Scott Cohen2, and Michael S. Brown1

1York University 2Adobe Research

Project page

main figure

Abstract

We present a method to perform automatic image recoloring based on the distribution of colors associated with objects present in an image. For example, when recoloring an image containing a sky object, our method incorporates the observation that objects of class 'sky' have a color distribution with three dominant modes for blue (daytime), yellow/red (dusk/dawn), and dark (nighttime). Our work leverages recent deep-learning methods that can perform reasonably accurate object-level segmentation. By using the images in datasets used to train deep-learning object segmentation methods, we are able to model the color distribution of each object class in the dataset. Given a new input image and its associated semantic segmentation (i.e., object mask), we perform color transfer to map the input image color histogram to a set of target color histograms that were constructed based on the learned color distribution of the objects in the image. We show that our framework is able to produce compelling color variations that are often more interesting and unique than results produced by existing methods.

Quick start

View Image recoloring without a target image on File Exchange

  1. Run install_p1
  2. Run install_p2
  3. Go to the demo directory and copy your input images to input_images directory
  4. Run demo_recoloring
  5. The recolored images will be in the recolored_images directory and the generated semantic masks will be in output_masks directory.
  6. Run demo_GUI for our interactive GUI version.

Manual installation

  1. Install RefineNet for semantic segmentation.
  2. Download the trained model for ADE20k dataset. In our experiments, we used the ResNet-152 model.
  3. Create a directory and name it SS_CNN. This directory should contain the RefineNet direcotry after installing RefineNet and MatConvNet (prerequisite for RefineNet). For example, the read me file of RefineNet should be located in the following path SS_CNN/RefineNet/README.md
  4. Use the following matlab code to add paths for our sub-directories:
       current = pwd;
       addpath([current '/colour-transfer-master']);
       addpath([current '/cp']);
       addpath([current '/emd']);
       addpath([current '/getMask']);
       addpath([current '/recoloring']);
       addpath([current '/general']);
       savepath
  1. Compile mex files for the Earth Mover's Distance (EMD) files located in the emd directory. Use the following Matlab code:
        mex EMD1.cpp
        mex EMD2.cpp
        mex EMD3.cpp

Be sure that you select MinGW for C++ Mex file compiling. To change it, use the following Matlab command:

        mex -setup C++
  1. Download Scene Parsing dataset (we only use the training set which includes training images/semantic masks). The dataset should be located in the following path ../ADEChallengeData2016 (assuming you are located in the root directory of our source code). For example, you should be able to read the first training image ADE_train_00000001.jpg and its semantic mask by writing the following Matlab code:
        I = imread(fullfile('..','ADEChallengeData2016','images','training','ADE_train_00000001.jpg'));
        M = imread(fullfile('..','ADEChallengeData2016','annotations','training','ADE_train_00000001.png'));
  1. Download our pre-computed data that includes the distribution of object color distributions (DoD) from here (also, is available here). Make sure that you locate the DoD data in the following path ../data/DoD_data (assuming you are located in the root directory of our source code). For example, you should be able to load the first cluster data by writing the following Matlab code:
        load(fullfile('..','data','DoD_data','airplane_clust_1.mat'));

GUI

GUI_DoD Try our GUI version which includes the following features:

  1. Semantic mask adjustment: You can adjust the semantic mask in an interactive way (semi-automated and manual adjustments are provided).
  2. Selecting primary object: You can select the primary object to get different results.

To test it, run demo_GUI from the demo directory.

Publication

If you use this code, please cite our paper:

Mahmoud Afifi, Brian Price, Scott Cohen, and Michael S. Brown, Image Recoloring Based on Object Color Distributions, Eurographics 2019 - Short Papers, 2019

@inproceedings {afifi2019imageRecoloring,
booktitle = {Eurographics 2019 - Short Papers},
title = {{Image Recoloring Based on Object Color Distributions}},
author = {Afifi, Mahmoud and Price, Brian and Cohen, Scott and Brown, Michael S.},
year = {2019},
publisher = {The Eurographics Association},
ISSN = {1017-4656},
DOI = {10.2312/egs.20191008}
}

Related Research Projects

  • HistoGAN: A method to control colors of GAN and real images. Image auto recoloring is one of its applications.
  • CAMS: A color-aware multi-style transfer method.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].