Apply style transfer selectively on certain objects of an image
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
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 |
---|---|---|
To get a local copy up and running follow these simple steps.
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
- Clone the repo
git clone https://github.com/Gvanderl/StyleSegments.git
- Install packages
pipenv install
- Run the script
pipenv shell pipenv main.py
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.
See the open issues for a list of proposed features (and known issues).
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Project Link: https://github.com/Gvanderl/StyleSegments