Skip to content
/ libcom Public

Image composition toolbox: everything you want to know about image composition or object insertion

License

Notifications You must be signed in to change notification settings

bcmi/libcom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

libcom is an image composition toolbox covering various related tasks, including naive image composition, image blending, color transfer, image harmonization, painterly harmonization, object placement, etc. Detailed technical details and api descriptions can be found in the official [documents].

Usage

Create runtime environment

git clone https://github.com/bcmi/libcom.git
cd libcom/requirements
conda env create -f libcom.yaml
conda activate Libcom
pip install -r runtime.txt # -i https://pypi.tuna.tsinghua.edu.cn/simple
# install a specific version of taming-transformers from source code
cd ../libcom/controllable_composition/source/ControlCom/src/taming-transformers
python setup.py install

Installation

pip install libcom

or

python setup.py install

After that, you can verify the installation by running:

cd tests
sh run_all_tests.sh

The visualization results can be found in results folder.

Download pretrained models

During using the toolbox, the pretrained models and related files will be automatically downloaded to the installation directory. Note downloading the pretrained models may take some time when you first call some models, especially ControlComModel and PainterlyHarmonizationModel.

Alternatively, you can download these files from [Modelscope] or [Huggingface] in advance, and move them to the installation directory.