Custom CNN Model

This function block is used to load a TensorFlow AI model for making predictions based on input images. It allows users to integrate machine learning models within their workflows easily.

📥 Inputs

Image Any An image input that is fed into the AI model for prediction.

📤 Outputs

Class Index (Detected) This output provides the index of the detected class based on the model's prediction.

Class Name (Detected) This output provides the name of the detected class from the model’s output.

Detection Result (Raw Output) This output contains the raw results from the model, useful for further analysis or debugging.

🕹️ Controls

Load Model A button that, when clicked, allows the user to load a pre-trained TensorFlow or TensorFlow Lite model from their filesystem.

Classes Text This text area displays the list of classes that the AI model can detect, providing insight into what the model has been trained on.

🎨 Features

Support for Multiple Model Formats This block can load both TensorFlow .h5 models and TensorFlow Lite .tflite models, providing versatility in model selection.

Detection Results Visualization The output displays both the detected class index and name, making it easy to understand the result.

Error Handling Provides information about loading errors, such as invalid paths or configurations, to assist in troubleshooting.

📝 Usage Instructions

  1. Load Model: Click on the Load Model button to select and load your AI model. You can choose either a TensorFlow model (*.h5) or a TensorFlow Lite model (*.tflite).

  2. Input Image: Connect an image-producing block to the Image Any input.

  3. Run the Block: Execute the block to process the input image with the loaded model. The outputs will provide the predicted class index, class name, and raw output.

📊 Evaluation

When executed, this function block utilizes the loaded model to predict the class of the input image, returning results that reveal the predicted class index, name, and raw output data.

💡 Tips and Tricks

Model Compatibility

Ensure that the model you are loading is compatible with the expected input format. Models trained on certain input sizes or types may fail if the input image does not match.

Class Names Visualization

After loading the model, check the Classes Text area to see the classes the model can detect. This information is critical for interpreting the results accurately.

Raw Output Analysis

Examine the raw output data for deeper insights into the model's predictions. This can help in debugging the model behavior for specific inputs.

🛠️ Troubleshooting

Model Not Loaded Error

If you encounter an error stating that the model is not loaded, verify that you've clicked the Load Model button and selected a valid model file.

Invalid Class Index

If the Class Index (Detected) output returns an unexpected value, ensure that the input image meets the model's required format and that the model has been trained to recognize that type of input.

Last updated