Choose Folder 2D

This function block is used to select a directory containing image data organized into structured folders. It is designed to facilitate the preparation of data for training a 2D convolutional neural network (CNN).

📥 Inputs

This function block does not have any inputs.

📤 Outputs

PNNModel This output provides the configuration of the model including the path to the training data and the classes derived from the dataset.

🕹️ Controls

Channel Size A dropdown menu that allows you to specify the color mode for reading images (e.g., Grayscale or RGB).

Data Augmentation A checkbox that enables or disables data augmentation during the training process. This can help improve model robustness.

Choose Folder A button that, when clicked, opens a dialog for selecting the folder containing the structured dataset.

🎨 Features

Structured Folder Support The block checks for a specific folder structure (train, validation, and test) to ensure the data is organized correctly for model training.

Class Logging Automatically logs the class names found in the training data directory for user reference.

📝 Usage Instructions

  1. Select Folder: Click on the Choose Folder button to locate the directory containing your images. The folder should have subdirectories for train, validation, and optionally test.

  2. Configure Channel Size: Select the desired image reading mode (Grayscale or RGB) using the dropdown menu.

  3. Toggle Data Augmentation: Check or uncheck the Data Augmentation option based on whether you want to apply augmentation during training.

  4. Evaluate: Run the function block to return a model configuration based on the selected dataset.

📊 Evaluation

When executed, this function block checks the chosen folder structure, logs the relevant classes, and provides the necessary configurations for training a CNN, returning a structured output for further processing.

🛠️ Troubleshooting

Folder Not Found

Ensure the selected folder is valid and that it contains the required subfolders: train, validation, and test. If any are missing, the block will log errors accordingly.

No Classes Found

If the folder structure is correct but classes are missing, check that you have populated directories within the train folder. Each subdirectory within train should represent a class.

Invalid Input for Channel Size

Make sure that the choice for channel size selected matches the formats of images in the directory. The images should be consistent with either RGB or Grayscale.

💡 Tips and Tricks

Organizing Data Efficiently

Always structure your dataset with proper class directories within the train, validation, and test folders. This helps automatically manage the data flow for training and evaluation.

Using Data Augmentation

Using data augmentation can greatly improve model performance by providing variability in the dataset. However, ensure that the augmentation settings are appropriate for your specific model needs.

Debugging Folder Issues

Utilize the debug feature in your environment by setting the DEBUG variable to true, which can log additional information about the folder structure and class detection.

Last updated