提交 0bdbd7fe 编写于 作者: K Kentaro Wada

Remove dependency to scikit-image

上级 28b3923d
...@@ -16,8 +16,6 @@ import matplotlib.pyplot as plt ...@@ -16,8 +16,6 @@ import matplotlib.pyplot as plt
import numpy as np import numpy as np
import PIL.Image import PIL.Image
import PIL.ImagePalette import PIL.ImagePalette
import skimage.color
import skimage.io
import labelme import labelme
from labelme.utils import label2rgb from labelme.utils import label2rgb
...@@ -76,8 +74,8 @@ def main(): ...@@ -76,8 +74,8 @@ def main():
data = json.load(f) data = json.load(f)
img_file = osp.join(osp.dirname(label_file), data['imagePath']) img_file = osp.join(osp.dirname(label_file), data['imagePath'])
img = skimage.io.imread(img_file) img = np.asarray(PIL.Image.open(img_file))
skimage.io.imsave(out_img_file, img) PIL.Image.fromarray(img).save(out_img_file)
lbl = labelme.utils.shapes_to_label( lbl = labelme.utils.shapes_to_label(
img_shape=img.shape, img_shape=img.shape,
...@@ -93,7 +91,7 @@ def main(): ...@@ -93,7 +91,7 @@ def main():
viz = labelme.utils.draw_label( viz = labelme.utils.draw_label(
lbl, img, class_names, colormap=colormap) lbl, img, class_names, colormap=colormap)
skimage.io.imsave(out_viz_file, viz) PIL.Image.fromarray(viz).save(out_viz_file)
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册