liketheflower / UODDM

Apache License 2.0
3 stars 1 forks source link

Implement inter modality mixture #13

Open liketheflower opened 2 years ago

liketheflower commented 2 years ago

We introduce inter modality mixture in our paper as a novel data augmentation method. A quick explanation is shown here: InterModalityMixture

Please implement a function and put it in the path of: /sunrgbd/data_preparation/

With the code name of "inter_modality_mixture.py" With the function name, argument and output as:

def inter_modality_mixture(rgb_filename: str, dhs_filename: str, patch_size: int, first_patch:str = "rgb", save_path: str, save_filename: str):
    """
    Implement the inter modality mixture.
    Parameters:
       rgb_filename: the file name of the RGB image.
       dhs_filename: the filename of the DHS image.
       patch_size: the size of each square patch. For simplicity, we use square instead of rectangle, so it only need one parameter.
       first_patch: whether the first patch is from rgb or dhs. We should support both begin with rgb or dhs.
       save_path: the path used to save the image after the inter modality mixture
       save_filename: The name used to save the mixture image.
    Return:
      None as the generated file is saved.
    """

Please test the output of the image by using a relative large patch_size for both begin with "rbg" and "dhs". You can test based on two images here:

https://github.com/liketheflower/YONOD/tree/master/sunrgbd/demo_images

Thanks!

liketheflower commented 2 years ago

Let's name this one as:

ii and iii will have separate issues.