How to take some sub-directories from a main directory tf.keras.utils.image_dataset_from_directory (original) (raw)
How to take some sub-directories from a main directory
- Hello I'm new to this issue stuff 😃
- Basically I was unable to find a fix for the issue on Stackoverflow so I'm here to ask the experts. 💜
- Hope I'm not creating a problem for you all will make it short and simple. 😥
def image_dataset_from_directory(
directory,
labels="inferred",
label_mode="int",
class_names=None,
color_mode="rgb",
batch_size=32,
image_size=(256, 256),
shuffle=True,
seed=None,
validation_split=None,
subset=None,
interpolation="bilinear",
follow_links=False,
crop_to_aspect_ratio=False,
**kwargs,
):
- HERE IF I ONLY WANT
class_a THEN WHAT TO DO
main_directory/
...class_a/
......a_image_1.jpg
......a_image_2.jpg
...class_b/
......b_image_1.jpg
......b_image_2.jpg

- As shown in above figure I'm trying to use the tf.keras.utils.image_dataset_from_directory
- But here I want to take some sub directories only and not all like .git files from the main directory
- Previously it was in
from tensorflow.keras.preprocessing.image import image_dataset_from_directory
- with parameter
ignore
- is there a easy fix for this using this directory or any relevant.
THANKS IN ADVANCE 😉