We introduce inter modality mixture in our paper as a novel data augmentation method. A quick explanation is shown here:
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:
1) alternative patch mixture.
we also have the following two mixtures:
2) random pixel level mixture: this one is simple, given a pixel, the pixel x has prob p to be type A and (1 - p) to be type B suppose we only have 2 types.
3) stochastic flood fill mixture: this one is stochastic version of flood fill.
We introduce inter modality mixture in our paper as a novel data augmentation method. A quick explanation is shown here:
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:
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:
Thanks!