| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Efficient Image Data Loading and Preprocessing for Deep Learning
Loading and preprocessing image data efficiently is critical for training performant deep learning models. This project demonstrates how to load, preprocess, batch, and visualize image datasets using TensorFlow/Keras utilities, ensuring the pipeline is optimized for GPU training and scalable datasets.
The notebook is organized into key steps:
From the code:
Not provided explicitly – The notebook loads image data from a local directory structure, where subfolder names correspond to class labels.
Requirements:
pip install tensorflow matplotlib numpyRun the notebook:
jupyter notebook image_data_loader.ipynbor in JupyterLab:
jupyter lab image_data_loader.ipynbEnsure the dataset is organized in a directory with subfolders for each class:
dataset/ ├── class1/ │ ├── image1.jpg │ ├── image2.jpg ├── class2/ │ ├── image3.jpg │ ├── image4.jpg
Example dataset info:
Image shape: (180, 180, 3) Number of classes: 5 Class names: ['cat', 'dog', 'bird', 'fish', 'horse']
Visualization sample:
[Image of class 'cat'] [Image of class 'dog'] [Image of class 'bird'] ...
Prefetch optimization:
AUTOTUNE = tf.data.AUTOTUNE dataset = dataset.cache().shuffle(1000).prefetch(buffer_size=AUTOTUNE)
💡 Some interactive outputs (e.g., plots, widgets) may not display correctly on GitHub. If so, please view this notebook via nbviewer.org for full rendering.
Mehran Asgari Email: imehranasgari@gmail.com GitHub: https://github.com/imehranasgari
This project is licensed under the Apache 2.0 License – see the LICENSE file for details.
| Back | FazBrowse Home | New Git URL |