Browse Source

Add support for png files (#609)

* Add support for png files

* Updates
Kentaro Wada 5 years ago
parent
commit
729327d38f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/instance_segmentation/labelme2coco.py

+ 1 - 1
examples/instance_segmentation/labelme2coco.py

@@ -95,7 +95,7 @@ def main():
         img_file = osp.join(
         img_file = osp.join(
             osp.dirname(label_file), label_data['imagePath']
             osp.dirname(label_file), label_data['imagePath']
         )
         )
-        img = np.asarray(PIL.Image.open(img_file))
+        img = np.asarray(PIL.Image.open(img_file).convert('RGB'))
         PIL.Image.fromarray(img).save(out_img_file)
         PIL.Image.fromarray(img).save(out_img_file)
         data['images'].append(dict(
         data['images'].append(dict(
             license=0,
             license=0,