-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68def2c
commit dca1d3d
Showing
5 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# GET STARTED | ||
|
||
## Create runtime environment | ||
|
||
```shell | ||
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 | ||
```shell | ||
pip install libcom | ||
``` | ||
or | ||
```shell | ||
python setup.py install | ||
``` | ||
After that, you can verify the installation by running: | ||
```shell | ||
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]](https://modelscope.cn/models/bcmizb/Libcom_pretrained_models/files) or [[Huggingface]](https://huggingface.co/BCMIZB/Libcom_pretrained_models/tree/main) in advance, and move them to the installation directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# OVERVIEW | ||
|
||
This chapter introduces you to the libcom toolbox, and provides links to detailed tutorials about libcom. | ||
|
||
## Introduction | ||
|
||
![image](../resources/image_composition_pipeline.png) | ||
|
||
libcom is an image composition toolbox covering various related tasks, including: | ||
|
||
- **get_composite_image** generates composite images using naive copy-and-paste. | ||
- **OPAScoreModel** is an object placement assessment model that evaluates the rationality of object placement by predicting a rationality scores. | ||
- **FOPAHeatMapModel** can predict the rationality scores for all locations with a pair of background and scaled foreground as input in a single forward pass. | ||
- **color_transfer** tranfers the color of foreground to background using reinhard algorithm. | ||
- **ImageHarmonizationModel** contains several pretrained models for image harmonization, which aims to adjust | ||
the illumination statistics of foreground to fit background. | ||
- **PainterlyHarmonizationModel** contains serveral pretrained models for painterly image harmonization, which aims to adjust the foreground style of the painterly composite image to make it compatible with the background. | ||
- **HarmonyScoreModel** predicts harmony score for a composite image, in which larger harmony score implies more harmonious composite image. | ||
- **InharmoniousLocalizationModel** aims to localize the inharmonious region in a synthetic image. | ||
- **FOSScoreModel** contains two foreground object search models, which can be used to evaluate the compatibility between foreground and background in terms of geometry and semantics. | ||
- **ControlComModel** is a controllable image composition model, which unifies image blending and image harmonization in one diffusion model. | ||
|
||
## How to Use this Guide | ||
|
||
Here is a detailed step-by-step guide to learn more about MMDetection: | ||
|
||
1. For installation instructions, please see [get_started](get_started.md). | ||
|
||
2. Refer to the below tutorials for the basic usage of MMDetection. | ||
|
||
- [Train and Test](https://mmdetection.readthedocs.io/en/latest/user_guides/index.html#train-test) | ||
|
||
- [Useful Tools](https://mmdetection.readthedocs.io/en/latest/user_guides/index.html#useful-tools) | ||
|
||
3. Refer to the below tutorials to dive deeper: | ||
|
||
- [Basic Concepts](https://mmdetection.readthedocs.io/en/latest/advanced_guides/index.html#basic-concepts) | ||
- [Component Customization](https://mmdetection.readthedocs.io/en/latest/advanced_guides/index.html#component-customization) | ||
|
||
4. For users of MMDetection 2.x version, we provide a guide to help you adapt to the new version. You can find it in the [migration guide](./migration/migration.md). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters