Преглед на файлове

fixes inability to save PNGS with alpha channels, ie RBGA

Erik преди 5 години
родител
ревизия
50adb8f189
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      examples/instance_segmentation/labelme2coco.py

+ 1 - 1
examples/instance_segmentation/labelme2coco.py

@@ -93,7 +93,7 @@ def main():
         )
 
         img = labelme.utils.img_data_to_arr(label_file.imageData)
-        PIL.Image.fromarray(img).save(out_img_file)
+        PIL.Image.fromarray(img).convert("RGB").save(out_img_file)
         data['images'].append(dict(
             license=0,
             url=None,