Convert raw images to Parquet to optimize dataset loading

#10
HDR Imageomics Institute org
โ€ข
edited May 7

This PR accomplishes four goals:

  • Fix error with EXIF metadata for two files:
exiftool -overwrite_original -all= \
  dataset/Animalia-Chordata-Amphibia-Anura-Rhacophoridae-Pseudophilautus-wynaadensis/29536718_1048330_eol-full-size-copy.jpg \
  dataset/Animalia-Chordata-Amphibia-Anura-Rhacophoridae-Pseudophilautus-wynaadensis/29536723_1048330_eol-full-size-copy.jpg
    2 image files updated
  • Defuse a decompression bomb by resizing a very large image to below the threshold for Pillow's default Image.MAX_IMAGE_PIXELS of 89,478,485 pixels.
DecompressionBombWarning triggered for:
dataset/Animalia-Mollusca-Bivalvia-Cardiida-Cardiidae-Tridacna-gigas/30003931_46473744_eol-full-size-copy.jpg

Resizing 17000ร—6800->14956ร—5982 (115,600,000->89,466,792 pixels)
Done. New file size: 2.202237129211426 MB
  • Restructure the repository to a Hugging Face Dataset which may be loaded using the load_dataset method from datasets (described in README.md).
  • Provide an export method for users to be able to get the 'legacy' structure on their filesystem without the need to clone the repository (described in README.md).
HDR Imageomics Institute org
โ€ข
edited May 7

@egrace479 , @jjgarciac have a look!

thompsonmj changed pull request status to open
HDR Imageomics Institute org

This looks great! One suggestion: At line 163 of the README, I would indicate "...previous structure (JPGs in taxa folders, not parquet)" or something to that effect.

HDR Imageomics Institute org

It works great! I was able to load and transform each image without the issues mentioned.

thompsonmj changed pull request status to merged
HDR Imageomics Institute org

Looks great ๐Ÿ‘

Sign up or log in to comment