(self, segmentation_results,
                                  res_file_folder, pred_segm_names)
Write the segmentation result to result_file_folder
        :param segmentation_results: the prediction result
        :param result_file_folder: the saving folder
        :return: [None]
Write the segmentation result to result_file_folder
        :param segmentation_results: the prediction result
        :param result_file_folder: the saving folder
        :return: [None]
Write the segmentation result to result_file_folder : param segmentation_results : the prediction result : param result_file_folder : the saving folder : return : [ None ]
def write_segmentation_result(self, segmentation_results,
                                  res_file_folder, pred_segm_names):
        """
        Write the segmentation result to result_file_folder
        :param segmentation_results: the prediction result
        :param result_file_folder: the saving folder
        :return: [None]
        """
        if not os.path.exists(res_file_folder):
            os.mkdir(res_file_folder)

        pallete = self.get_pallete()

        for i, pred_segm_name in enumerate(pred_segm_names):

            res_save_path = os.path.join(res_file_folder, pred_segm_name.replace('_leftImg8bit.png','.png')).replace('_newImg8bit.png', '.png')
            segmentation_result = np.uint8(np.squeeze(np.copy(segmentation_results[i])))

            segmentation_result = Image.fromarray(segmentation_result)
            segmentation_result.putpalette(pallete)
            segmentation_result.save(res_save_path)
def write_segmentation_result ( self , segmentation_results , res_file_folder , pred_segm_names ) : if not os . path . exists ( res_file_folder ) : os . mkdir ( res_file_folder ) pallete = self . get_pallete ( ) for i , pred_segm_name in enumerate ( pred_segm_names ) : res_save_path = os . path . join ( res_file_folder , pred_segm_name . replace ( '_leftImg8bit.png' , '.png' ) ) . replace ( '_newImg8bit.png' , '.png' ) segmentation_result = np . uint8 ( np . squeeze ( np . copy ( segmentation_results [ i ] ) ) ) segmentation_result = Image . fromarray ( segmentation_result ) segmentation_result . putpalette ( pallete ) segmentation_result . save ( res_save_path )