osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: saving image object on GCS from DoFn


You can use FileSystems.create() to create a file on gs:// and you can pass the result of that method to img.save().

On Thu, Apr 26, 2018, 9:02 AM OrielResearch Eila Arich-Landkof <eila@xxxxxxxxxxxxxxxxx> wrote:
Hello all,

I am running the following simplified code from DoFn (ParDo)
from PIL import Image

img = Image.fromarray(array)
img.save('testrgb.png')

img.save() with gs:// drive does not work.
What would be the recommended way to save the img object on google drive as .png file
any advice is appreciated

Many thanks,