LoCoPalettes: Local Control for Palette-based Image Editing (project page)
Computer Graphics Forum (CGF). Presented at EGSR 2023.
[By Cheng-Kang Ted Chao, Jason Klein, Jianchao Tan, Jose Echevarria, Yotam Gingold]
See demo video for our editing framework.
This repo is official code release for LoCoPalettes.
The contribution of this work:
- An approach to compute sparser weights, comprimising spatial coherence with sparsity, to achieve sparse color edits without much color leakage compared to state-of-the-art.
- An optimization framework that operates on our proposed palette hierarchy, enabling semantic color editing via placing color constraints.
You can install dependencies using conda.
Install Anaconda or Miniconda. (Miniconda is faster to install.) Choose the 64-bit Python 3.x version. Launch the Anaconda shell from the Start menu and navigate to this directory. Then:
conda env create -f environment.yml
conda activate locopalettes
To update an already created environment if the environment.yml file changes, first activate and then run conda env update --file environment.yml --prune.
First, we need to have features (.mat) files. To extract per-pixel features, please refer to Aksoy's code and run
sh run_extract_feat.sh
Then, we need to extract panoptic segments (followed by guided filtering), run
python panoptic.py <your_image>
This would create a folder named <sss_your_image> that contains segments under root -> classes -> instances hierarchy.
Then, run the below to extract all informations (i.e. palettes, weights, masks, activations, trees):
python func/seg.py <your_image> <your_feature> <sss_your_image> --o s --m fea
The above code generates all informations needed alongside GUI.py,
Finally, run
python GUI.py
After the GUI is loaded, follow the below order clicking:
(1) Load image
(2) Load features
(3) Load tree (choose arbitrary image from your <sss_your_image> folder)
This work is licensed under a Creative Commons Attribution 4.0 International License.