Skip to content

ImageFolderDatasetGuide Modification #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions docs/imagefolder-guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# ImageFolderDataset Guide: Working with NEON Beetle Images

This guide demonstrates how to use the [`ImageFolderDataset`](api-reference.md#hpc_inference.datasets.ImageFolderDataset) class from the HPC Inference package with the [2018 NEON Beetles dataset](https://huggingface.co/datasets/imageomics/2018-NEON-beetles).
This guide demonstrates how to use the [`ImageFolderDataset`](api-reference.md#hpc_inference.datasets.ImageFolderDataset) class from the `hpc-inference` package with the 2018 NEON Beetles dataset.[^1]

[^1]: Fluck, I. E., Baiser, B., Wolcheski, R., Chinmian, I., & Record, S. (2024).
2018 NEON Ethanol-preserved Ground Beetles (Revision 7b3731d).
Hugging Face. https://doi.org/10.57967/hf/5252

## Overview

Expand All @@ -14,7 +18,7 @@ The [`ImageFolderDataset`](api-reference.md#hpc_inference.datasets.ImageFolderDa

## Dataset Overview

The 2018 NEON Beetles dataset contains:
The 2018 NEON Beetles dataset[^1] contains:
- 577 high-resolution group images of ethanol-preserved beetles
- Beetles collected from NEON ecological sites in 2018
- Multiple beetles per image, organized by species
Expand Down Expand Up @@ -458,7 +462,8 @@ plt.show()
```
![Original vs Processed Beetle Images](imgs/processed_beetles.png)

The top row shows the original high-resolution images (5568×3712 pixels). The bottom row shows the same images after ResNet preprocessing: resized to 224×224 pixels, center-cropped, and de-normalized.
*Figure 1: Comparison of original vs processed NEON beetle images from the 2018 NEON Beetles dataset[^1]. Top row shows original high-resolution images (5568×3712 pixels), bottom row shows the same images after ResNet preprocessing: resized to 224×224 pixels, center-cropped, and normalized.*


## Performance Optimization

Expand Down Expand Up @@ -572,4 +577,5 @@ Based on the examples above, here are key recommendations for using [`ImageFolde
### Collate Functions
- Use [`pil_image_collate`](api-reference.md#hpc_inference.utils) when `preprocess=None` (returning PIL Images)
- Use [`multi_model_collate`](api-reference.md#hpc_inference.utils) for multi-model preprocessing
- Use default collate function for single tensor outputs
- Use default collate function for single tensor outputs

Binary file added docs/imgs/Imageomics_ABC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.md-footer-social {
order: 1;
}

.md-copyright {
order: 2;
}

.md-footer-generator {
order: 3;
}

/*
Make logo larger to be legible,
based on this suggestion: https://github.com/squidfunk/mkdocs-material/discussions/2933#discussioncomment-1168075
*/
.md-header__button.md-logo {
margin: 0;
padding: 1;
}

.md-header__button.md-logo img, .md-header__button.md-logo svg {
height: 2.6rem;
width: 2.6rem;
}
8 changes: 6 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ nav:

theme:
name: material
logo: imgs/Imageomics_logo_butterfly.png
favicon: imgs/Imageomics_logo_butterfly.png
logo: imgs/Imageomics_ABC.png
favicon: imgs/Imageomics_ABC.png
palette:
# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
Expand Down Expand Up @@ -46,6 +46,7 @@ theme:
- search.highlight

markdown_extensions:
- footnotes
- admonition
- pymdownx.details
- pymdownx.superfences
Expand All @@ -69,6 +70,9 @@ plugins:
python:
paths: [src]

extra_css:
- stylesheets/extra.css

extra:
social:
- icon: fontawesome/brands/github
Expand Down