libcom 0.1.3__tar.gz → 0.1.5.post1__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 (253) hide show
  1. {libcom-0.1.3/libcom.egg-info → libcom-0.1.5.post1}/PKG-INFO +67 -14
  2. libcom-0.1.3/PKG-INFO → libcom-0.1.5.post1/README.md +101 -100
  3. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/__init__.py +5 -4
  4. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fos_score/fos_score_prediction.py +19 -34
  5. libcom-0.1.5.post1/libcom/image_harmonization/image_harmonization.py +195 -0
  6. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/image_harmonization/source/pct_net.py +1 -1
  7. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/kontext_blending_harmonization/kontext_blending_harmonization.py +2 -2
  8. libcom-0.1.5.post1/libcom/os_insert/__init__.py +3 -0
  9. libcom-0.1.5.post1/libcom/os_insert/os_insert.py +529 -0
  10. libcom-0.1.5.post1/libcom/os_insert/source/__init__.py +1 -0
  11. libcom-0.1.5.post1/libcom/os_insert/source/ia_utils.py +183 -0
  12. libcom-0.1.5.post1/libcom/os_insert/source/insertanything_infer.py +524 -0
  13. libcom-0.1.5.post1/libcom/os_insert/source/objectstitch_data.py +66 -0
  14. libcom-0.1.5.post1/libcom/os_insert/source/objectstitch_infer.py +618 -0
  15. libcom-0.1.5.post1/libcom/os_insert/source/sam_on_objectstitch.py +253 -0
  16. libcom-0.1.5.post1/libcom/os_insert/source/utils.py +41 -0
  17. libcom-0.1.5.post1/libcom/os_insert/source/v1.yaml +108 -0
  18. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/reflection_generation.py +2 -5
  19. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/cldm/cldm.py +6 -6
  20. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/cldm/model.py +1 -1
  21. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/cldm_v15.yaml +1 -1
  22. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/models/autoencoder.py +4 -4
  23. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/models/diffusion/ddim.py +1 -1
  24. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/models/diffusion/ddpm.py +6 -6
  25. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/models/diffusion/plms.py +2 -2
  26. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/modules/attention.py +1 -1
  27. {libcom-0.1.3/libcom/shadow_generation → libcom-0.1.5.post1/libcom/reflection_generation}/source/ldm/modules/diffusionmodules/model.py +1 -1
  28. {libcom-0.1.3/libcom/shadow_generation → libcom-0.1.5.post1/libcom/reflection_generation}/source/ldm/modules/diffusionmodules/openaimodel.py +3 -3
  29. {libcom-0.1.3/libcom/shadow_generation → libcom-0.1.5.post1/libcom/reflection_generation}/source/ldm/modules/diffusionmodules/upscaling.py +2 -2
  30. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/modules/encoders/modules.py +1 -1
  31. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/shadow_generation.py +34 -14
  32. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/cldm/cldm.py +6 -6
  33. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/cldm/model.py +1 -1
  34. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/models/autoencoder.py +4 -4
  35. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/models/diffusion/ddim.py +1 -1
  36. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/models/diffusion/ddpm.py +6 -6
  37. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/models/diffusion/plms.py +2 -2
  38. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/attention.py +1 -1
  39. {libcom-0.1.3/libcom/reflection_generation → libcom-0.1.5.post1/libcom/shadow_generation}/source/ldm/modules/diffusionmodules/model.py +1 -1
  40. {libcom-0.1.3/libcom/reflection_generation → libcom-0.1.5.post1/libcom/shadow_generation}/source/ldm/modules/diffusionmodules/openaimodel.py +3 -3
  41. {libcom-0.1.3/libcom/reflection_generation → libcom-0.1.5.post1/libcom/shadow_generation}/source/ldm/modules/diffusionmodules/upscaling.py +2 -2
  42. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/diffusionmodules/util.py +1 -1
  43. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/encoders/modules.py +1 -1
  44. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/midas/api.py +4 -4
  45. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/utils/model_download.py +3 -2
  46. libcom-0.1.3/README.md → libcom-0.1.5.post1/libcom.egg-info/PKG-INFO +153 -84
  47. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom.egg-info/SOURCES.txt +24 -6
  48. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom.egg-info/requires.txt +5 -1
  49. {libcom-0.1.3 → libcom-0.1.5.post1}/setup.py +1 -1
  50. libcom-0.1.5.post1/tests/test_color_transfer.py +25 -0
  51. libcom-0.1.5.post1/tests/test_composite_generation.py +30 -0
  52. libcom-0.1.5.post1/tests/test_flux_kontext.py +35 -0
  53. libcom-0.1.5.post1/tests/test_fopa_heat_map.py +30 -0
  54. libcom-0.1.5.post1/tests/test_fos_score.py +27 -0
  55. libcom-0.1.5.post1/tests/test_harmony_score.py +32 -0
  56. libcom-0.1.5.post1/tests/test_image_harmonization.py +32 -0
  57. libcom-0.1.5.post1/tests/test_inharmonious_region_localization.py +26 -0
  58. libcom-0.1.5.post1/tests/test_opa_score.py +27 -0
  59. libcom-0.1.5.post1/tests/test_os_insert.py +39 -0
  60. libcom-0.1.5.post1/tests/test_painterly_image_harmonization.py +40 -0
  61. libcom-0.1.5.post1/tests/test_reflection_generation.py +43 -0
  62. libcom-0.1.5.post1/tests/test_shadow_generation.py +43 -0
  63. libcom-0.1.3/libcom/image_harmonization/image_harmonization.py +0 -128
  64. libcom-0.1.3/libcom/image_harmonization/source/cdt_net.py +0 -84
  65. libcom-0.1.3/libcom/insert_anything/__init__.py +0 -3
  66. libcom-0.1.3/libcom/insert_anything/insert_anything.py +0 -208
  67. libcom-0.1.3/libcom/insert_anything/source/utils.py +0 -144
  68. libcom-0.1.3/libcom/utils/__init__.py +0 -0
  69. {libcom-0.1.3 → libcom-0.1.5.post1}/LICENSE +0 -0
  70. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/color_transfer/__init__.py +0 -0
  71. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/color_transfer/reinhard.py +0 -0
  72. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/__init__.py +0 -0
  73. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/fopa_heat_map.py +0 -0
  74. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/__init__.py +0 -0
  75. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/backbone/ResNet.py +0 -0
  76. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/backbone/__init__.py +0 -0
  77. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/data/OBdataset.py +0 -0
  78. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/data/__init__.py +0 -0
  79. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/data/all_transforms.py +0 -0
  80. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/network/BaseBlocks.py +0 -0
  81. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/network/DynamicModules.py +0 -0
  82. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/network/ObPlaNet_simple.py +0 -0
  83. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/network/__init__.py +0 -0
  84. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/network/tensor_ops.py +0 -0
  85. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fopa_heat_map/source/prepare_multi_fg_scales.py +0 -0
  86. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fos_score/__init__.py +0 -0
  87. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fos_score/source/__init__.py +0 -0
  88. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fos_score/source/config/__init__.py +0 -0
  89. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fos_score/source/config/config.py +0 -0
  90. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fos_score/source/config/config.sfosd.yaml +0 -0
  91. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fos_score/source/config/config_rfosd.yaml +0 -0
  92. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fos_score/source/loss_function.py +0 -0
  93. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/fos_score/source/networks.py +0 -0
  94. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/harmony_score/__init__.py +0 -0
  95. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/harmony_score/harmony_score_prediction.py +0 -0
  96. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/harmony_score/source/__init__.py +0 -0
  97. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/harmony_score/source/bargainnet.py +0 -0
  98. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/image_harmonization/__init__.py +0 -0
  99. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/image_harmonization/source/__init__.py +0 -0
  100. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/image_harmonization/source/functions.py +0 -0
  101. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/inharmonious_region_localization/__init__.py +0 -0
  102. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/inharmonious_region_localization/inharmonious_region_localization.py +0 -0
  103. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/inharmonious_region_localization/source/__init__.py +0 -0
  104. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/inharmonious_region_localization/source/blocks.py +0 -0
  105. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/inharmonious_region_localization/source/functions.py +0 -0
  106. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/inharmonious_region_localization/source/madis_net.py +0 -0
  107. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/kontext_blending_harmonization/__init__.py +0 -0
  108. {libcom-0.1.3/libcom/insert_anything → libcom-0.1.5.post1/libcom/kontext_blending_harmonization}/source/__init__.py +0 -0
  109. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/kontext_blending_harmonization/source/pipeline.py +0 -0
  110. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/naive_composition/__init__.py +0 -0
  111. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/naive_composition/generate_composite_image.py +0 -0
  112. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/opa_score/__init__.py +0 -0
  113. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/opa_score/opa_score_prediction.py +0 -0
  114. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/opa_score/source/__init__.py +0 -0
  115. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/opa_score/source/object_place_net.py +0 -0
  116. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/opa_score/source/oblect_place_config.py +0 -0
  117. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/opa_score/source/resnet_4ch.py +0 -0
  118. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/__init__.py +0 -0
  119. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/painterly_image_harmonization.py +0 -0
  120. {libcom-0.1.3/libcom/kontext_blending_harmonization/source → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDNet}/__init__.py +0 -0
  121. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDNet/networks.py +0 -0
  122. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDNet/phdnet.py +0 -0
  123. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDNet/phdnet_config.py +0 -0
  124. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDNet → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDiffusion}/__init__.py +0 -0
  125. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDiffusion → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDiffusion/ldm}/__init__.py +0 -0
  126. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/inference_base.py +0 -0
  127. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/lr_scheduler.py +0 -0
  128. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDiffusion/ldm → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models}/__init__.py +0 -0
  129. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/autoencoder.py +0 -0
  130. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/__init__.py +0 -0
  131. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/ddim.py +0 -0
  132. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/ddpm.py +0 -0
  133. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/dpm_solver/__init__.py +0 -0
  134. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/dpm_solver/dpm_solver.py +0 -0
  135. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/dpm_solver/sampler.py +0 -0
  136. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/plms.py +0 -0
  137. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models/diffusion/scheduling_pndm.py +0 -0
  138. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/models → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules}/__init__.py +0 -0
  139. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/attention.py +0 -0
  140. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/diffusionmodules}/__init__.py +0 -0
  141. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/diffusionmodules/model.py +0 -0
  142. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/diffusionmodules/openaimodel.py +0 -0
  143. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/diffusionmodules/util.py +0 -0
  144. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/diffusionmodules → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/distributions}/__init__.py +0 -0
  145. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/distributions/distributions.py +0 -0
  146. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/ema.py +0 -0
  147. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/distributions → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/encoders}/__init__.py +0 -0
  148. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/encoders/adapter.py +0 -0
  149. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/encoders/modules.py +0 -0
  150. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/__init__.py +0 -0
  151. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/api.py +0 -0
  152. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/encoders → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas}/__init__.py +0 -0
  153. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/api.py +0 -0
  154. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas}/midas/__init__.py +0 -0
  155. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/base_model.py +0 -0
  156. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/blocks.py +0 -0
  157. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/dpt_depth.py +0 -0
  158. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/midas_net.py +0 -0
  159. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/midas_net_custom.py +0 -0
  160. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/transforms.py +0 -0
  161. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas/vit.py +0 -0
  162. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/utils.py +0 -0
  163. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/model_edge.py +0 -0
  164. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/midas/midas → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose}/__init__.py +0 -0
  165. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose/api.py +0 -0
  166. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose/body.py +0 -0
  167. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose/hand.py +0 -0
  168. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose/model.py +0 -0
  169. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose/util.py +0 -0
  170. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/utils.py +0 -0
  171. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/extra_condition/openpose → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/fusion}/__init__.py +0 -0
  172. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/fusion/dual_encoder_fusion.py +0 -0
  173. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/image_degradation/__init__.py +0 -0
  174. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/image_degradation/bsrgan.py +0 -0
  175. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/image_degradation/bsrgan_light.py +0 -0
  176. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/image_degradation/utils_image.py +0 -0
  177. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/util.py +0 -0
  178. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/painterly_image_harmonization/source/PHDiffusion/stable_diffusion.yaml +0 -0
  179. {libcom-0.1.3/libcom/painterly_image_harmonization/source/PHDiffusion/ldm/modules/fusion → libcom-0.1.5.post1/libcom/painterly_image_harmonization/source}/__init__.py +0 -0
  180. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/__init__.py +0 -0
  181. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/PostProcessModel.py +0 -0
  182. {libcom-0.1.3/libcom/painterly_image_harmonization → libcom-0.1.5.post1/libcom/reflection_generation}/source/__init__.py +0 -0
  183. {libcom-0.1.3/libcom/reflection_generation/source → libcom-0.1.5.post1/libcom/reflection_generation/source/cldm}/__init__.py +0 -0
  184. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/cldm/base_network.py +0 -0
  185. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/cldm/ddim_hacked.py +0 -0
  186. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/cldm/hack.py +0 -0
  187. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/cldm/logger.py +0 -0
  188. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/cluster_feature.py +0 -0
  189. {libcom-0.1.3/libcom/reflection_generation/source/cldm → libcom-0.1.5.post1/libcom/reflection_generation/source/ldm}/__init__.py +0 -0
  190. {libcom-0.1.3/libcom/reflection_generation/source/ldm → libcom-0.1.5.post1/libcom/reflection_generation/source/ldm/models}/__init__.py +0 -0
  191. {libcom-0.1.3/libcom/reflection_generation/source/ldm/models → libcom-0.1.5.post1/libcom/reflection_generation/source/ldm/models/diffusion}/__init__.py +0 -0
  192. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/models/diffusion/attention_processor.py +0 -0
  193. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/models/diffusion/dpm_solver/__init__.py +0 -0
  194. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/models/diffusion/dpm_solver/dpm_solver.py +0 -0
  195. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/models/diffusion/dpm_solver/sampler.py +0 -0
  196. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/models/diffusion/ip_adapter.py +0 -0
  197. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/models/diffusion/sampling_util.py +0 -0
  198. {libcom-0.1.3/libcom/reflection_generation/source/ldm/models/diffusion → libcom-0.1.5.post1/libcom/reflection_generation/source/ldm/modules}/__init__.py +0 -0
  199. {libcom-0.1.3/libcom/reflection_generation/source/ldm/modules → libcom-0.1.5.post1/libcom/reflection_generation/source/ldm/modules/diffusionmodules}/__init__.py +0 -0
  200. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/modules/diffusionmodules/util.py +0 -0
  201. {libcom-0.1.3/libcom/reflection_generation/source/ldm/modules/diffusionmodules → libcom-0.1.5.post1/libcom/reflection_generation/source/ldm/modules/distributions}/__init__.py +0 -0
  202. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/modules/distributions/distributions.py +0 -0
  203. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/modules/ema.py +0 -0
  204. {libcom-0.1.3/libcom/reflection_generation/source/ldm/modules/distributions → libcom-0.1.5.post1/libcom/reflection_generation/source/ldm/modules/encoders}/__init__.py +0 -0
  205. {libcom-0.1.3/libcom/reflection_generation/source/ldm/modules/encoders → libcom-0.1.5.post1/libcom/reflection_generation/source/ldm/modules/image_degradation}/__init__.py +0 -0
  206. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/modules/image_degradation/bsrgan.py +0 -0
  207. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/modules/image_degradation/bsrgan_light.py +0 -0
  208. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/modules/image_degradation/utils_image.py +0 -0
  209. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/ldm/util.py +0 -0
  210. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/local_clip.py +0 -0
  211. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/reflection_generation/source/tool_add_control.py +0 -0
  212. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/__init__.py +0 -0
  213. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/PostProcessModel.py +0 -0
  214. {libcom-0.1.3/libcom/reflection_generation/source/ldm/modules/image_degradation → libcom-0.1.5.post1/libcom/shadow_generation/source}/__init__.py +0 -0
  215. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/attention_processor.py +0 -0
  216. {libcom-0.1.3/libcom/shadow_generation/source → libcom-0.1.5.post1/libcom/shadow_generation/source/cldm}/__init__.py +0 -0
  217. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/cldm/base_network.py +0 -0
  218. {libcom-0.1.3/libcom/shadow_generation/source/cldm → libcom-0.1.5.post1/libcom/shadow_generation/source/ldm}/__init__.py +0 -0
  219. {libcom-0.1.3/libcom/shadow_generation/source/ldm → libcom-0.1.5.post1/libcom/shadow_generation/source/ldm/models}/__init__.py +0 -0
  220. {libcom-0.1.3/libcom/shadow_generation/source/ldm/models → libcom-0.1.5.post1/libcom/shadow_generation/source/ldm/models/diffusion}/__init__.py +0 -0
  221. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/models/diffusion/attention_processor.py +0 -0
  222. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/models/diffusion/dpm_solver/__init__.py +0 -0
  223. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/models/diffusion/dpm_solver/dpm_solver.py +0 -0
  224. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/models/diffusion/dpm_solver/sampler.py +0 -0
  225. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/models/diffusion/ip_adapter.py +0 -0
  226. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/models/diffusion/sampling_util.py +0 -0
  227. {libcom-0.1.3/libcom/shadow_generation/source/ldm/models/diffusion → libcom-0.1.5.post1/libcom/shadow_generation/source/ldm/modules}/__init__.py +0 -0
  228. {libcom-0.1.3/libcom/shadow_generation/source/ldm/modules → libcom-0.1.5.post1/libcom/shadow_generation/source/ldm/modules/diffusionmodules}/__init__.py +0 -0
  229. {libcom-0.1.3/libcom/shadow_generation/source/ldm/modules/diffusionmodules → libcom-0.1.5.post1/libcom/shadow_generation/source/ldm/modules/distributions}/__init__.py +0 -0
  230. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/distributions/distributions.py +0 -0
  231. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/ema.py +0 -0
  232. {libcom-0.1.3/libcom/shadow_generation/source/ldm/modules/distributions → libcom-0.1.5.post1/libcom/shadow_generation/source/ldm/modules/encoders}/__init__.py +0 -0
  233. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/image_degradation/__init__.py +0 -0
  234. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/image_degradation/bsrgan.py +0 -0
  235. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/image_degradation/bsrgan_light.py +0 -0
  236. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/image_degradation/utils_image.py +0 -0
  237. {libcom-0.1.3/libcom/shadow_generation/source/ldm/modules/encoders → libcom-0.1.5.post1/libcom/shadow_generation/source/ldm/modules/midas}/__init__.py +0 -0
  238. {libcom-0.1.3/libcom/shadow_generation/source/ldm/modules → libcom-0.1.5.post1/libcom/shadow_generation/source/ldm/modules/midas}/midas/__init__.py +0 -0
  239. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/midas/midas/base_model.py +0 -0
  240. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/midas/midas/blocks.py +0 -0
  241. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/midas/midas/dpt_depth.py +0 -0
  242. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/midas/midas/midas_net.py +0 -0
  243. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/midas/midas/midas_net_custom.py +0 -0
  244. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/midas/midas/transforms.py +0 -0
  245. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/midas/midas/vit.py +0 -0
  246. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/modules/midas/utils.py +0 -0
  247. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/shadow_generation/source/ldm/util.py +0 -0
  248. {libcom-0.1.3/libcom/shadow_generation/source/ldm/modules/midas/midas → libcom-0.1.5.post1/libcom/utils}/__init__.py +0 -0
  249. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/utils/environment.py +0 -0
  250. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom/utils/process_image.py +0 -0
  251. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom.egg-info/dependency_links.txt +0 -0
  252. {libcom-0.1.3 → libcom-0.1.5.post1}/libcom.egg-info/top_level.txt +0 -0
  253. {libcom-0.1.3 → libcom-0.1.5.post1}/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.3
3
+ Version: 0.1.5.post1
4
4
  Summary: Image Composition Toolbox
5
5
  Home-page: https://github.com/bcmi/libcom
6
6
  Author: BCMI Lab
@@ -13,6 +13,42 @@ Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3.8
14
14
  Description-Content-Type: text/markdown
15
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==4.44.2
33
+ Requires-Dist: tqdm
34
+ Requires-Dist: open_clip_torch
35
+ Requires-Dist: taming-transformers-rom1504
36
+ Requires-Dist: scikit-learn
37
+ Requires-Dist: segment_anything
38
+ Requires-Dist: clip
39
+ Requires-Dist: pydantic==2.6.1
40
+ Requires-Dist: lpips==0.1.4
41
+ Dynamic: author
42
+ Dynamic: author-email
43
+ Dynamic: classifier
44
+ Dynamic: description
45
+ Dynamic: description-content-type
46
+ Dynamic: home-page
47
+ Dynamic: keywords
48
+ Dynamic: license
49
+ Dynamic: license-file
50
+ Dynamic: requires-dist
51
+ Dynamic: summary
16
52
 
17
53
  <div align="center">
18
54
  </br>
@@ -27,12 +63,11 @@ License-File: LICENSE
27
63
  [![PyPI](https://img.shields.io/pypi/v/libcom)](https://pypi.org/project/libcom)
28
64
  [![Downloads](https://static.pepy.tech/badge/libcom)](https://pepy.tech/project/libcom)
29
65
  [![Hits](https://hits.sh/github.com/bcmi/libcom.svg?label=views)](https://hits.sh/github.com/bcmi/libcom/)
30
- [![Static Badge](https://img.shields.io/badge/Online_Demo-Green)](https://bcmi.sjtu.edu.cn/home/niuli/demo_image_composition/)
66
+ [![Static Badge](https://img.shields.io/badge/Online_Workbench-yellow)](https://libcom.ustcnewly.com/)
31
67
  [![Static Badge](https://img.shields.io/badge/Dataset&Code_Resources-green)](https://github.com/bcmi/Awesome-Object-Insertion)
32
68
  [![Static Badge](https://img.shields.io/badge/survey-arxiv%3A2106.14490-red)](https://arxiv.org/pdf/2106.14490.pdf)
33
69
  [![Static Badge](https://img.shields.io/github/stars/bcmi/libcom.svg?style=social)](https://github.com/bcmi/libcom/stargazers)
34
70
 
35
-
36
71
  ---
37
72
 
38
73
  ## Introduction
@@ -42,28 +77,39 @@ License-File: LICENSE
42
77
  <img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/image_composition_task.gif" width="600" />
43
78
  </div>
44
79
 
45
- **_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.
46
-
47
- **The ultimate goal of this library is solving all the problems related to image composition with simple `import libcom`.**
80
+ **_libcom_ covers a diversity of related tasks in the field of image composition**, including image blending, standard/painterly image harmonization, shadow generation, reflection 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.
48
81
 
82
+ **The ultimate goal of this library is solving all the problems related to image composition with simple `import libcom`.**
49
83
  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!
50
84
 
51
- ### Main Functions
85
+ We compare the performance of Libcom and Banana Pro across various image composition tasks and write a brief summary in [English](https://zhuanlan.zhihu.com/p/1992987450860118091)/[Chinese](https://zhuanlan.zhihu.com/p/1976625829741082597).
86
+
87
+ ## Online Workbench
88
+
89
+ We have built the [image composition workbench](https://libcom.ustcnewly.com/) based on our Libcom toolbox. The interface is as follows:
90
+
91
+ <div align="center">
92
+ </br>
93
+ <img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/online_workbench.jpg" width="1000" />
94
+ </div>
95
+
96
+ [![]](https://github.com/user-attachments/assets/87416ec5-2461-42cb-9f2d-5030b1e1b5ec)
97
+
98
+ ## Main Functions
52
99
 
53
100
  - **get_composite_image** generates composite images using naive copy-and-paste followed by image blending.
54
101
  - **OPAScoreModel** [[OPA]](https://github.com/bcmi/Object-Placement-Assessment-Dataset-OPA) evaluates the rationality of foreground object placement in a composite image.
55
102
  - **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.
56
103
  - **color_transfer** adjusts the foreground color to match the background using traditional color transfer method.
57
- - **ImageHarmonizationModel** [[PCTNet]](https://github.com/rakutentech/PCT-Net-Image-Harmonization) adjusts the foreground illumination to be compatible the background given photorealistic background and photorealistic foreground.
104
+ - **ImageHarmonizationModel** [[PCTNet]](https://github.com/rakutentech/PCT-Net-Image-Harmonization) [[LBM]](https://github.com/gojasper/LBM) adjusts the foreground illumination to be compatible the background given photorealistic background and photorealistic foreground.
58
105
  - **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.
59
106
  - **HarmonyScoreModel** [[BargainNet]](https://github.com/bcmi/BargainNet-Image-Harmonization) evaluates the harmony level between foreground and background in a composite image.
60
107
  - **InharmoniousLocalizationModel** [[MadisNet]](https://github.com/bcmi/MadisNet-Inharmonious-Region-Localization) localizes the inharmonious region in a synthetic image.
61
- - **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.
108
+ - **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.
62
109
  - **ShadowGenerationModel** [[GPSDiffusion]](https://github.com/bcmi/GPSDiffusion-Object-Shadow-Generation) generates plausible shadow for the inserted object in a composite image.
63
- - **ReflectionGenerationModel** generates plausible reflection for the inserted object in a composite image.
110
+ - **ReflectionGenerationModel** [[RGDiffusion]](https://github.com/bcmi/Object-Reflection-Generation-Dataset-DEROBA) generates plausible reflection for the inserted object in a composite image.
64
111
  - **KontextBlendingHarmonizationModel** [[FluxKontext]](https://github.com/black-forest-labs/flux) is a generative image composition model which inserts foreground into the specified bounding box in the background. The pose and view of foreground stay unchanged. The "blending" mode does not adjust the foreground illumination, while the "harmonization" mode adjusts the foreground illumination to make the composite image harmonious.
65
- - **InsertAnythingModel** [[InsertAnything]](https://github.com/song-wensong/insert-anything) is a generative image composition model which inserts foreground into the specified bounding box in the background. The model has reasonable ability to adjust the pose and view of foreground according to the background.
66
-
112
+ - **OSInsertModel** [[OSInsert]](https://github.com/bcmi/OSInsert-Image-Composition) is a generative image composition model which inserts foreground into the specified bounding box in the background. The "conservative" mode has weak ability to adjust the pose and view of foreground according to the background. The "aggressive" mode has stronger ability to adjust the pose and view of foreground according to the background.
67
113
 
68
114
  **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
115
 
@@ -78,7 +124,6 @@ Please refer to [[Installation]](https://github.com/bcmi/libcom/blob/main/docs/g
78
124
  - Institution: [Brain-like Computing and Machine Intelligence (BCMI) Lab](https://bcmi.sjtu.edu.cn/).
79
125
  - Project Initiator & Team Manager: [Li Niu](https://www.ustcnewly.com/index.html).
80
126
  - 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
127
  - 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
128
 
84
129
  ## License
@@ -98,3 +143,11 @@ If you use our toolbox, please cite our survey paper using the following BibTeX
98
143
  }
99
144
  ```
100
145
 
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
@@ -1,100 +1,101 @@
1
- Metadata-Version: 2.1
2
- Name: libcom
3
- Version: 0.1.3
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
- License-File: LICENSE
16
-
17
- <div align="center">
18
- </br>
19
- <img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/LOGO.png" width="200" />
20
-
21
- </div>
22
-
23
- <h1 align="center">libcom: everything about image composition</h1>
24
-
25
- </br>
26
-
27
- [![PyPI](https://img.shields.io/pypi/v/libcom)](https://pypi.org/project/libcom)
28
- [![Downloads](https://static.pepy.tech/badge/libcom)](https://pepy.tech/project/libcom)
29
- [![Hits](https://hits.sh/github.com/bcmi/libcom.svg?label=views)](https://hits.sh/github.com/bcmi/libcom/)
30
- [![Static Badge](https://img.shields.io/badge/Online_Demo-Green)](https://bcmi.sjtu.edu.cn/home/niuli/demo_image_composition/)
31
- [![Static Badge](https://img.shields.io/badge/Dataset&Code_Resources-green)](https://github.com/bcmi/Awesome-Object-Insertion)
32
- [![Static Badge](https://img.shields.io/badge/survey-arxiv%3A2106.14490-red)](https://arxiv.org/pdf/2106.14490.pdf)
33
- [![Static Badge](https://img.shields.io/github/stars/bcmi/libcom.svg?style=social)](https://github.com/bcmi/libcom/stargazers)
34
-
35
-
36
- ---
37
-
38
- ## Introduction
39
- **_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.
40
- <div align="center">
41
- </br>
42
- <img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/image_composition_task.gif" width="600" />
43
- </div>
44
-
45
- **_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.
46
-
47
- **The ultimate goal of this library is solving all the problems related to image composition with simple `import libcom`.**
48
-
49
- 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!
50
-
51
- ### Main Functions
52
-
53
- - **get_composite_image** generates composite images using naive copy-and-paste followed by image blending.
54
- - **OPAScoreModel** [[OPA]](https://github.com/bcmi/Object-Placement-Assessment-Dataset-OPA) evaluates the rationality of foreground object placement in a composite image.
55
- - **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.
56
- - **color_transfer** adjusts the foreground color to match the background using traditional color transfer method.
57
- - **ImageHarmonizationModel** [[PCTNet]](https://github.com/rakutentech/PCT-Net-Image-Harmonization) adjusts the foreground illumination to be compatible the background given photorealistic background and photorealistic foreground.
58
- - **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.
59
- - **HarmonyScoreModel** [[BargainNet]](https://github.com/bcmi/BargainNet-Image-Harmonization) evaluates the harmony level between foreground and background in a composite image.
60
- - **InharmoniousLocalizationModel** [[MadisNet]](https://github.com/bcmi/MadisNet-Inharmonious-Region-Localization) localizes the inharmonious region in a synthetic image.
61
- - **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.
62
- - **ShadowGenerationModel** [[GPSDiffusion]](https://github.com/bcmi/GPSDiffusion-Object-Shadow-Generation) generates plausible shadow for the inserted object in a composite image.
63
- - **ReflectionGenerationModel** generates plausible reflection for the inserted object in a composite image.
64
- - **KontextBlendingHarmonizationModel** [[FluxKontext]](https://github.com/black-forest-labs/flux) is a generative image composition model which inserts foreground into the specified bounding box in the background. The pose and view of foreground stay unchanged. The "blending" mode does not adjust the foreground illumination, while the "harmonization" mode adjusts the foreground illumination to make the composite image harmonious.
65
- - **InsertAnythingModel** [[InsertAnything]](https://github.com/song-wensong/insert-anything) is a generative image composition model which inserts foreground into the specified bounding box in the background. The model has reasonable ability to adjust the pose and view of foreground according to the background.
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.10** and **PyTorch>=2.6**. For other dependencies, please refer to [[requirements]](https://github.com/bcmi/libcom/blob/main/requirements.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), [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
-
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
- ```
100
-
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_Workbench-yellow)](https://libcom.ustcnewly.com/)
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
+ ## Introduction
22
+ **_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.
23
+ <div align="center">
24
+ </br>
25
+ <img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/image_composition_task.gif" width="600" />
26
+ </div>
27
+
28
+ **_libcom_ covers a diversity of related tasks in the field of image composition**, including image blending, standard/painterly image harmonization, shadow generation, reflection 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.
29
+
30
+ **The ultimate goal of this library is solving all the problems related to image composition with simple `import libcom`.**
31
+ 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!
32
+
33
+ We compare the performance of Libcom and Banana Pro across various image composition tasks and write a brief summary in [English](https://zhuanlan.zhihu.com/p/1992987450860118091)/[Chinese](https://zhuanlan.zhihu.com/p/1976625829741082597).
34
+
35
+ ## Online Workbench
36
+
37
+ We have built the [image composition workbench](https://libcom.ustcnewly.com/) based on our Libcom toolbox. The interface is as follows:
38
+
39
+ <div align="center">
40
+ </br>
41
+ <img src="https://raw.githubusercontent.com/bcmi/libcom/main/resources/online_workbench.jpg" width="1000" />
42
+ </div>
43
+
44
+ [![]](https://github.com/user-attachments/assets/87416ec5-2461-42cb-9f2d-5030b1e1b5ec)
45
+
46
+ ## Main Functions
47
+
48
+ - **get_composite_image** generates composite images using naive copy-and-paste followed by image blending.
49
+ - **OPAScoreModel** [[OPA]](https://github.com/bcmi/Object-Placement-Assessment-Dataset-OPA) evaluates the rationality of foreground object placement in a composite image.
50
+ - **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.
51
+ - **color_transfer** adjusts the foreground color to match the background using traditional color transfer method.
52
+ - **ImageHarmonizationModel** [[PCTNet]](https://github.com/rakutentech/PCT-Net-Image-Harmonization) [[LBM]](https://github.com/gojasper/LBM) adjusts the foreground illumination to be compatible the background given photorealistic background and photorealistic foreground.
53
+ - **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.
54
+ - **HarmonyScoreModel** [[BargainNet]](https://github.com/bcmi/BargainNet-Image-Harmonization) evaluates the harmony level between foreground and background in a composite image.
55
+ - **InharmoniousLocalizationModel** [[MadisNet]](https://github.com/bcmi/MadisNet-Inharmonious-Region-Localization) localizes the inharmonious region in a synthetic image.
56
+ - **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.
57
+ - **ShadowGenerationModel** [[GPSDiffusion]](https://github.com/bcmi/GPSDiffusion-Object-Shadow-Generation) generates plausible shadow for the inserted object in a composite image.
58
+ - **ReflectionGenerationModel** [[RGDiffusion]](https://github.com/bcmi/Object-Reflection-Generation-Dataset-DEROBA) generates plausible reflection for the inserted object in a composite image.
59
+ - **KontextBlendingHarmonizationModel** [[FluxKontext]](https://github.com/black-forest-labs/flux) is a generative image composition model which inserts foreground into the specified bounding box in the background. The pose and view of foreground stay unchanged. The "blending" mode does not adjust the foreground illumination, while the "harmonization" mode adjusts the foreground illumination to make the composite image harmonious.
60
+ - **OSInsertModel** [[OSInsert]](https://github.com/bcmi/OSInsert-Image-Composition) is a generative image composition model which inserts foreground into the specified bounding box in the background. The "conservative" mode has weak ability to adjust the pose and view of foreground according to the background. The "aggressive" mode has stronger ability to adjust the pose and view of foreground according to the background.
61
+
62
+ **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.
63
+
64
+ ## Requirements
65
+
66
+ The main branch is built on the Linux system with **Python 3.10** and **PyTorch>=2.6**. For other dependencies, please refer to [[requirements]](https://github.com/bcmi/libcom/blob/main/requirements.txt).
67
+
68
+ ## Get Started
69
+ 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.
70
+
71
+ ## Contributors
72
+ - Institution: [Brain-like Computing and Machine Intelligence (BCMI) Lab](https://bcmi.sjtu.edu.cn/).
73
+ - Project Initiator & Team Manager: [Li Niu](https://www.ustcnewly.com/index.html).
74
+ - Architect & Lead Developer: [Bo Zhang](https://bo-zhang-cs.github.io/), [Yujie Zhou](https://github.com/YujieOuO).
75
+ - 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).
76
+
77
+ ## License
78
+
79
+ This project is released under the [Apache 2.0 license](https://github.com/bcmi/libcom/blob/main/LICENSE).
80
+
81
+ ## Bibtex
82
+
83
+ If you use our toolbox, please cite our survey paper using the following BibTeX [[arxiv](https://arxiv.org/pdf/2106.14490.pdf)]:
84
+
85
+ ```
86
+ @article{niu2021making,
87
+ title={Making images real again: A comprehensive survey on deep image composition},
88
+ author={Niu, Li and Cong, Wenyan and Liu, Liu and Hong, Yan and Zhang, Bo and Liang, Jing and Zhang, Liqing},
89
+ journal={arXiv preprint arXiv:2106.14490},
90
+ year={2021}
91
+ }
92
+ ```
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
@@ -3,20 +3,21 @@ from .naive_composition import *
3
3
  from .opa_score import *
4
4
  from .harmony_score import *
5
5
  from .inharmonious_region_localization import *
6
- from .image_harmonization import *
6
+ from .image_harmonization_old import *
7
7
  from .painterly_image_harmonization import *
8
8
  from .fopa_heat_map import *
9
9
  from .fos_score import *
10
- from .insert_anything import *
11
10
  from .kontext_blending_harmonization import *
12
11
  from .shadow_generation import *
13
12
  from .reflection_generation import *
13
+ from .os_insert import *
14
14
 
15
15
  __all__ = [
16
16
  'color_transfer', 'get_composite_image', 'OPAScoreModel',
17
17
  'HarmonyScoreModel', 'InharmoniousLocalizationModel',
18
18
  'ImageHarmonizationModel', 'PainterlyHarmonizationModel',
19
19
  'FOPAHeatMapModel', 'FOSScoreModel',
20
- 'InsertAnythingModel', 'KontextBlendingHarmonizationModel',
21
- 'ShadowGenerationModel', 'ReflectionGenerationModel'
20
+ 'KontextBlendingHarmonizationModel',
21
+ 'ShadowGenerationModel', 'ReflectionGenerationModel',
22
+ 'OSInsertModel'
22
23
  ]
@@ -14,7 +14,7 @@ from torchvision.utils import save_image
14
14
  from einops import rearrange
15
15
  cur_dir = os.path.dirname(os.path.abspath(__file__))
16
16
  model_dir = os.environ.get('LIBCOM_MODEL_DIR',cur_dir)
17
- model_set = ['FOS_D', 'FOS_E']
17
+ model_set = ['FOS_D']
18
18
 
19
19
  class FOSScoreModel:
20
20
  """
@@ -31,7 +31,7 @@ class FOSScoreModel:
31
31
  >>> import cv2
32
32
  >>> import torch
33
33
  >>> task_name = 'fos_score_prediction'
34
- >>> MODEL_TYPE = 'FOS_D' # choose from 'FOS_D', 'FOS_E'
34
+ >>> MODEL_TYPE = 'FOS_D'
35
35
  >>> background = '../tests/source/background/f80eda2459853824_m09g1w_b2413ec8_11.png'
36
36
  >>> fg_bbox = [175, 82, 309, 310] # x1,y1,x2,y2
37
37
  >>> foreground = '../tests/source/foreground/f80eda2459853824_m09g1w_b2413ec8_11.png'
@@ -70,14 +70,10 @@ class FOSScoreModel:
70
70
  """
71
71
  Build pretrained model from path of weight.
72
72
  """
73
- if self.model_type == "FOS_E":
74
- model = StudentModel(self.cfg)
75
- model.load_state_dict(torch.load(weight_path, map_location='cpu', weights_only=True), strict=True)
76
- self.model = model.to(self.device).eval()
77
- else:
78
- model = SingleScaleD(False)
79
- model.load_state_dict(torch.load(weight_path, map_location='cpu', weights_only=True), strict=True)
80
- self.model = model.to(self.device).eval()
73
+
74
+ model = SingleScaleD(False)
75
+ model.load_state_dict(torch.load(weight_path, map_location='cpu', weights_only=True), strict=True)
76
+ self.model = model.to(self.device).eval()
81
77
 
82
78
  def build_data_transformer(self):
83
79
  self.image_size = self.cfg.image_size
@@ -94,17 +90,14 @@ class FOSScoreModel:
94
90
  if foreground_mask is not None:
95
91
  fg_mask = cv2.cvtColor(read_image_opencv(foreground_mask), cv2.COLOR_BGR2GRAY)
96
92
  assert fg.shape[:2] == fg_mask.shape
97
- fg[np.where(fg_mask != 255)] = 255
98
- if self.model_type == 'FOS_D':
99
- x1, y1, x2, y2 = bbox
100
- rs_fg = cv2.resize(fg.copy(), (x2 - x1, y2 - y1))
101
- bg[y1:y2, x1:x2] = rs_fg
102
- x1, y1, x2, y2 = self.get_crop_bbox(bbox, bg_h, bg_w)
103
- scale_comp = bg.copy()
104
- scale_comp_r = Image.fromarray(scale_comp, mode="RGB")
105
- return scale_comp_r
106
-
107
- return bg, fg
93
+ fg[np.where(fg_mask != 255)] = 128
94
+ x1, y1, x2, y2 = bbox
95
+ rs_fg = cv2.resize(fg.copy(), (x2 - x1, y2 - y1))
96
+ bg[y1:y2, x1:x2] = rs_fg
97
+ x1, y1, x2, y2 = self.get_crop_bbox(bbox, bg_h, bg_w)
98
+ scale_comp = bg.copy()[y1:y2, x1:x2]
99
+ scale_comp_r = Image.fromarray(scale_comp, mode="RGB")
100
+ return scale_comp_r
108
101
 
109
102
  def get_crop_bbox(self, bbox, bg_h, bg_w):
110
103
  x1, y1, x2, y2 = bbox
@@ -185,19 +178,11 @@ class FOSScoreModel:
185
178
  fos_score (float): Predicted compatibility score between the given background image and the given foreground image.
186
179
 
187
180
  """
188
- if self.model_type == 'FOS_E':
189
- background_image, foreground_image = self.inputs_preprocess(background_image, foreground_image, foreground_mask, bounding_box)
190
- sample = self.prepare_input_encoders(background_image, foreground_image, bounding_box)
191
- bg_im = sample['bg'].to(self.device)
192
- fg_im = sample['fg'].to(self.device)
193
- q_box = sample['query_box'].to(self.device)
194
- c_box = sample['crop_box'].to(self.device)
195
- output = self.model(bg_im, fg_im, q_box, c_box)[-1].item()
196
- else:
197
- composite_image = self.inputs_preprocess(background_image, foreground_image, foreground_mask, bounding_box)
198
- composite_image = self.prepare_input_disc(composite_image).to(self.device)
199
- _, score = self.model(composite_image)
200
- output = score[-1].item()
181
+
182
+ composite_image = self.inputs_preprocess(background_image, foreground_image, foreground_mask, bounding_box)
183
+ composite_image = self.prepare_input_disc(composite_image).to(self.device)
184
+ _, score = self.model(composite_image)
185
+ output = score[-1].item()
201
186
  return output
202
187
 
203
188
  def fill_box_with_specified_pixel(bg_im, query_box, fill_value):