Skip to content

Apply style transfer selectively on certain objects of an image

Notifications You must be signed in to change notification settings

gael-vanderlee/StyleSegments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


StyleSegments

Apply style transfer selectively on certain objects of an image
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

This project aims to use the best models in image segmentation and neural style transfer to selectively apply style transfer on certain objects or parts of an image.

Input Image Input Style Output image

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • For virtual envs: Pipenv
    pip install --user pipenv

Or use your virtual environment manager of choice, requirements are in the Pipfile

Installation

  1. Clone the repo
    git clone https://github.com/Gvanderl/StyleSegments.git
  2. Install packages
    pipenv install
  3. Run the script
    pipenv shell
    pipenv main.py

Usage

To change the images to process, models used, or the classes to stylize all you have to do is change the variable in config.py In our example, we have:

images = ["cat.jpg"]

ims_config = {
    "cat.jpg": {
        "seg_models": ["VOC"],
        "styles": ["cartoon.jpg"],
        "class": [8]
    }
}

The images names in the images list will be processed according to their config in ims_config.

  • seg_models are the models to try on this image for segmentation. As of now, the supported models are "ADE20k", "Cityscapes" and "VOC":
  • styles are the styles images to try on this image found in input/styles.
  • class is the class to stylize for each model, this is model dependent. Here, for the VOC model, class 8 is cats.

All the input and output paths and folder can also be found and modified in config.py.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Project Link: https://github.com/Gvanderl/StyleSegments

Acknowledgements

LinkedIn

About

Apply style transfer selectively on certain objects of an image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages