(self, path, mask_type)
return InpaintDataset.bbox2mask(bbox, self.resize_shape)
Read Masks now only support bbox
Read Masks now only support bbox
Read Masks now only support bbox
def read_mask(self, path, mask_type):
        """
        Read Masks now only support bbox
        """
        if mask_type == 'random':
            bbox = InpaintDataset.random_bbox(self.resize_shape, self.random_bbox_margin, self.random_bbox_shape)
        elif mask_type == 'random_free_form':
            mask = InpaintDataset.random_ff_mask(self.random_ff_setting)
            return Image.fromarray(np.tile(mask,(1,1,3)).astype(np.uint8))
        elif 'val' in mask_type:
            mask = InpaintDataset.read_val_mask(path)
            return Image.fromarray(np.tile(mask,(1,1,3)).astype(np.uint8))
        else:
            bbox = InpaintDataset.read_bbox(path)
        return InpaintDataset.bbox2mask(bbox, self.resize_shape)
def read_mask ( self , path , mask_type ) : if mask_type == 'random' : bbox = InpaintDataset . random_bbox ( self . resize_shape , self . random_bbox_margin , self . random_bbox_shape ) elif mask_type == 'random_free_form' : mask = InpaintDataset . random_ff_mask ( self . random_ff_setting ) return Image . fromarray ( np . tile ( mask , ( 1 , 1 , 3 ) ) . astype ( np . uint8 ) ) elif 'val' in mask_type : mask = InpaintDataset . read_val_mask ( path ) return Image . fromarray ( np . tile ( mask , ( 1 , 1 , 3 ) ) . astype ( np . uint8 ) ) else : bbox = InpaintDataset . read_bbox ( path ) return InpaintDataset . bbox2mask ( bbox , self . resize_shape )