From 0bdbd7febf852f24fb6422b6a23d6ab1a2c4af05 Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Sun, 1 Apr 2018 04:31:12 +0900 Subject: [PATCH] Remove dependency to scikit-image --- examples/semantic_segmentation/labelme2voc.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/semantic_segmentation/labelme2voc.py b/examples/semantic_segmentation/labelme2voc.py index eeaba21..284a7d2 100755 --- a/examples/semantic_segmentation/labelme2voc.py +++ b/examples/semantic_segmentation/labelme2voc.py @@ -16,8 +16,6 @@ import matplotlib.pyplot as plt import numpy as np import PIL.Image import PIL.ImagePalette -import skimage.color -import skimage.io import labelme from labelme.utils import label2rgb @@ -76,8 +74,8 @@ def main(): data = json.load(f) img_file = osp.join(osp.dirname(label_file), data['imagePath']) - img = skimage.io.imread(img_file) - skimage.io.imsave(out_img_file, img) + img = np.asarray(PIL.Image.open(img_file)) + PIL.Image.fromarray(img).save(out_img_file) lbl = labelme.utils.shapes_to_label( img_shape=img.shape, @@ -93,7 +91,7 @@ def main(): viz = labelme.utils.draw_label( lbl, img, class_names, colormap=colormap) - skimage.io.imsave(out_viz_file, viz) + PIL.Image.fromarray(viz).save(out_viz_file) if __name__ == '__main__': -- GitLab