Deep Learning Algorithm Implementations 1.0.0
C++ implementations of fundamental deep learning algorithms
Loading...
Searching...
No Matches
dl::utils::ImageLoader Class Reference

#include <data_loader.hpp>

Static Public Member Functions

static MatrixD load_image (const std::string &filename, size_t target_width=0, size_t target_height=0)
 Load a single image file.
 
static std::vector< MatrixDload_images_from_directory (const std::string &directory_path, size_t target_width=0, size_t target_height=0)
 Load all images from a directory.
 

Detailed Description

Definition at line 231 of file data_loader.hpp.

Member Function Documentation

◆ load_image()

MatrixD dl::utils::ImageLoader::load_image ( const std::string &  filename,
size_t  target_width = 0,
size_t  target_height = 0 
)
static

Load a single image file.

Parameters
filenamePath to the image file
target_widthTarget width for resizing (0 = no resize)
target_heightTarget height for resizing (0 = no resize)
Returns
Matrix containing normalized pixel values [0,1]
Note
Images are converted to grayscale and normalized
Examples
/home/runner/work/deep-learning-algo-impls/deep-learning-algo-impls/include/utils/data_loader.hpp.

Definition at line 162 of file data_loader.cpp.

◆ load_images_from_directory()

std::vector< MatrixD > dl::utils::ImageLoader::load_images_from_directory ( const std::string &  directory_path,
size_t  target_width = 0,
size_t  target_height = 0 
)
static

Load all images from a directory.

Parameters
directory_pathPath to directory containing images
target_widthTarget width for resizing (0 = no resize)
target_heightTarget height for resizing (0 = no resize)
Returns
Vector of matrices, each containing an image
Note
Processes all supported image files in the directory
Examples
/home/runner/work/deep-learning-algo-impls/deep-learning-algo-impls/include/utils/data_loader.hpp.

Definition at line 169 of file data_loader.cpp.


The documentation for this class was generated from the following files: