bcmi / libcom

Image composition toolbox: everything you want to know about image composition or object insertion
Apache License 2.0
276 stars 18 forks source link

Unexpected harmonization results #37

Closed galih112 closed 3 months ago

galih112 commented 3 months ago

Hi, I am testing both PCTNet and CDTNet for harmonization. I am getting bad results when using my own images as well as when I use images provided by you. specifically I tried libcom/tests/harmony_score_prediction/composite/ameland-5651866_harm.jpg and its corresponding mask. (the images you are showing in the docs are not available at this repo) any idea to what could be the problem? I am following the example provided in the docs

Use CDTNet

CDTNet = ImageHarmonizationModel(device=0, model_type='CDTNet') comp_img1 = image_path comp_mask1 = mask_pth CDT_result1 = CDTNet(comp_img1, comp_mask1)

Use PCTNet

PCTNet = ImageHarmonizationModel(device=0, model_type='PCTNet') comp_img1 = image_path comp_mask1 = mask_pth PCT_result1 = PCTNet(comp_img1, comp_mask1)

Thanks

YujieOuO commented 3 months ago

hi, we provide some harmonization case in the /tests/source/composite folder. f190c2cb4187184b9cd610161c66829

the result of CDTNet: 8e2f237eeddeac61dfbfd6c9144cfba

For this case, the foreground color changes are not obvious due to the dark background. CDTNet is a model for global image color adjustment, which could not handle this case very well.