Skip to main content

Image Composition Toolbox

Project description


libcom: everything about image composition


PyPI Downloads Hits Static Badge Static Badge GitHub

Introduction

libcom (the library of image composition) is an image composition toolbox. The goal of image composition (object insertion) is inserting one foreground into a background image to get a realistic composite image, by addressing the inconsistencies (appearance, geometry, and semantic inconsistency) between foreground and background. Generally speaking, image composition could be used to combine the visual elements from different images.


libcom covers a diversity of related tasks in the field of image composition, including image blending, standard/painterly image harmonization, shadow generation, object placement, generative composition, quality evaluation, etc. For each task, we integrate one or two selected methods considering both efficiency and effectiveness. The selected methods will be continuously updated upon the emergence of better methods.

The ultimate goal of this library is solving all the problems related to image composition with simple import libcom.

Main Functions

  • get_composite_image generates composite images using naive copy-and-paste followed by image blending.
  • OPAScoreModel evaluates the rationality of foreground object placement in a composite image.
  • FOPAHeatMapModel can predict the rationality scores for all locations/scales given a background-foreground pair, and output the composite image with optimal location/scale.
  • color_transfer adjusts the foreground color to match the background using traditional color transfer method.
  • ImageHarmonizationModel adjusts the foreground illumination to be compatible the background given photorealistic background and photorealistic foreground.
  • PainterlyHarmonizationModel adjusts the foreground style to be compatible with the background given artistic background and photorealistic foreground.
  • HarmonyScoreModel evaluates the harmony level between foreground and background in a composite image.
  • InharmoniousLocalizationModel localizes the inharmonious region in a synthetic image.
  • FOSScoreModel evaluates the compatibility between foreground and background in a composite image in terms of geometry and semantics.
  • ControlComModel is a generative image composition model, which unifies image blending, image harmonization, view synthesis, and generative composition within a diffusion model.
  • ObjectStitchModel is another generative image composition model that aims to generate a composite image from a pair of background and foreground, with non-object pixels filled with black.
  • ShadowGenerationModel generates plausible shadow for the inserted object in a composite image.

For the detailed method descriptions, code examples, visualization results, and performance comments, please refer to our [documents].

Requirements

The main branch is built on the Linux system with Python 3.8 and PyTorch>=1.10.1. For other dependencies, please refer to [conda_env] and [runtime_dependencies].

Get Started

Please refer to [Installation] for installation instructions and [documents] for user guidance.

Contributors

License

This project is released under the Apache 2.0 license.

Bibtex

If you use our toolbox, please cite our survey paper using the following BibTeX [arxiv]:

@article{niu2021making,
  title={Making images real again: A comprehensive survey on deep image composition},
  author={Niu, Li and Cong, Wenyan and Liu, Liu and Hong, Yan and Zhang, Bo and Liang, Jing and Zhang, Liqing},
  journal={arXiv preprint arXiv:2106.14490},
  year={2021}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libcom-0.0.2.post1.tar.gz (421.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libcom-0.0.2.post1-cp38-cp38-manylinux1_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.8

File details

Details for the file libcom-0.0.2.post1.tar.gz.

File metadata

  • Download URL: libcom-0.0.2.post1.tar.gz
  • Upload date:
  • Size: 421.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.5

File hashes

Hashes for libcom-0.0.2.post1.tar.gz
Algorithm Hash digest
SHA256 db0ca2c662f52e77c587af8d394132aaeff1ca916fe2e899dbb3a5321e91ad05
MD5 e38dd5f7b9734dcf1e0bce50b622cabc
BLAKE2b-256 99c77a0a11502e4bf4130b2d4b8ef815c7e7964e1bb180f135a32a9aaa1222c0

See more details on using hashes here.

File details

Details for the file libcom-0.0.2.post1-cp38-cp38-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for libcom-0.0.2.post1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1f358e7c613edbdb0a7c0b05799330bdd5aa736301c71d85e7f4c58a6ac78310
MD5 5e2cc9ca1c4941e64f99c2397cb4eec0
BLAKE2b-256 a71ba7e0c596678f7d7fb56f8a3ad23a5afc132e89e904896b34f7b69dbffe94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page