simulation.utils.machine_learning.data.image_folder module

A modified image folder class.

We modify the official PyTorch image folder (https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py) so that this class can load images from both current directory and its subdirectories.

Summary

Functions:

find_images

Recursively search for images in the given directory.

is_image_file

Check if a file is an image.

Reference

is_image_file(filename)[source]

Check if a file is an image.

Parameters

filename – the file name to check

find_images(dir: str, max_dataset_size=inf) → List[str][source]

Recursively search for images in the given directory.

Parameters
  • dir – the directory of the dataset

  • max_dataset_size – the maximum amount of images to load