Defect Segmentation
Function
Use the Defect Segmentation model package to perform inference on the input image. This model can locate and segment the defect regions in the image and output the defect class information. Single-class or multi-class defect segmentation model packages trained with Mech-DLK can be imported.
This model is suitable for detecting surface defects such as stains, bubbles, and scratches in industries such as renewable energy, electronics, PCB, printing, and daily necessities manufacturing.
Input and Output
After importing the model package in the Deep Learning Model Package Inference Step, the following input and output ports will be displayed.
Input
| Input port | Data type | Description |
|---|---|---|
Image |
Image/Color |
Image input to this port will be used for deep learning model package inference. |
Output
When the imported model package is a single-class defect segmentation model package, the output ports are as follows:
| Output port | Data type | Description |
|---|---|---|
Visualization Output |
Image/Color |
Visualized results. |
Segmentation Boolean Result |
Bool |
A Boolean result that indicates the presence of a defect. True indicates that the input image is free of object defects. False indicates that the input image contains object defects. |
Segmentation Mask |
Image/Color/Mask |
Non-zero pixel values indicate detected defects. |
Segmentation Mask Contours |
Shape2D/Contour[] |
List of pixel coordinates of the vertices of the segmentation result mask. |
Defect Classes |
String |
Defect types recognized in images. |
When the imported model package is a multi-class defect segmentation model package, the output ports are as follows:
| Output port | Data type | Description |
|---|---|---|
Defect Segmentation/Label 1 |
DLResult/DefectSegmentation |
Label the defect segmentation results of class 1. |
Defect Segmentation/Label 2 |
DLResult/DefectSegmentation |
Label the defect segmentation results of class 2. |
… |
… |
… |
|
When importing a multi-class defect segmentation model package in this Step, connect each output port to the Deep Learning Result Parser Step to output the defect segmentation results for each labeled class separately. |
Parameter Description
The following parameters need to be adjusted when the defect segmentation model package is imported into this Step.
Model Package Settings
| Parameter | Description |
|---|---|
Model Manager Tool |
Parameter description: This parameter is used to open the deep learning model package management tool and import the deep learning model package. The model package file is a “.dlkpack” file exported by Mech-DLK.
|
Model Name |
Parameter description: This parameter is used to select the model package that has been imported for this Step.
|
Release Original Model Package After Switching |
Parameter description: This parameter determines whether to release the resources occupied by the original model package immediately when the model package is switched.
|
Model Package Type |
Parameter description: Once a Model Name is selected, the DI Algo Type Translated String will be filled automatically. |
Input Batch Size |
Parmeter description: The number of images processed during each inference. |
GPU ID |
Parameter description: This parameter is used to select the device ID of the GPU that will be used for the inference.
|
Pre-Process
| Parameter | Description | ||||
|---|---|---|---|---|---|
ROI File |
Parameter description: This parameter is used to set or modify the ROI of the input image. Tuning instruction: Once the deep learning model is imported, a default ROI will be applied. If you need to edit the ROI, click Open the editor. Edit the ROI in the pop-up Set ROI window, and fill in the ROI name.
|
Post-Process
| Parameter | Description |
|---|---|
Inference Configuration |
Parameter description: This parameter is used to configure parameters related to defect segmentation model package inference. You can click Open the editor to open the inference configuration window.
|
Visualization Settings
| Parameter | Description |
|---|---|
Draw result on image |
Parameter description: Once enabled, the detection result will be displayed on the image.
|
Customize Font Size |
Parameter description: This parameter determines whether to customize the font size in the visualized outputs. Once this option is selected, you should set the Font Size (0–10).
|
Font Size (0–10) |
Parameter description: This parameter is used to set the font size in the visualized outputs.
|