提交 8c259ee3 编写于 作者: K Kentaro Wada

Raise ValueError in lblsave for labels that cannot be saved

上级 7bef7f87
......@@ -3,7 +3,6 @@ import os.path as osp
import numpy as np
import PIL.Image
from labelme.logger import logger
from labelme.utils.draw import label_colormap
......@@ -18,7 +17,7 @@ def lblsave(filename, lbl):
lbl_pil.putpalette((colormap * 255).astype(np.uint8).flatten())
lbl_pil.save(filename)
else:
logger.warn(
'[%s] Cannot save the pixel-wise class label as PNG, '
'so please use the npy file.' % filename
raise ValueError(
'[%s] Cannot save the pixel-wise class label as PNG. '
'Please consider using the .npy format.' % filename
)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册