load_image_passiflora_leaves#
- ktch.datasets.load_image_passiflora_leaves(*, return_paths: bool = False, as_frame: bool = False, version: str | None = None) Bunch[source]#
Load and return the Passiflora leaf image dataset.
This dataset contains leaf images of Passiflora species from GigaDB [Chitwood_et_al_2016].
The data is downloaded from a remote server on first use and cached locally.
Species
10
Scan images
25
Image size
1268 x 1748 pixels, RGB
Image format
PNG
- Parameters:
- return_pathsbool, default=False
If True, return file paths to the images instead of loading them as numpy arrays. This is useful for large datasets or when using image loading libraries like PIL or OpenCV.
- as_framebool, default=False
If True, the metadata is returned as a pandas DataFrame. Otherwise, it is returned as a dict.
- versionstr, optional
The dataset version to load (e.g., “1”). If None, uses the default version for the current ktch release.
- Returns:
- data
Bunch Dictionary-like object, with the following attributes.
- imageslist of ndarray or list of str
If return_paths=False, list of image arrays with shape (height, width, channels). If return_paths=True, list of file paths to the images.
- metadict or DataFrame
Metadata containing image_id (index), genus, and species for each image. If as_frame=True, returns a pandas DataFrame.
- DESCRstr
The full description of the dataset.
- data_dirstr
Path to the directory containing the extracted data.
- versionstr
The version of the dataset that was loaded.
- data
Notes
This function requires the optional dependency pooch for downloading the dataset. Install it using:
pip install ktch[data]When return_paths=False, numpy is used to load the images. For more control over image loading, use return_paths=True and load images with your preferred library.
References
[Chitwood_et_al_2016]Chitwood, D.H., Otoni, W.C., 2016. Supporting data for “Morphometric analysis of Passiflora leaves: the relationship between landmarks of the vasculature and elliptical Fourier descriptors of the blade”. GigaScience Database. https://doi.org/10.5524/100251
Examples
>>> from ktch.datasets import load_image_passiflora_leaves >>> data = load_image_passiflora_leaves() >>> len(data.images) ... >>> data.meta['species'] ... >>> # Load a specific version >>> data = load_image_passiflora_leaves(version="1")