Skip to content

Conversation

@johnhany
Copy link

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

Add 'save' entry in command choices as well as in help text. The new 'save' command uses opencv interface for writing image files to disk.
@fyu
Copy link
Owner

fyu commented Mar 19, 2017

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

@johnhany
Copy link
Author

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
Copy link
Owner

fyu commented Mar 19, 2017

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
Copy link
Author

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

Change exported file format from *.webp to *.jpg in export_images(), and we get save_images_fast().
It's a lot faster than cv2.imwrite() when exporting jpeg files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants