pe.data.image.digiface1m module

class pe.data.image.digiface1m.DigiFace1M(root_dir, res=32, num_processes=50, chunksize=1000)[source]

Bases: Data

The DigiFace1M dataset (https://github.com/microsoft/DigiFace1M/).

__init__(root_dir, res=32, num_processes=50, chunksize=1000)[source]

Constructor.

Parameters:
  • root_dir (str, optional) – The root directory of the dataset, defaults to “data”

  • res (int, optional) – The resolution of the images, defaults to 32

  • num_processes (int, optional) – The number of processes to use for parallel processing, defaults to 50

  • chunksize (int, optional) – The chunk size to use for parallel processing, defaults to 1000

Raises:

ValueError – If the number of images in root_dir is not 1,219,995

_read_and_process_image(path)[source]

Read and process an image.

Parameters:

path (str) – The path to the image

Returns:

The processed image

Return type:

np.ndarray