CreateImageFeatures

class lightautoml.image.image.CreateImageFeatures(hist_size=30, is_hsv=True, n_jobs=4, loader=<function pil_loader>)[source]

Bases: object

Class for parallel histogram computation.

__init__(hist_size=30, is_hsv=True, n_jobs=4, loader=<function pil_loader>)[source]

Create normalized color histogram for rgb or hsv image.

Parameters:
  • hist_size (int) – Number of bins for each channel.

  • is_hsv (bool) – Convert image to hsv.

  • n_jobs (int) – Number of threads for multiprocessing.

  • loader (Callable) – Callable for reading image from path.

process(im_path_i)[source]

Create normalized color histogram for input image by its path.

Parameters:

im_path_i (str) – Path to the image.

Return type:

List[Union[int, float]]

Returns:

List of histogram values.

transform(samples)[source]

Transform input sequence with paths to histogram values.

Parameters:

samples (Sequence[str]) – Sequence with images paths.

Return type:

ndarray

Returns:

Array of histograms.