libcom


Namelibcom JSON
Version 0.0.2.post1 PyPI version JSON
download
home_pagehttps://github.com/bcmi/libcom
SummaryImage Composition Toolbox
upload_time2024-04-11 13:51:37
maintainerNone
docs_urlNone
authorBCMI Lab
requires_pythonNone
licenseApache License 2.0
keywords computer vision image composition
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
</br>
<img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/LOGO.png" width="200" />

</div>

<h1 align="center">libcom: everything about image composition</h1>

</br>

[![PyPI](https://img.shields.io/pypi/v/libcom)](https://pypi.org/project/libcom)
[![Downloads](https://static.pepy.tech/badge/libcom)](https://pepy.tech/project/libcom)
[![Hits](https://hits.sh/github.com/bcmi/libcom.svg?label=views)](https://hits.sh/github.com/bcmi/libcom/)
[![Static Badge](https://img.shields.io/badge/Image%20Composition%20Demo-Green)](https://bcmi.sjtu.edu.cn/home/niuli/demo_image_composition/)
[![Static Badge](https://img.shields.io/badge/survey-arxiv%3A2106.14490-red)](https://arxiv.org/pdf/2106.14490.pdf)
[![GitHub](https://img.shields.io/github/license/bcmi/libcom)](https://github.com/bcmi/libcom/blob/main/LICENSE)


## 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.
<div align="center">
</br>
<img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/image_composition_task.gif" width="600" />
</div>

**_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]](https://libcom.readthedocs.io/en/latest/).**

## 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]](https://github.com/bcmi/libcom/blob/main/requirements/libcom.yaml) and [[runtime_dependencies]](https://github.com/bcmi/libcom/blob/main/requirements/runtime.txt).

## Get Started
Please refer to [[Installation]](https://github.com/bcmi/libcom/blob/main/docs/get_started.md) for installation instructions and [[documents]](https://libcom.readthedocs.io/en/latest/) for user guidance.

## Contributors
- Institution: [Brain-like Computing and Machine Intelligence (BCMI) Lab](https://bcmi.sjtu.edu.cn/).
- Project Initiator & Team Manager: [Li Niu](https://www.ustcnewly.com/index.html). 
- Architect & Lead Developer: [Bo Zhang](https://bo-zhang-cs.github.io/).   
- Documentation Manager: [Jiacheng Sui](https://github.com/charlessjc).
- Module Developers: [Jiacheng Sui](https://github.com/charlessjc), [Binjie Gao](https://github.com/WhynotHAHA), [Lingxiao Lu](https://github.com/pokaaa), [Xinhao Tao](https://github.com/taoxinhao13), [Junyan Cao](https://github.com/cjy-4), [Junqi You](https://github.com/dhmbb2).

## License

This project is released under the [Apache 2.0 license](https://github.com/bcmi/libcom/blob/main/LICENSE).

## Bibtex

If you use our toolbox, please cite our survey paper using the following BibTeX  [[arxiv](https://arxiv.org/pdf/2106.14490.pdf)]:

```
@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}
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bcmi/libcom",
    "name": "libcom",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "computer vision, image composition",
    "author": "BCMI Lab",
    "author_email": "bernard-zhang@hotmail.com",
    "download_url": "https://files.pythonhosted.org/packages/99/c7/7a0a11502e4bf4130b2d4b8ef815c7e7964e1bb180f135a32a9aaa1222c0/libcom-0.0.2.post1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n</br>\n<img src=\"https://raw.githubusercontent.com/bcmi/libcom/main/resources/LOGO.png\" width=\"200\" />\n\n</div>\n\n<h1 align=\"center\">libcom: everything about image composition</h1>\n\n</br>\n\n[![PyPI](https://img.shields.io/pypi/v/libcom)](https://pypi.org/project/libcom)\n[![Downloads](https://static.pepy.tech/badge/libcom)](https://pepy.tech/project/libcom)\n[![Hits](https://hits.sh/github.com/bcmi/libcom.svg?label=views)](https://hits.sh/github.com/bcmi/libcom/)\n[![Static Badge](https://img.shields.io/badge/Image%20Composition%20Demo-Green)](https://bcmi.sjtu.edu.cn/home/niuli/demo_image_composition/)\n[![Static Badge](https://img.shields.io/badge/survey-arxiv%3A2106.14490-red)](https://arxiv.org/pdf/2106.14490.pdf)\n[![GitHub](https://img.shields.io/github/license/bcmi/libcom)](https://github.com/bcmi/libcom/blob/main/LICENSE)\n\n\n## Introduction\n**_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.\n<div align=\"center\">\n</br>\n<img src=\"https://raw.githubusercontent.com/bcmi/libcom/main/resources/image_composition_task.gif\" width=\"600\" />\n</div>\n\n**_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. \n\n**The ultimate goal of this library is solving all the problems related to image composition with simple `import libcom`.**\n\n### Main Functions\n\n- **get_composite_image** generates composite images using naive copy-and-paste followed by image blending.\n- **OPAScoreModel**  evaluates the rationality of foreground object placement in a composite image.\n- **FOPAHeatMapModel** can predict the rationality scores for all locations/scales given a background-foreground pair, and output the composite image with optimal location/scale.  \n- **color_transfer** adjusts the foreground color to match the background using traditional color transfer method.\n- **ImageHarmonizationModel** adjusts the foreground illumination to be compatible the background given photorealistic background and photorealistic foreground.\n- **PainterlyHarmonizationModel** adjusts the foreground style to be compatible with the background given artistic background and photorealistic foreground.\n- **HarmonyScoreModel** evaluates the harmony level between foreground and background in a composite image.\n- **InharmoniousLocalizationModel** localizes the inharmonious region in a synthetic image.\n- **FOSScoreModel** evaluates the compatibility between foreground and background in a composite image in terms of geometry and semantics.\n- **ControlComModel** is a generative image composition model, which unifies image blending, image harmonization, view synthesis, and generative composition within a diffusion model. \n- **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.\n- **ShadowGenerationModel** generates plausible shadow for the inserted object in a composite image. \n\n**For the detailed method descriptions, code examples, visualization results, and performance comments, please refer to our [[documents]](https://libcom.readthedocs.io/en/latest/).**\n\n## Requirements\n\nThe 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]](https://github.com/bcmi/libcom/blob/main/requirements/libcom.yaml) and [[runtime_dependencies]](https://github.com/bcmi/libcom/blob/main/requirements/runtime.txt).\n\n## Get Started\nPlease refer to [[Installation]](https://github.com/bcmi/libcom/blob/main/docs/get_started.md) for installation instructions and [[documents]](https://libcom.readthedocs.io/en/latest/) for user guidance.\n\n## Contributors\n- Institution: [Brain-like Computing and Machine Intelligence (BCMI) Lab](https://bcmi.sjtu.edu.cn/).\n- Project Initiator & Team Manager: [Li Niu](https://www.ustcnewly.com/index.html). \n- Architect & Lead Developer: [Bo Zhang](https://bo-zhang-cs.github.io/).   \n- Documentation Manager: [Jiacheng Sui](https://github.com/charlessjc).\n- Module Developers: [Jiacheng Sui](https://github.com/charlessjc), [Binjie Gao](https://github.com/WhynotHAHA), [Lingxiao Lu](https://github.com/pokaaa), [Xinhao Tao](https://github.com/taoxinhao13), [Junyan Cao](https://github.com/cjy-4), [Junqi You](https://github.com/dhmbb2).\n\n## License\n\nThis project is released under the [Apache 2.0 license](https://github.com/bcmi/libcom/blob/main/LICENSE).\n\n## Bibtex\n\nIf you use our toolbox, please cite our survey paper using the following BibTeX  [[arxiv](https://arxiv.org/pdf/2106.14490.pdf)]:\n\n```\n@article{niu2021making,\n  title={Making images real again: A comprehensive survey on deep image composition},\n  author={Niu, Li and Cong, Wenyan and Liu, Liu and Hong, Yan and Zhang, Bo and Liang, Jing and Zhang, Liqing},\n  journal={arXiv preprint arXiv:2106.14490},\n  year={2021}\n}\n```\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Image Composition Toolbox",
    "version": "0.0.2.post1",
    "project_urls": {
        "Homepage": "https://github.com/bcmi/libcom"
    },
    "split_keywords": [
        "computer vision",
        " image composition"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a71ba7e0c596678f7d7fb56f8a3ad23a5afc132e89e904896b34f7b69dbffe94",
                "md5": "5e2cc9ca1c4941e64f99c2397cb4eec0",
                "sha256": "1f358e7c613edbdb0a7c0b05799330bdd5aa736301c71d85e7f4c58a6ac78310"
            },
            "downloads": -1,
            "filename": "libcom-0.0.2.post1-cp38-cp38-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "5e2cc9ca1c4941e64f99c2397cb4eec0",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": null,
            "size": 2427869,
            "upload_time": "2024-04-11T13:51:35",
            "upload_time_iso_8601": "2024-04-11T13:51:35.127015Z",
            "url": "https://files.pythonhosted.org/packages/a7/1b/a7e0c596678f7d7fb56f8a3ad23a5afc132e89e904896b34f7b69dbffe94/libcom-0.0.2.post1-cp38-cp38-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "99c77a0a11502e4bf4130b2d4b8ef815c7e7964e1bb180f135a32a9aaa1222c0",
                "md5": "e38dd5f7b9734dcf1e0bce50b622cabc",
                "sha256": "db0ca2c662f52e77c587af8d394132aaeff1ca916fe2e899dbb3a5321e91ad05"
            },
            "downloads": -1,
            "filename": "libcom-0.0.2.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "e38dd5f7b9734dcf1e0bce50b622cabc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 421415,
            "upload_time": "2024-04-11T13:51:37",
            "upload_time_iso_8601": "2024-04-11T13:51:37.225778Z",
            "url": "https://files.pythonhosted.org/packages/99/c7/7a0a11502e4bf4130b2d4b8ef815c7e7964e1bb180f135a32a9aaa1222c0/libcom-0.0.2.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-11 13:51:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bcmi",
    "github_project": "libcom",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "libcom"
}
        
Elapsed time: 2.34032s