images_folder#

Functions

from_files

Load a list of image paths into a dataset without annotations

from_folder

Load a folder of images into a dataset without annotations.

from_files(images_root: str | Path = '', file_names: str | Path | Iterable[str | Path] = '', split: str | None = 'eval', label_map: dict[int, str] | None = None) Dataset[source]#

Load a list of image paths into a dataset without annotations

Note

Image paths can be globbing patterns as well. As such, if your folder only contains .jpg and .png files, calling this function with file_names set to ["*.jpg", "*.jpeg"] will produce the same result as from_folder()

Note

Calling this function with file_names set to “*” is NOT equivalent to from_folder() because the pattern used in from_folder() is more constrained.

Parameters:
  • images_root – Root of folder to get images from. Defaults to “”.

  • file_names – files to add to the dataset. Can be paths or globbing pattern, must be relative to images_root. Defaults to “”.

  • split – Split value to apply to resulting dataset. Defaults to “eval”.

  • label_map – Optional label map to apply to dataset. Defaults to None.

Returns:

Dataset with given images, but without annotations.

from_folder(images_root: str | Path, split: str | None = 'eval', label_map: dict[int, str] | None = None, dataset_path: Path | str | None = None) Dataset[source]#

Load a folder of images into a dataset without annotations.

Globbed image file formats are the following:

  • “.bmp”

  • “.dng”

  • “.jpeg”

  • “.jpg”

  • “.mpo”

  • “.png”

  • “.tif”

  • “.tiff”

  • “.webp”

  • “.pfm”

Parameters:
  • images_root – Root of folder to get images from

  • split – Split value to apply to resulting dataset. Defaults to “eval”.

  • label_map – Optional label map to apply to dataset. Defaults to None.

  • dataset_path – Deprecated name for images_root, if not None, triggers a warning and will be removed in future releases

Returns:

Dataset with images of given folder, but without annotations.