Skip to content

Image translation model using CycleGAN architecture coupled with perceptual style loss

Notifications You must be signed in to change notification settings

adwaitgondhalekar/img2img-translation-with-style-loss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unpaired Image to Image Translation using Perceptual Style Loss

Translating Images from one domain to other has been attempted with various methods, one such interesting method employed in recent times is CycleGAN. In CycleGAN two Generators are trained simultaneously, one for the forward mapping between the domains and one for the reverse mapping, which allows introduction of an additional loss term "Cyclic Consistency Loss" enabling both the Generators to learn the transformation effectively. Due to the CycleGAN architecture, explicit Image pairs from both the domains are not required during training, the only requirement is presence of two sets each having images from Domain 1 and 2 respectively. CycleGAN implementation as done in Original Paper gave us good results, but our introduction of additonal loss term "Perceptual Style Loss" ( inspired from 1 and 2 ) in the overall GAN loss, gave us even better results. Cubist and Impressionist domains of images/paintings are considered in our implementation.

Getting Started

Prerequisites

  • Python 3.10+
  • Dependencies as given in requirements
  • Dataset containing images from both domains
  • Directory structure to be used for the dataset inside project directory
    ├── data                  
        ├── trainA       #to contain images from domain A                    
        ├── trainB       #to contain images from domain B

Results

  • Images labeled as "Original X" correspond to Cubist Images.

  • Images labeled as "Original Y" correspond to Impressionist Images.

  • Images labeled as "Transformed X" correspond to Cubist Images translated to Impressionist Images.

  • Images labeled as "Transformed Y" correspond to Impressionist Images translated to Cubist Images.

  • Images labeled as "Reconstructed X" correspond to Cubist Images that went through Cyclic translation
    (Cubist->Impressionist->Cubist).

  • Images labeled as "Reconstructed Y" correspond to Impressionist Images that went through Cyclic translation
    (Impressionist->Cubist->Impressionist).

result 1

result 2

result 3

result 4

Explanation

Project Report

Contributors

About

Image translation model using CycleGAN architecture coupled with perceptual style loss

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published