.. _f-imagehelper: module ``hackathon.image_helper`` ================================= Short summary +++++++++++++ module ``ensae_projects.hackathon.image_helper`` Helpers for the hackathon 2017 (Label EmmaĆ¼s). :githublink:`%|py|6` Functions +++++++++ +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | function | truncated documentation | +===========================================================================================================+==============================================================================================================================+ | :func:`enumerate_batch_features ` | Enumerates all batches saved in a folder. | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`enumerate_image_class ` | Lists all images in one folder assuming subfolders indicates the class of each image belongs to. | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`folder_split_train_test ` | Splits images from a folder into train and test. The function saves images into two separate folders. | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`histogram_image_size ` | Computes the distribution of images size. | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`image_zoom ` | Resizes an *image* (from :epkg:`PIL`). | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`img2gray ` | Converts an image (:epkg:`PIL`) to gray scale. | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`last_element ` | Returns the last element of sequence assuming they were generated by an iterator or a generator. | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`load_batch_features ` | Loads a batch file saved by :func:`stream_image2features`. | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`plot_gallery_random_images ` | Plots a gallery of images using :epkg:`matplotlib`. Extracts a random sample from a folder which contains many images. ... | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`read_image ` | Reads an image. | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`resize_image ` | Resizes an image until one of its dimension becomes smaller than *maxdim* after dividing the dimensions by two many ... | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`stream_apply_image_transform ` | Applies a transform on every image in a folder, saves it in another one. It keeps the same subfolders. | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`stream_copy_images ` | Copies all images from *src_folder* to *dest_folder* if *valid(name)* is True. | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`stream_download_images ` | Downloads images based on their urls. | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`stream_image2features ` | Considers all images in a folder, transform them into features (function *transform*) and saves them with :epkg:`pickle` ... | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :func:`stream_random_sample ` | Extracts a random sample from a folder which contains many images. Relies on fonction :func:`enumerate_image_class`. ... | +-----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: ensae_projects.hackathon.image_helper :members: :special-members: __init__ :show-inheritance: