lsun icon indicating copy to clipboard operation
lsun copied to clipboard

Add 'save' command for saving images as jpg files.

Open johnhany opened this issue 7 years ago • 4 comments

Certain machine learning tools require every training image files contained in one folder, hence the 'save' command is needed, at least for my work:)

johnhany avatar Mar 19 '17 06:03 johnhany

If only saving images in one folder is concerned here, does "--flat" for export serve the purpose?

fyu avatar Mar 19 '17 06:03 fyu

I tried export --flat and did get all the images in one folder with extension *.webp. But I wanted them as *.jpg. I just find that changing this line to image_out_path = join(image_out_dir, key + '.jpg') will just meet the purpose. AND it's a lot faster than cv2.imwrite. If you think it'll be useful, I can commit another pull request with this method.

johnhany avatar Mar 19 '17 07:03 johnhany

I see. cv2.imwrite may be unavoidable to make the generated images supported by general image io. I will commit a fix for this soon.

fyu avatar Mar 19 '17 09:03 fyu

Thank you for that:) BTW, this dataset is fantastic!!!

johnhany avatar Mar 19 '17 09:03 johnhany