bcmi / libcom

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

Libcom on x-ray image domain #42

Closed pILLOW-1 closed 3 weeks ago

pILLOW-1 commented 3 weeks ago

Hi, great work! I want to use libcom on my x-ray image dataset. Specifically, given a background x-ray image, the insertion location and a foreground x-ray image. I want to insert the foreground to the corresponding location of the background image. During my experiment, I find that libcom cannot handle x-ray images well. Below are some examples(the first column is background_image, the second column is foreground_image, and the third column is the composited image):

scissors baton bullet hammer handcuff hammer_2

Several problems include but not limited to: object missing(1st & 3rd row), object distortion(2nd row), extra information(4th row) and occlusion issue(5th row) How can I improve libcom to better handle x-ray domain? To be more specific, I hope it can automatically adjust the foreground object pose, faithfully composite the object and ensure the background harmony in occlusion conditions. Personally, I think libcom has the potential to solve the above problems because there are indeed good cases( such as in 6th row, although the boundary is not so perfect). Looking forward to your answers! Thanks!

YujieOuO commented 3 weeks ago

Thanks for your attention. The current image composition method is heavily influenced by the domain of the training data. For samples not seen in the training set, the model may not achieve good results. This is why the model can understand and perform reasonable composition when the foreground is a hammer, but other difficult foreground objects could not.

Here are some suggestions:

  1. Replace with a clearer and higher resolution foreground image, and crop the foreground image to position the object at the center of the image.
  2. Try using the MureObjectStitchModel from our repository, which supports multiple foreground images, or try its fine-tuned version: https://github.com/bcmi/MureObjectStitch-Image-Composition
pILLOW-1 commented 3 weeks ago

OK. I will try it! Thank you!