Skip to content

PyTorch implementation of an encoder-decoder network that can recolor images based on context

Notifications You must be signed in to change notification settings

ShakirKhurshid/content-aware-recolor-Pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 

Repository files navigation

Content Aware Image Recolorization

A deep neural network which recolors an image according to a given target colour that is useful to express images in various colour concepts. The network is capable of performing a content-aware recolorization based on the target palette. The main features are:

  • A convolutional encoder that extracts features from the input image
  • A convolutional decoder that generates a colourized output image
  • A perceptual loss function that measures the similarity between the output and the ground truth images
  • A dataset loader that can handle different image formats and sizes

Results

Results a) The source image

b) The Target Palette

c) The recolorized image as per the target palette

Usage

Run DL2022/run.py as

python run.py -i 'path_to_input_image' -p 'hexcodes_of_color_palette' -m 'path_to_saved_model' -o 'path_of_output'

Example

python run.py -i 'Samples/3/3.png' -p '#507b71' '#6caebc' '#6ead9c' '#afd9c3' '#b8dfdc' '#ecebd7' -m 'saved_model/model.pth' -o 'output.jpg'

Refrence

PaletteNet: Image Recolorization with Given Color Palette

About

PyTorch implementation of an encoder-decoder network that can recolor images based on context

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published