Package: libcom
libcom: everything about image compositionIntroductionlibcom(the library of image composition) is an image composition toolbox.The goal of image composition 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.libcomcovers 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 simpleimport libcom.Main Functionsget_composite_imagegenerates composite images using naive copy-and-paste followed by image blending.OPAScoreModelevaluates the rationality of foreground object placement in a composite image.FOPAHeatMapModelcan predict the rationality scores for all locations/scales given a background-foreground pair, and output the composite image with optimal location/scale.color_transferadjusts the foreground color to match the background using traditional color transfer method.ImageHarmonizationModeladjusts the foreground illumination to be compatible the background given photorealistic background and photorealistic foreground.PainterlyHarmonizationModeladjusts the foreground style to be compatible with the background given artistic background and photorealistic foreground.HarmonyScoreModelevaluates the harmony level between foreground and background in a composite image.InharmoniousLocalizationModellocalizes the inharmonious region in a synthetic image.FOSScoreModelevaluates the compatibility between foreground and background in a composite image in terms of geometry and semantics.ControlComModelis a generative image composition model, which unifies image blending and image harmonization in one diffusion model.ShadowGenerationModelgenerates 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].RequirementsThe main branch is built on the Linux system withPython 3.8andPyTorch>=1.10.1. For other dependencies, please refer to[conda_env]and[runtime_dependencies].Get StartedPlease refer to[Installation]for installation instructions and[documents]for user guidance.ContributorsInstitution:Brain-like Computing and Machine Intelligence (BCMI) Lab.Project Initiator & Team Manager:Li Niu.Architect & Lead Developer:Bo Zhang.Documentation Manager:Jiacheng Sui.Module Developers:Jiacheng Sui,Binjie Gao,Lingxiao Lu,Xinhao Tao,Junyan Cao,Junqi You.LicenseThis project is released under theApache 2.0 license.BibtexIf 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}
}