fyu / lsun

LSUN Dataset Documentation and Demo Code
541 stars 176 forks source link

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

Open johnhany opened 7 years ago

johnhany commented 7 years ago

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

fyu commented 7 years ago

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

johnhany commented 7 years ago

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.

fyu commented 7 years ago

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.

johnhany commented 7 years ago

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