libcom 0.1.0__tar.gz → 0.1.1.post2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. {libcom-0.1.0/libcom.egg-info → libcom-0.1.1.post2}/PKG-INFO +44 -13
  2. libcom-0.1.0/PKG-INFO → libcom-0.1.1.post2/README.md +82 -99
  3. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/__init__.py +6 -4
  4. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fopa_heat_map/fopa_heat_map.py +5 -7
  5. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fopa_heat_map/source/data/OBdataset.py +2 -2
  6. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fos_score/fos_score_prediction.py +2 -2
  7. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/harmony_score/harmony_score_prediction.py +1 -1
  8. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/image_harmonization/image_harmonization.py +1 -1
  9. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/image_harmonization/source/functions.py +0 -3
  10. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/inharmonious_region_localization/inharmonious_region_localization.py +2 -2
  11. libcom-0.1.1.post2/libcom/insert_anything/__init__.py +3 -0
  12. libcom-0.1.1.post2/libcom/insert_anything/insert_anything.py +210 -0
  13. libcom-0.1.1.post2/libcom/kontext_blending_harmonization/__init__.py +3 -0
  14. libcom-0.1.1.post2/libcom/kontext_blending_harmonization/kontext_blending_harmonization.py +147 -0
  15. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/opa_score/opa_score_prediction.py +1 -1
  16. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/painterly_image_harmonization.py +1 -1
  17. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDNet/phdnet.py +1 -1
  18. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/ddpm.py +1 -1
  19. libcom-0.1.1.post2/libcom/reflection_generation/__init__.py +3 -0
  20. libcom-0.1.0/libcom/shadow_generation/shadow_generation.py → libcom-0.1.1.post2/libcom/reflection_generation/reflection_generation.py +42 -46
  21. libcom-0.1.1.post2/libcom/shadow_generation/shadow_generation.py +693 -0
  22. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/utils/model_download.py +5 -5
  23. libcom-0.1.0/README.md → libcom-0.1.1.post2/libcom.egg-info/PKG-INFO +130 -80
  24. libcom-0.1.1.post2/libcom.egg-info/SOURCES.txt +145 -0
  25. libcom-0.1.1.post2/libcom.egg-info/requires.txt +21 -0
  26. libcom-0.1.1.post2/libcom.egg-info/top_level.txt +1 -0
  27. {libcom-0.1.0 → libcom-0.1.1.post2}/setup.py +17 -29
  28. libcom-0.1.1.post2/tests/test_color_transfer.py +25 -0
  29. libcom-0.1.1.post2/tests/test_composite_generation.py +30 -0
  30. libcom-0.1.1.post2/tests/test_flux_kontext.py +35 -0
  31. libcom-0.1.1.post2/tests/test_fopa_heat_map.py +30 -0
  32. libcom-0.1.1.post2/tests/test_fos_score.py +27 -0
  33. libcom-0.1.1.post2/tests/test_harmony_score.py +32 -0
  34. libcom-0.1.1.post2/tests/test_image_harmonization.py +29 -0
  35. libcom-0.1.1.post2/tests/test_inharmonious_region_localization.py +26 -0
  36. libcom-0.1.1.post2/tests/test_insert_anything.py +29 -0
  37. libcom-0.1.1.post2/tests/test_opa_score.py +27 -0
  38. libcom-0.1.1.post2/tests/test_painterly_image_harmonization.py +40 -0
  39. libcom-0.1.1.post2/tests/test_reflection_generation.py +43 -0
  40. libcom-0.1.1.post2/tests/test_shadow_generation.py +43 -0
  41. libcom-0.1.0/libcom/controllable_composition/__init__.py +0 -4
  42. libcom-0.1.0/libcom/controllable_composition/controllable_composition.py +0 -230
  43. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/configs/controlcom.yaml +0 -119
  44. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/data/base.py +0 -23
  45. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/data/datamodule.py +0 -128
  46. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/data/open_images_control.py +0 -283
  47. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/models/autoencoder.py +0 -442
  48. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/models/diffusion/classifier.py +0 -267
  49. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/models/diffusion/ddim.py +0 -269
  50. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/models/diffusion/ddpm.py +0 -1677
  51. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/models/diffusion/plms.py +0 -254
  52. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/attention.py +0 -280
  53. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/diffusionmodules/model.py +0 -833
  54. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/diffusionmodules/openaimodel.py +0 -1165
  55. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/diffusionmodules/util.py +0 -267
  56. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/ema.py +0 -76
  57. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/encoders/modules.py +0 -228
  58. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/encoders/xf.py +0 -130
  59. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/local_module.py +0 -142
  60. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/losses/__init__.py +0 -1
  61. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/losses/contperceptual.py +0 -111
  62. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/losses/vqperceptual.py +0 -167
  63. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/x_transformer.py +0 -641
  64. libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/util.py +0 -203
  65. libcom-0.1.0/libcom/objectstitch/__init__.py +0 -4
  66. libcom-0.1.0/libcom/objectstitch/objectstitch.py +0 -332
  67. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/configs/objectstitch.yaml +0 -74
  68. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/data/__init__.py +0 -0
  69. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/data/base.py +0 -23
  70. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/data/datamodule.py +0 -128
  71. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/data/imagenet.py +0 -394
  72. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/data/lsun.py +0 -92
  73. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/data/open_images.py +0 -409
  74. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/lr_scheduler.py +0 -98
  75. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/models/__init__.py +0 -0
  76. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/models/autoencoder.py +0 -443
  77. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/models/diffusion/__init__.py +0 -0
  78. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/models/diffusion/classifier.py +0 -267
  79. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/models/diffusion/ddim.py +0 -263
  80. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/models/diffusion/ddpm.py +0 -1416
  81. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/models/diffusion/plms.py +0 -252
  82. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/__init__.py +0 -0
  83. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/attention.py +0 -261
  84. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/diffusionmodules/__init__.py +0 -0
  85. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/diffusionmodules/model.py +0 -835
  86. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/diffusionmodules/openaimodel.py +0 -1108
  87. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/diffusionmodules/util.py +0 -267
  88. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/distributions/__init__.py +0 -0
  89. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/distributions/distributions.py +0 -92
  90. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/ema.py +0 -76
  91. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/encoders/__init__.py +0 -0
  92. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/encoders/modules.py +0 -189
  93. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/encoders/xf.py +0 -130
  94. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/losses/__init__.py +0 -1
  95. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/losses/contperceptual.py +0 -111
  96. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/losses/vqperceptual.py +0 -167
  97. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/modules/x_transformer.py +0 -641
  98. libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm/util.py +0 -203
  99. libcom-0.1.0/libcom/objectstitch/source/__init__.py +0 -0
  100. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDNet/__init__.py +0 -0
  101. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/__init__.py +0 -0
  102. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/__init__.py +0 -0
  103. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/lr_scheduler.py +0 -98
  104. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/__init__.py +0 -0
  105. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/__init__.py +0 -0
  106. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/diffusionmodules/__init__.py +0 -0
  107. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/distributions/__init__.py +0 -0
  108. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/distributions/distributions.py +0 -92
  109. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/encoders/__init__.py +0 -0
  110. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/__init__.py +0 -0
  111. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/__init__.py +0 -0
  112. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose/__init__.py +0 -0
  113. libcom-0.1.0/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/fusion/__init__.py +0 -0
  114. libcom-0.1.0/libcom/painterly_image_harmonization/source/__init__.py +0 -0
  115. libcom-0.1.0/libcom/shadow_generation/source/PostProcessModel.py +0 -514
  116. libcom-0.1.0/libcom/shadow_generation/source/Shadow_generation.py +0 -217
  117. libcom-0.1.0/libcom/shadow_generation/source/__init__.py +0 -0
  118. libcom-0.1.0/libcom/shadow_generation/source/cldm/__init__.py +0 -0
  119. libcom-0.1.0/libcom/shadow_generation/source/cldm/base_network.py +0 -166
  120. libcom-0.1.0/libcom/shadow_generation/source/cldm/cldm.py +0 -535
  121. libcom-0.1.0/libcom/shadow_generation/source/cldm/ddim_hacked.py +0 -317
  122. libcom-0.1.0/libcom/shadow_generation/source/cldm/hack.py +0 -111
  123. libcom-0.1.0/libcom/shadow_generation/source/cldm/logger.py +0 -127
  124. libcom-0.1.0/libcom/shadow_generation/source/cldm/model.py +0 -26
  125. libcom-0.1.0/libcom/shadow_generation/source/cldm_v15.yaml +0 -81
  126. libcom-0.1.0/libcom/shadow_generation/source/ldm/__init__.py +0 -0
  127. libcom-0.1.0/libcom/shadow_generation/source/ldm/data/__init__.py +0 -0
  128. libcom-0.1.0/libcom/shadow_generation/source/ldm/data/util.py +0 -24
  129. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/__init__.py +0 -0
  130. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/autoencoder.py +0 -219
  131. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/diffusion/__init__.py +0 -0
  132. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/diffusion/attention_processor.py +0 -188
  133. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/diffusion/ddim.py +0 -340
  134. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/diffusion/ddpm.py +0 -1893
  135. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/diffusion/dpm_solver/__init__.py +0 -1
  136. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/diffusion/dpm_solver/dpm_solver.py +0 -1154
  137. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/diffusion/dpm_solver/sampler.py +0 -87
  138. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/diffusion/ip_adapter.py +0 -57
  139. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/diffusion/plms.py +0 -244
  140. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/diffusion/sampling_util.py +0 -22
  141. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/mask_predictor/__init__.py +0 -0
  142. libcom-0.1.0/libcom/shadow_generation/source/ldm/models/mask_predictor/mask_predictor.py +0 -104
  143. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/__init__.py +0 -0
  144. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/attention.py +0 -341
  145. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/diffusionmodules/__init__.py +0 -0
  146. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/diffusionmodules/model.py +0 -852
  147. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/diffusionmodules/openaimodel.py +0 -786
  148. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/diffusionmodules/upscaling.py +0 -81
  149. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/diffusionmodules/util.py +0 -270
  150. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/distributions/__init__.py +0 -0
  151. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/distributions/distributions.py +0 -92
  152. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/ema.py +0 -80
  153. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/encoders/__init__.py +0 -0
  154. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/encoders/modules.py +0 -215
  155. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/image_degradation/__init__.py +0 -2
  156. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/image_degradation/bsrgan.py +0 -730
  157. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/image_degradation/bsrgan_light.py +0 -651
  158. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/image_degradation/utils_image.py +0 -916
  159. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/midas/__init__.py +0 -0
  160. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/midas/api.py +0 -170
  161. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/midas/midas/__init__.py +0 -0
  162. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/midas/midas/base_model.py +0 -16
  163. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/midas/midas/blocks.py +0 -342
  164. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/midas/midas/dpt_depth.py +0 -109
  165. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/midas/midas/midas_net.py +0 -76
  166. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/midas/midas/midas_net_custom.py +0 -128
  167. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/midas/midas/transforms.py +0 -234
  168. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/midas/midas/vit.py +0 -491
  169. libcom-0.1.0/libcom/shadow_generation/source/ldm/modules/midas/utils.py +0 -189
  170. libcom-0.1.0/libcom/shadow_generation/source/ldm/util.py +0 -199
  171. libcom-0.1.0/libcom/shadow_generation/source/sampler/__init__.py +0 -0
  172. libcom-0.1.0/libcom/shadow_generation/source/sampler/pndm.py +0 -86
  173. libcom-0.1.0/libcom/shadow_generation/source/sampler/scheduling_pndm.py +0 -518
  174. libcom-0.1.0/libcom/shadow_generation/source/tool_add_control.py +0 -49
  175. libcom-0.1.0/libcom/utils/__init__.py +0 -0
  176. libcom-0.1.0/libcom.egg-info/SOURCES.txt +0 -263
  177. libcom-0.1.0/libcom.egg-info/requires.txt +0 -58
  178. libcom-0.1.0/libcom.egg-info/top_level.txt +0 -2
  179. {libcom-0.1.0 → libcom-0.1.1.post2}/LICENSE +0 -0
  180. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/color_transfer/__init__.py +0 -0
  181. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/color_transfer/reinhard.py +0 -0
  182. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fopa_heat_map/__init__.py +0 -0
  183. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom → libcom-0.1.1.post2/libcom/fopa_heat_map/source}/__init__.py +0 -0
  184. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fopa_heat_map/source/backbone/ResNet.py +0 -0
  185. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom/configs → libcom-0.1.1.post2/libcom/fopa_heat_map/source/backbone}/__init__.py +0 -0
  186. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm → libcom-0.1.1.post2/libcom/fopa_heat_map/source/data}/__init__.py +0 -0
  187. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fopa_heat_map/source/data/all_transforms.py +0 -0
  188. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fopa_heat_map/source/network/BaseBlocks.py +0 -0
  189. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fopa_heat_map/source/network/DynamicModules.py +0 -0
  190. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fopa_heat_map/source/network/ObPlaNet_simple.py +0 -0
  191. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fopa_heat_map/source/network/__init__.py +0 -0
  192. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fopa_heat_map/source/network/tensor_ops.py +0 -0
  193. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fopa_heat_map/source/prepare_multi_fg_scales.py +0 -0
  194. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fos_score/__init__.py +0 -0
  195. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/data → libcom-0.1.1.post2/libcom/fos_score/source}/__init__.py +0 -0
  196. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fos_score/source/config/__init__.py +0 -0
  197. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fos_score/source/config/config.py +0 -0
  198. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fos_score/source/config/config.sfosd.yaml +0 -0
  199. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fos_score/source/config/config_rfosd.yaml +0 -0
  200. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fos_score/source/loss_function.py +0 -0
  201. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/fos_score/source/networks.py +0 -0
  202. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/harmony_score/__init__.py +0 -0
  203. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/models → libcom-0.1.1.post2/libcom/harmony_score/source}/__init__.py +0 -0
  204. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/harmony_score/source/bargainnet.py +0 -0
  205. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/image_harmonization/__init__.py +0 -0
  206. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/models/diffusion → libcom-0.1.1.post2/libcom/image_harmonization/source}/__init__.py +0 -0
  207. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/image_harmonization/source/cdt_net.py +0 -0
  208. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/image_harmonization/source/pct_net.py +0 -0
  209. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/inharmonious_region_localization/__init__.py +0 -0
  210. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules → libcom-0.1.1.post2/libcom/inharmonious_region_localization/source}/__init__.py +0 -0
  211. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/inharmonious_region_localization/source/blocks.py +0 -0
  212. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/inharmonious_region_localization/source/functions.py +0 -0
  213. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/inharmonious_region_localization/source/madis_net.py +0 -0
  214. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/naive_composition/__init__.py +0 -0
  215. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/naive_composition/generate_composite_image.py +0 -0
  216. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/opa_score/__init__.py +0 -0
  217. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/opa_score/source/__init__.py +0 -0
  218. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/opa_score/source/object_place_net.py +0 -0
  219. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/opa_score/source/oblect_place_config.py +0 -0
  220. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/opa_score/source/resnet_4ch.py +0 -0
  221. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/__init__.py +0 -0
  222. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/diffusionmodules → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDNet}/__init__.py +0 -0
  223. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDNet/networks.py +0 -0
  224. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDNet/phdnet_config.py +0 -0
  225. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/distributions → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion}/__init__.py +0 -0
  226. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom/ldm/modules/encoders → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion/ldm}/__init__.py +0 -0
  227. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/inference_base.py +0 -0
  228. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion}/ldm/lr_scheduler.py +0 -0
  229. {libcom-0.1.0/libcom/controllable_composition/source → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models}/__init__.py +0 -0
  230. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/autoencoder.py +0 -0
  231. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/__init__.py +0 -0
  232. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/ddim.py +0 -0
  233. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/dpm_solver/__init__.py +0 -0
  234. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/dpm_solver/dpm_solver.py +0 -0
  235. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/dpm_solver/sampler.py +0 -0
  236. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/plms.py +0 -0
  237. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/scheduling_pndm.py +0 -0
  238. {libcom-0.1.0/libcom/fopa_heat_map/source → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules}/__init__.py +0 -0
  239. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/attention.py +0 -0
  240. {libcom-0.1.0/libcom/fopa_heat_map/source/backbone → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/diffusionmodules}/__init__.py +0 -0
  241. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/diffusionmodules/model.py +0 -0
  242. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/diffusionmodules/openaimodel.py +0 -0
  243. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/diffusionmodules/util.py +0 -0
  244. {libcom-0.1.0/libcom/fopa_heat_map/source/data → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/distributions}/__init__.py +0 -0
  245. {libcom-0.1.0/libcom/controllable_composition/source/ControlCom → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion}/ldm/modules/distributions/distributions.py +0 -0
  246. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/ema.py +0 -0
  247. {libcom-0.1.0/libcom/fos_score/source → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/encoders}/__init__.py +0 -0
  248. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/encoders/adapter.py +0 -0
  249. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/encoders/modules.py +0 -0
  250. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/__init__.py +0 -0
  251. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/api.py +0 -0
  252. {libcom-0.1.0/libcom/harmony_score/source → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas}/__init__.py +0 -0
  253. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/api.py +0 -0
  254. {libcom-0.1.0/libcom/image_harmonization/source → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas}/__init__.py +0 -0
  255. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/base_model.py +0 -0
  256. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/blocks.py +0 -0
  257. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/dpt_depth.py +0 -0
  258. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/midas_net.py +0 -0
  259. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/midas_net_custom.py +0 -0
  260. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/transforms.py +0 -0
  261. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/vit.py +0 -0
  262. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/utils.py +0 -0
  263. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/model_edge.py +0 -0
  264. {libcom-0.1.0/libcom/inharmonious_region_localization/source → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose}/__init__.py +0 -0
  265. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose/api.py +0 -0
  266. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose/body.py +0 -0
  267. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose/hand.py +0 -0
  268. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose/model.py +0 -0
  269. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose/util.py +0 -0
  270. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/utils.py +0 -0
  271. {libcom-0.1.0/libcom/objectstitch/source/ObjectStitch → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/fusion}/__init__.py +0 -0
  272. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/fusion/dual_encoder_fusion.py +0 -0
  273. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/image_degradation/__init__.py +0 -0
  274. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/image_degradation/bsrgan.py +0 -0
  275. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/image_degradation/bsrgan_light.py +0 -0
  276. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/image_degradation/utils_image.py +0 -0
  277. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/util.py +0 -0
  278. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/painterly_image_harmonization/source/PHDiffusion/stable_diffusion.yaml +0 -0
  279. {libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/configs → libcom-0.1.1.post2/libcom/painterly_image_harmonization/source}/__init__.py +0 -0
  280. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/shadow_generation/__init__.py +0 -0
  281. {libcom-0.1.0/libcom/objectstitch/source/ObjectStitch/ldm → libcom-0.1.1.post2/libcom/utils}/__init__.py +0 -0
  282. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/utils/environment.py +0 -0
  283. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom/utils/process_image.py +0 -0
  284. {libcom-0.1.0 → libcom-0.1.1.post2}/libcom.egg-info/dependency_links.txt +0 -0
  285. {libcom-0.1.0 → libcom-0.1.1.post2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: libcom
3
- Version: 0.1.0
3
+ Version: 0.1.1.post2
4
4
  Summary: Image Composition Toolbox
5
5
  Home-page: https://github.com/bcmi/libcom
6
6
  Author: BCMI Lab
@@ -12,10 +12,39 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3.8
14
14
  Description-Content-Type: text/markdown
15
- Provides-Extra: all
16
- Provides-Extra: build
17
- Provides-Extra: test
18
15
  License-File: LICENSE
16
+ Requires-Dist: einops
17
+ Requires-Dist: huggingface_hub
18
+ Requires-Dist: imageio
19
+ Requires-Dist: torch==2.6.0
20
+ Requires-Dist: torchvision==0.21.0
21
+ Requires-Dist: diffusers==0.34.0
22
+ Requires-Dist: mmdet==3.2.0
23
+ Requires-Dist: mmpose==1.2.0
24
+ Requires-Dist: peft
25
+ Requires-Dist: sentencepiece
26
+ Requires-Dist: protobuf
27
+ Requires-Dist: modelscope
28
+ Requires-Dist: omegaconf
29
+ Requires-Dist: opencv_python
30
+ Requires-Dist: opencv_python_headless
31
+ Requires-Dist: pytorch_lightning
32
+ Requires-Dist: transformers
33
+ Requires-Dist: tqdm
34
+ Requires-Dist: open_clip_torch
35
+ Requires-Dist: taming-transformers-rom1504
36
+ Requires-Dist: scikit-learn
37
+ Dynamic: author
38
+ Dynamic: author-email
39
+ Dynamic: classifier
40
+ Dynamic: description
41
+ Dynamic: description-content-type
42
+ Dynamic: home-page
43
+ Dynamic: keywords
44
+ Dynamic: license
45
+ Dynamic: license-file
46
+ Dynamic: requires-dist
47
+ Dynamic: summary
19
48
 
20
49
  <div align="center">
21
50
  </br>
@@ -30,16 +59,16 @@ License-File: LICENSE
30
59
  [![PyPI](https://img.shields.io/pypi/v/libcom)](https://pypi.org/project/libcom)
31
60
  [![Downloads](https://static.pepy.tech/badge/libcom)](https://pepy.tech/project/libcom)
32
61
  [![Hits](https://hits.sh/github.com/bcmi/libcom.svg?label=views)](https://hits.sh/github.com/bcmi/libcom/)
33
- [![Static Badge](https://img.shields.io/badge/Image%20Composition%20Demo-Green)](https://bcmi.sjtu.edu.cn/home/niuli/demo_image_composition/)
34
- [![Static Badge](https://img.shields.io/badge/Resources-Awesome-green?style=flat&label=Resources)](https://github.com/bcmi/Awesome-Image-Composition)
62
+ [![Static Badge](https://img.shields.io/badge/Online_Demo-Green)](https://bcmi.sjtu.edu.cn/home/niuli/demo_image_composition/)
63
+ [![Static Badge](https://img.shields.io/badge/Dataset&Code_Resources-green)](https://github.com/bcmi/Awesome-Object-Insertion)
35
64
  [![Static Badge](https://img.shields.io/badge/survey-arxiv%3A2106.14490-red)](https://arxiv.org/pdf/2106.14490.pdf)
65
+ [![Static Badge](https://img.shields.io/github/stars/bcmi/libcom.svg?style=social)](https://github.com/bcmi/libcom/stargazers)
36
66
 
37
- **We co-founded a startup company [miguo.ai](https://miguocomics.com/), dedicated to accelerating the production of comics and animations using AIGC technology. If you are seeking internship or full-time positions, please feel free to send your resume to hr@miguocomics.com.**
38
67
 
39
68
  ---
40
69
 
41
70
  ## Introduction
42
- **_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.
71
+ **_libcom_ (the library of image composition) is an image composition toolbox.** The goal of [image composition](https://github.com/bcmi/Awesome-Image-Composition) ([object insertion](https://github.com/bcmi/Awesome-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.
43
72
  <div align="center">
44
73
  </br>
45
74
  <img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/image_composition_task.gif" width="600" />
@@ -49,6 +78,8 @@ License-File: LICENSE
49
78
 
50
79
  **The ultimate goal of this library is solving all the problems related to image composition with simple `import libcom`.**
51
80
 
81
+ Welcome to follow WeChat public account ["Newly AIGCer"](https://www.ustcnewly.com/blog.html) or Zhihu Column ["Newly CVer"](https://www.zhihu.com/column/c_1333918224900206592) to get the latest information about image composition!
82
+
52
83
  ### Main Functions
53
84
 
54
85
  - **get_composite_image** generates composite images using naive copy-and-paste followed by image blending.
@@ -61,8 +92,8 @@ License-File: LICENSE
61
92
  - **InharmoniousLocalizationModel** [[MadisNet]](https://github.com/bcmi/MadisNet-Inharmonious-Region-Localization) localizes the inharmonious region in a synthetic image.
62
93
  - **FOSScoreModel** [[DiscoFOS]](https://github.com/bcmi/Foreground-Object-Search-Dataset-FOSD) evaluates the compatibility between foreground and background in a composite image in terms of geometry and semantics.
63
94
  - **ShadowGenerationModel** [[GPSDiffusion]](https://github.com/bcmi/GPSDiffusion-Object-Shadow-Generation) generates plausible shadow for the inserted object in a composite image. This model is unstable and you can pick the most satisfactory one from multiple generated results.
64
- - **ControlComModel** [[ControlCom]](https://github.com/bcmi/ControlCom-Image-Composition) is a generative image composition model which unifies image blending and image harmonization. The pose and view of foreground stay unchanged.
65
- - **MureObjectStitchModel** [[MureObjectStitch]](https://github.com/bcmi/MureObjectStitch-Image-Composition) is another generative image composition model which can adjust the pose and view of foreground. It supports multiple reference images of one foreground object. If you have a few images containing the foreground object, we suggest finetuning MureObjectStitch using these images for better detail preservation.
95
+ - **ControlComModel** [[ControlCom]](https://github.com/bcmi/ControlCom-Image-Composition) is a generative image composition model which unifies image blending and image harmonization. The pose and view of foreground stay unchanged. **Note that in the provided foreground image, the foreground object's length and width should fully extend to the edges of the image (see our example), otherwise the performance would be severely affected.**
96
+ - **MureObjectStitchModel** [[MureObjectStitch]](https://github.com/bcmi/MureObjectStitch-Image-Composition) is another generative image composition model which can adjust the pose and view of foreground. It supports multiple reference images of one foreground object. If you have a few images containing the foreground object, we suggest finetuning MureObjectStitch using these images for better detail preservation. **Note that in the provided foreground image, the foreground object's length and width should fully extend to the edges of the image (see our example), otherwise the performance would be severely affected.**
66
97
 
67
98
 
68
99
  **For the detailed method descriptions, code examples, visualization results, and performance comments, please refer to our [[documents]](https://libcom.readthedocs.io/en/latest/).** If the model performance is not satisfactory, you can finetune the pretrained model on your own dataset using the source repository and replace the original model.
@@ -72,14 +103,14 @@ License-File: LICENSE
72
103
  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).
73
104
 
74
105
  ## Get Started
75
- 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.
106
+ Please refer to [[Installation]](https://github.com/bcmi/libcom/blob/test/docs/get_started.md) for installation instructions and [[documents]](https://libcom.readthedocs.io/en/latest/) for user guidance.
76
107
 
77
108
  ## Contributors
78
109
  - Institution: [Brain-like Computing and Machine Intelligence (BCMI) Lab](https://bcmi.sjtu.edu.cn/).
79
110
  - Project Initiator & Team Manager: [Li Niu](https://www.ustcnewly.com/index.html).
80
111
  - Architect & Lead Developer: [Bo Zhang](https://bo-zhang-cs.github.io/), [Yujie Zhou](https://github.com/YujieOuO).
81
112
  - Documentation Manager: [Jiacheng Sui](https://github.com/charlessjc).
82
- - 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), [Haonan Zhao](https://github.com/nononononno), [Jiaxuan Chen](https://github.com/csdahunzi), [Junqi You](https://github.com/dhmbb2).
113
+ - Module Developers: [Jiacheng Sui](https://github.com/charlessjc), [Bingjie Gao](https://github.com/WhynotHAHA), [Lingxiao Lu](https://github.com/pokaaa), [Xinhao Tao](https://github.com/taoxinhao13), [Junyan Cao](https://github.com/cjy-4), [Haonan Zhao](https://github.com/nononononno), [Jiaxuan Chen](https://github.com/csdahunzi), [Junqi You](https://github.com/dhmbb2).
83
114
 
84
115
  ## License
85
116
 
@@ -1,99 +1,82 @@
1
- Metadata-Version: 2.1
2
- Name: libcom
3
- Version: 0.1.0
4
- Summary: Image Composition Toolbox
5
- Home-page: https://github.com/bcmi/libcom
6
- Author: BCMI Lab
7
- Author-email: bernard-zhang@hotmail.com
8
- License: Apache License 2.0
9
- Keywords: computer vision,image composition
10
- Classifier: License :: OSI Approved :: Apache Software License
11
- Classifier: Operating System :: OS Independent
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.8
14
- Description-Content-Type: text/markdown
15
- Provides-Extra: all
16
- Provides-Extra: build
17
- Provides-Extra: test
18
- License-File: LICENSE
19
-
20
- <div align="center">
21
- </br>
22
- <img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/LOGO.png" width="200" />
23
-
24
- </div>
25
-
26
- <h1 align="center">libcom: everything about image composition</h1>
27
-
28
- </br>
29
-
30
- [![PyPI](https://img.shields.io/pypi/v/libcom)](https://pypi.org/project/libcom)
31
- [![Downloads](https://static.pepy.tech/badge/libcom)](https://pepy.tech/project/libcom)
32
- [![Hits](https://hits.sh/github.com/bcmi/libcom.svg?label=views)](https://hits.sh/github.com/bcmi/libcom/)
33
- [![Static Badge](https://img.shields.io/badge/Image%20Composition%20Demo-Green)](https://bcmi.sjtu.edu.cn/home/niuli/demo_image_composition/)
34
- [![Static Badge](https://img.shields.io/badge/Resources-Awesome-green?style=flat&label=Resources)](https://github.com/bcmi/Awesome-Image-Composition)
35
- [![Static Badge](https://img.shields.io/badge/survey-arxiv%3A2106.14490-red)](https://arxiv.org/pdf/2106.14490.pdf)
36
-
37
- **We co-founded a startup company [miguo.ai](https://miguocomics.com/), dedicated to accelerating the production of comics and animations using AIGC technology. If you are seeking internship or full-time positions, please feel free to send your resume to hr@miguocomics.com.**
38
-
39
- ---
40
-
41
- ## Introduction
42
- **_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.
43
- <div align="center">
44
- </br>
45
- <img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/image_composition_task.gif" width="600" />
46
- </div>
47
-
48
- **_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.
49
-
50
- **The ultimate goal of this library is solving all the problems related to image composition with simple `import libcom`.**
51
-
52
- ### Main Functions
53
-
54
- - **get_composite_image** generates composite images using naive copy-and-paste followed by image blending.
55
- - **OPAScoreModel** [[OPA]](https://github.com/bcmi/Object-Placement-Assessment-Dataset-OPA) evaluates the rationality of foreground object placement in a composite image.
56
- - **FOPAHeatMapModel** [[FOPA]](https://github.com/bcmi/FOPA-Fast-Object-Placement-Assessment) can predict the rationality scores for all locations/scales given a background-foreground pair, and output the composite image with optimal location/scale.
57
- - **color_transfer** adjusts the foreground color to match the background using traditional color transfer method.
58
- - **ImageHarmonizationModel** [[CDTNet]](https://github.com/bcmi/CDTNet-High-Resolution-Image-Harmonization) [[PCTNet]](https://github.com/rakutentech/PCT-Net-Image-Harmonization) adjusts the foreground illumination to be compatible the background given photorealistic background and photorealistic foreground.
59
- - **PainterlyHarmonizationModel** [[PHDNet]](https://github.com/bcmi/PHDNet-Painterly-Image-Harmonization) [[PHDiffusion]](https://github.com/bcmi/PHDiffusion-Painterly-Image-Harmonization) adjusts the foreground style to be compatible with the background given artistic background and photorealistic foreground.
60
- - **HarmonyScoreModel** [[BargainNet]](https://github.com/bcmi/BargainNet-Image-Harmonization) evaluates the harmony level between foreground and background in a composite image.
61
- - **InharmoniousLocalizationModel** [[MadisNet]](https://github.com/bcmi/MadisNet-Inharmonious-Region-Localization) localizes the inharmonious region in a synthetic image.
62
- - **FOSScoreModel** [[DiscoFOS]](https://github.com/bcmi/Foreground-Object-Search-Dataset-FOSD) evaluates the compatibility between foreground and background in a composite image in terms of geometry and semantics.
63
- - **ShadowGenerationModel** [[GPSDiffusion]](https://github.com/bcmi/GPSDiffusion-Object-Shadow-Generation) generates plausible shadow for the inserted object in a composite image. This model is unstable and you can pick the most satisfactory one from multiple generated results.
64
- - **ControlComModel** [[ControlCom]](https://github.com/bcmi/ControlCom-Image-Composition) is a generative image composition model which unifies image blending and image harmonization. The pose and view of foreground stay unchanged.
65
- - **MureObjectStitchModel** [[MureObjectStitch]](https://github.com/bcmi/MureObjectStitch-Image-Composition) is another generative image composition model which can adjust the pose and view of foreground. It supports multiple reference images of one foreground object. If you have a few images containing the foreground object, we suggest finetuning MureObjectStitch using these images for better detail preservation.
66
-
67
-
68
- **For the detailed method descriptions, code examples, visualization results, and performance comments, please refer to our [[documents]](https://libcom.readthedocs.io/en/latest/).** If the model performance is not satisfactory, you can finetune the pretrained model on your own dataset using the source repository and replace the original model.
69
-
70
- ## Requirements
71
-
72
- 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).
73
-
74
- ## Get Started
75
- 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.
76
-
77
- ## Contributors
78
- - Institution: [Brain-like Computing and Machine Intelligence (BCMI) Lab](https://bcmi.sjtu.edu.cn/).
79
- - Project Initiator & Team Manager: [Li Niu](https://www.ustcnewly.com/index.html).
80
- - Architect & Lead Developer: [Bo Zhang](https://bo-zhang-cs.github.io/), [Yujie Zhou](https://github.com/YujieOuO).
81
- - Documentation Manager: [Jiacheng Sui](https://github.com/charlessjc).
82
- - 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), [Haonan Zhao](https://github.com/nononononno), [Jiaxuan Chen](https://github.com/csdahunzi), [Junqi You](https://github.com/dhmbb2).
83
-
84
- ## License
85
-
86
- This project is released under the [Apache 2.0 license](https://github.com/bcmi/libcom/blob/main/LICENSE).
87
-
88
- ## Bibtex
89
-
90
- If you use our toolbox, please cite our survey paper using the following BibTeX [[arxiv](https://arxiv.org/pdf/2106.14490.pdf)]:
91
-
92
- ```
93
- @article{niu2021making,
94
- title={Making images real again: A comprehensive survey on deep image composition},
95
- author={Niu, Li and Cong, Wenyan and Liu, Liu and Hong, Yan and Zhang, Bo and Liang, Jing and Zhang, Liqing},
96
- journal={arXiv preprint arXiv:2106.14490},
97
- year={2021}
98
- }
99
- ```
1
+ <div align="center">
2
+ </br>
3
+ <img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/LOGO.png" width="200" />
4
+
5
+ </div>
6
+
7
+ <h1 align="center">libcom: everything about image composition</h1>
8
+
9
+ </br>
10
+
11
+ [![PyPI](https://img.shields.io/pypi/v/libcom)](https://pypi.org/project/libcom)
12
+ [![Downloads](https://static.pepy.tech/badge/libcom)](https://pepy.tech/project/libcom)
13
+ [![Hits](https://hits.sh/github.com/bcmi/libcom.svg?label=views)](https://hits.sh/github.com/bcmi/libcom/)
14
+ [![Static Badge](https://img.shields.io/badge/Online_Demo-Green)](https://bcmi.sjtu.edu.cn/home/niuli/demo_image_composition/)
15
+ [![Static Badge](https://img.shields.io/badge/Dataset&Code_Resources-green)](https://github.com/bcmi/Awesome-Object-Insertion)
16
+ [![Static Badge](https://img.shields.io/badge/survey-arxiv%3A2106.14490-red)](https://arxiv.org/pdf/2106.14490.pdf)
17
+ [![Static Badge](https://img.shields.io/github/stars/bcmi/libcom.svg?style=social)](https://github.com/bcmi/libcom/stargazers)
18
+
19
+
20
+ ---
21
+
22
+ ## Introduction
23
+ **_libcom_ (the library of image composition) is an image composition toolbox.** The goal of [image composition](https://github.com/bcmi/Awesome-Image-Composition) ([object insertion](https://github.com/bcmi/Awesome-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.
24
+ <div align="center">
25
+ </br>
26
+ <img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/image_composition_task.gif" width="600" />
27
+ </div>
28
+
29
+ **_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.
30
+
31
+ **The ultimate goal of this library is solving all the problems related to image composition with simple `import libcom`.**
32
+
33
+ Welcome to follow WeChat public account ["Newly AIGCer"](https://www.ustcnewly.com/blog.html) or Zhihu Column ["Newly CVer"](https://www.zhihu.com/column/c_1333918224900206592) to get the latest information about image composition!
34
+
35
+ ### Main Functions
36
+
37
+ - **get_composite_image** generates composite images using naive copy-and-paste followed by image blending.
38
+ - **OPAScoreModel** [[OPA]](https://github.com/bcmi/Object-Placement-Assessment-Dataset-OPA) evaluates the rationality of foreground object placement in a composite image.
39
+ - **FOPAHeatMapModel** [[FOPA]](https://github.com/bcmi/FOPA-Fast-Object-Placement-Assessment) can predict the rationality scores for all locations/scales given a background-foreground pair, and output the composite image with optimal location/scale.
40
+ - **color_transfer** adjusts the foreground color to match the background using traditional color transfer method.
41
+ - **ImageHarmonizationModel** [[CDTNet]](https://github.com/bcmi/CDTNet-High-Resolution-Image-Harmonization) [[PCTNet]](https://github.com/rakutentech/PCT-Net-Image-Harmonization) adjusts the foreground illumination to be compatible the background given photorealistic background and photorealistic foreground.
42
+ - **PainterlyHarmonizationModel** [[PHDNet]](https://github.com/bcmi/PHDNet-Painterly-Image-Harmonization) [[PHDiffusion]](https://github.com/bcmi/PHDiffusion-Painterly-Image-Harmonization) adjusts the foreground style to be compatible with the background given artistic background and photorealistic foreground.
43
+ - **HarmonyScoreModel** [[BargainNet]](https://github.com/bcmi/BargainNet-Image-Harmonization) evaluates the harmony level between foreground and background in a composite image.
44
+ - **InharmoniousLocalizationModel** [[MadisNet]](https://github.com/bcmi/MadisNet-Inharmonious-Region-Localization) localizes the inharmonious region in a synthetic image.
45
+ - **FOSScoreModel** [[DiscoFOS]](https://github.com/bcmi/Foreground-Object-Search-Dataset-FOSD) evaluates the compatibility between foreground and background in a composite image in terms of geometry and semantics.
46
+ - **ShadowGenerationModel** [[GPSDiffusion]](https://github.com/bcmi/GPSDiffusion-Object-Shadow-Generation) generates plausible shadow for the inserted object in a composite image. This model is unstable and you can pick the most satisfactory one from multiple generated results.
47
+ - **ControlComModel** [[ControlCom]](https://github.com/bcmi/ControlCom-Image-Composition) is a generative image composition model which unifies image blending and image harmonization. The pose and view of foreground stay unchanged. **Note that in the provided foreground image, the foreground object's length and width should fully extend to the edges of the image (see our example), otherwise the performance would be severely affected.**
48
+ - **MureObjectStitchModel** [[MureObjectStitch]](https://github.com/bcmi/MureObjectStitch-Image-Composition) is another generative image composition model which can adjust the pose and view of foreground. It supports multiple reference images of one foreground object. If you have a few images containing the foreground object, we suggest finetuning MureObjectStitch using these images for better detail preservation. **Note that in the provided foreground image, the foreground object's length and width should fully extend to the edges of the image (see our example), otherwise the performance would be severely affected.**
49
+
50
+
51
+ **For the detailed method descriptions, code examples, visualization results, and performance comments, please refer to our [[documents]](https://libcom.readthedocs.io/en/latest/).** If the model performance is not satisfactory, you can finetune the pretrained model on your own dataset using the source repository and replace the original model.
52
+
53
+ ## Requirements
54
+
55
+ 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).
56
+
57
+ ## Get Started
58
+ Please refer to [[Installation]](https://github.com/bcmi/libcom/blob/test/docs/get_started.md) for installation instructions and [[documents]](https://libcom.readthedocs.io/en/latest/) for user guidance.
59
+
60
+ ## Contributors
61
+ - Institution: [Brain-like Computing and Machine Intelligence (BCMI) Lab](https://bcmi.sjtu.edu.cn/).
62
+ - Project Initiator & Team Manager: [Li Niu](https://www.ustcnewly.com/index.html).
63
+ - Architect & Lead Developer: [Bo Zhang](https://bo-zhang-cs.github.io/), [Yujie Zhou](https://github.com/YujieOuO).
64
+ - Documentation Manager: [Jiacheng Sui](https://github.com/charlessjc).
65
+ - Module Developers: [Jiacheng Sui](https://github.com/charlessjc), [Bingjie Gao](https://github.com/WhynotHAHA), [Lingxiao Lu](https://github.com/pokaaa), [Xinhao Tao](https://github.com/taoxinhao13), [Junyan Cao](https://github.com/cjy-4), [Haonan Zhao](https://github.com/nononononno), [Jiaxuan Chen](https://github.com/csdahunzi), [Junqi You](https://github.com/dhmbb2).
66
+
67
+ ## License
68
+
69
+ This project is released under the [Apache 2.0 license](https://github.com/bcmi/libcom/blob/main/LICENSE).
70
+
71
+ ## Bibtex
72
+
73
+ If you use our toolbox, please cite our survey paper using the following BibTeX [[arxiv](https://arxiv.org/pdf/2106.14490.pdf)]:
74
+
75
+ ```
76
+ @article{niu2021making,
77
+ title={Making images real again: A comprehensive survey on deep image composition},
78
+ author={Niu, Li and Cong, Wenyan and Liu, Liu and Hong, Yan and Zhang, Bo and Liang, Jing and Zhang, Liqing},
79
+ journal={arXiv preprint arXiv:2106.14490},
80
+ year={2021}
81
+ }
82
+ ```
@@ -7,14 +7,16 @@ from .image_harmonization import *
7
7
  from .painterly_image_harmonization import *
8
8
  from .fopa_heat_map import *
9
9
  from .fos_score import *
10
- from .controllable_composition import *
10
+ from .insert_anything import *
11
+ from .kontext_blending_harmonization import *
11
12
  from .shadow_generation import *
12
- from .objectstitch import *
13
+ from .reflection_generation import *
13
14
 
14
15
  __all__ = [
15
16
  'color_transfer', 'get_composite_image', 'OPAScoreModel',
16
17
  'HarmonyScoreModel', 'InharmoniousLocalizationModel',
17
18
  'ImageHarmonizationModel', 'PainterlyHarmonizationModel',
18
- 'FOPAHeatMapModel', 'FOSScoreModel', 'ControlComModel',
19
- 'ShadowGenerationModel', 'Mure_ObjectStitchModel'
19
+ 'FOPAHeatMapModel', 'FOSScoreModel',
20
+ 'InsertAnythingModel', 'KontextBlendingHarmonizationModel',
21
+ 'ShadowGenerationModel', 'ReflectionGenerationModel'
20
22
  ]
@@ -135,7 +135,7 @@ class FOPAHeatMapModel:
135
135
  icount += 1
136
136
  heatmap = Image.open(os.path.join(heatmap_dir, save_name))
137
137
  heatmap = np.array(heatmap)
138
- heatmap_center = np.zeros_like(heatmap, dtype=np.float_)
138
+ heatmap_center = np.zeros_like(heatmap, dtype=np.float64)
139
139
  hb = int(h / bg_img.height * heatmap.shape[0] / 2)
140
140
  wb = int(w / bg_img.width * heatmap.shape[1] / 2)
141
141
  heatmap_center[hb:-hb, wb:-wb] = heatmap[hb:-hb, wb:-wb]
@@ -176,14 +176,16 @@ class FOPAHeatMapModel:
176
176
  destination_path_png = os.path.join(composite_dir_choose, image.replace(".jpg", ".png"))
177
177
  shutil.copyfile(source_path, destination_path)
178
178
  shutil.copyfile(png_source_path, destination_path_png)
179
- last_four_numbers = [int(part) for part in source_path.split('_')[-5:-1]]
179
+ bbox_list_parts = os.path.splitext(os.path.split(source_path)[1])[0].split('_')
180
+ x_box, y_box, w_box, h_box = int(bbox_list_parts[2]), int(bbox_list_parts[3]), int(bbox_list_parts[4]), int(bbox_list_parts[5])
181
+ last_four_numbers = [x_box, y_box, w_box, h_box]
180
182
  bbox_list.append(last_four_numbers)
181
183
  return bbox_list
182
184
 
183
185
 
184
186
  @torch.no_grad()
185
187
  def __call__(self, foreground_image, foreground_mask, background_image, cache_dir, heatmap_dir,
186
- fg_scale_num=16, composite_num_choose=1, composite_num=50):
188
+ fg_scale_num=16, composite_num_choose=3, composite_num=50):
187
189
  """
188
190
  Generate a heatmap for a pair of scaled foreground and background.
189
191
 
@@ -208,7 +210,3 @@ class FOPAHeatMapModel:
208
210
  box_list = self.generate_bounding_box(foreground_image, foreground_mask, background_image, csv_file,
209
211
  cache_dir, heatmap_dir, fg_scale_num, composite_num_choose, composite_num)
210
212
  return box_list, heatmap_list
211
-
212
-
213
-
214
-
@@ -273,11 +273,11 @@ def make_composite_PIL(fg_img, mask_img, bg_img, pos, return_mask=False):
273
273
  mask_img_ = mask_img.resize((w,h))
274
274
 
275
275
  fg_img_ = np.array(fg_img_)
276
- mask_img_ = np.array(mask_img_, dtype=np.float_)/255
276
+ mask_img_ = np.array(mask_img_, dtype=np.float64)/255
277
277
  bg_img = np.array(bg_img)
278
278
 
279
279
  fg_img = np.zeros((bg_h, bg_w, 3), dtype=np.uint8)
280
- mask_img = np.zeros((bg_h, bg_w, 3), dtype=np.float_)
280
+ mask_img = np.zeros((bg_h, bg_w, 3), dtype=np.float64)
281
281
 
282
282
  fg_img[top:bottom, left:right, :] = fg_img_[top - y:bottom - y, left - x:right - x, :]
283
283
  mask_img[top:bottom, left:right, :] = mask_img_[top - y:bottom - y, left - x:right - x, :]
@@ -72,11 +72,11 @@ class FOSScoreModel:
72
72
  """
73
73
  if self.model_type == "FOS_E":
74
74
  model = StudentModel(self.cfg)
75
- model.load_state_dict(torch.load(weight_path, map_location='cpu'), strict=True)
75
+ model.load_state_dict(torch.load(weight_path, map_location='cpu', weights_only=True), strict=True)
76
76
  self.model = model.to(self.device).eval()
77
77
  else:
78
78
  model = SingleScaleD(False)
79
- model.load_state_dict(torch.load(weight_path, map_location='cpu'), strict=True)
79
+ model.load_state_dict(torch.load(weight_path, map_location='cpu', weights_only=True), strict=True)
80
80
  self.model = model.to(self.device).eval()
81
81
 
82
82
  def build_data_transformer(self):
@@ -57,7 +57,7 @@ class HarmonyScoreModel:
57
57
 
58
58
  def build_pretrained_model(self, weight_path):
59
59
  model = StyleEncoder(style_dim=16)
60
- model.load_state_dict(torch.load(weight_path, map_location='cpu'))
60
+ model.load_state_dict(torch.load(weight_path, map_location='cpu', weights_only=True))
61
61
  self.model = model.to(self.device).eval()
62
62
 
63
63
  def build_data_transformer(self):
@@ -77,7 +77,7 @@ class ImageHarmonizationModel:
77
77
  model = CDTNet()
78
78
  else:
79
79
  model = PCTNet()
80
- model.load_state_dict(torch.load(weight_path, map_location='cpu'))
80
+ model.load_state_dict(torch.load(weight_path, map_location='cpu', weights_only=True))
81
81
  self.model = model.to(self.device).eval()
82
82
 
83
83
  def build_data_transformer(self):
@@ -8,10 +8,7 @@ import numbers
8
8
  import torch.nn.functional as F
9
9
  from functools import partial
10
10
  import os
11
- import trilinear
12
11
 
13
-
14
-
15
12
 
16
13
  class Bottleneck(torch.nn.Module):
17
14
  expansion = 1
@@ -51,8 +51,8 @@ class InharmoniousLocalizationModel:
51
51
 
52
52
  def build_pretrained_model(self, weight_path_g, weight_path_ihdrnet):
53
53
  model = MadisNet()
54
- model.g.load_state_dict(torch.load(weight_path_g)['state_dict'])
55
- model.ihdrnet.load_state_dict(torch.load(weight_path_ihdrnet)['state_dict'])
54
+ model.g.load_state_dict(torch.load(weight_path_g, weights_only=True)['state_dict'])
55
+ model.ihdrnet.load_state_dict(torch.load(weight_path_ihdrnet, weights_only=True)['state_dict'])
56
56
  self.MadisNet_model = model.to(self.device).eval()
57
57
 
58
58
  def build_data_transformer(self):
@@ -0,0 +1,3 @@
1
+ from .insert_anything import InsertAnythingModel
2
+
3
+ __all__ = ['InsertAnythingModel']