Skip to content

wrencanfly/masked-style-transfer

Repository files navigation

Masked Style-Transfer

The code is based on the style-transfer-pytorch, supporting masked image style transfer.

We also deployed the Optimal Transport Loss, and a masked seamless clone-style transfer method.

Also, support using a user word prompt to mask the given image automatically.

Usage

Detailed results can be found here:exp/results.ipynb

The main changes happened here: style_transfer/style_transfer.py

*To enable the mask mode and switch to a different loss function, please follow the comments in the codes.

Generate an image mask from the user language prompt

Detailed results can be found here: SAM _generate_mask/predictor_example.ipynb

User Prompt - "sheep" image

User Prompt - "bear" image

User Prompt - "chair" image

Results

  • Style Transfer with Optimal Transport Loss 1713906422558

  • Masked Style Transfer and Mask Strategies image

  • Naive Masekd Style Transfer and Mask Strategies image

  • MSE-Style Loss, Wasserstein-2 Loss, and Optimal Transport Loss image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published