diff --git a/utils/one_hot_encoder.py b/utils/one_hot_encoder.py index f29de19..0fc55ac 100644 --- a/utils/one_hot_encoder.py +++ b/utils/one_hot_encoder.py @@ -50,6 +50,7 @@ def PerPixelClassMatrix(self, Image): class_map[x][y]= self.color[clr] return class_map def HotEncode(self, class_map): + """Returns an n channel one hot encoded matrix of the same size as the Image""" assert isinstance(class_map, np.ndarray), "Class map has to be an ndarray and not {}".format(type(class_map)) shape_= class_map.shape encoded= np.zeros(shape= (shape_[0], shape_[1], len(self.color)), dtype=float) @@ -62,4 +63,10 @@ def HotEncode(self, class_map): def channelSplit(self,Nch_Hot_encoded): """The hot encoded Image is stored as stack of Hot encoded ndarrays this function returns a list of cll the channels""" - return np.dsplit(Nch_Hot_encoded,Nch_Hot_encoded.shape[-1]) \ No newline at end of file + return np.dsplit(Nch_Hot_encoded,Nch_Hot_encoded.shape[-1]) + def onehot2classmap(self, one_hot): + """Method that takes one hot encoded matrix and outputs a classmap generated off the color dictionary""" + pass + def classmap2img(self, class_map): + """Method that takes class_map matrix and gives a matrix like the image""" + pass \ No newline at end of file