feat: add metadata.jsonl for Dataset Viewer compatibility

#2
by gwtaylor - opened

Summary

This PR adds a metadata.jsonl file to enable the HuggingFace Dataset Viewer
to display all 35,586 specimens instead of just ~2,700.

Problem

The current imagefolder auto-detection uses high-resolution original images
(~1.9 MB each), causing the 5GB Parquet conversion limit to be reached after
only 2,700 rows (7.5% of the dataset).

Solution

The metadata.jsonl file explicitly points to thumbnail images instead of
originals. Thumbnails are much smaller, allowing the full dataset to be
previewed in the Dataset Viewer while keeping original high-resolution
images available for download.

Testing

Tested on a subset at gwtaylor/massid45-specimens
β€” the Dataset Viewer correctly shows all 20 test rows with thumbnail images.
I didn't want to download and re-upload 66GB so that is why I used the subset test!

Changes

  • Added: metadata.jsonl β€” 35,586 entries mapping specimens to thumbnail paths

Notes

  • Original images remain accessible at images/originals/[fieldid]/[processid].jpg
  • Thumbnails are used only for the Dataset Viewer preview
  • No existing files are modified or removed

Thank you! This was bothering me a bit, I didn't know it could actually be fixed πŸ™

annaviklund changed pull request status to merged

Sign up or log in to comment