Skip to content

Commit

Permalink
add two .md
Browse files Browse the repository at this point in the history
  • Loading branch information
bo-zhang-cs committed Oct 30, 2023
1 parent 68def2c commit dca1d3d
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 1 deletion.
Binary file removed docs/LOGO.png
Binary file not shown.
34 changes: 34 additions & 0 deletions docs/get_started.md
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.
40 changes: 40 additions & 0 deletions docs/overview.md
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).
Binary file added resources/image_composition_pipeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get_ext_modules():
else:
return CppExtension('trilinear',
['trilinear.cpp'],
include_dirs='libcom/image_harmonization/source/trilinear_cpp/src'
include_dirs=['libcom/image_harmonization/source/trilinear_cpp/src']
)

if __name__ == '__main__':
Expand Down

0 comments on commit dca1d3d

Please sign in to comment.