Defect Segmentation
Function
Use the Defect Segmentation model package to run inference on the input image. It locates and segments defect regions and outputs defect classes. This Step supports importing single-class or multi-class defect segmentation model packages trained and exported in Mech-DLK.
This Step applies to industries such as new energy, electronics, PCB, printing, and consumer goods manufacturing, for detecting surface defects such as stains, bubbles, and scratches.
Input and Output
After you import the model package in the Deep Learning Model Package Inference Step, the following input and output ports are displayed.
Input
| Input ports | Data type | Description |
|---|---|---|
Image |
Image/Color |
Image input to this port will be used for deep learning model package inference. Displays when the input data type is 2D image. |
Surface data |
Surface |
Surface data input to this port will be used for deep learning model package inference. Displays when the input data type is Surface data. |
Output
When the imported model package is a single-class defect segmentation model package, the output ports are as follows:
| Output ports | Data type | Description |
|---|---|---|
Visualize outputs |
Image/Color |
Visualized results. |
Segment Boolean value result |
Bool |
Ab Boolean that indicates whether defects exist.
|
Segmented mask image |
Image/Color/Mask |
The mask of the segmentation result. Regions with non-zero pixel values represent detected defects. This port is displayed when the input data type is 2D image. |
Segmented mask contours |
Shape2D/Contour[] |
A list of pixel coordinates of the segmentation result mask vertices. This port is displayed when the input data type is 2D image. |
Segmented surface data |
Surface |
The surface data of the segmentation result. Regions with non-zero pixel values represent detected defects. This port is displayed when the input data type is Surface data. |
Defect type |
String |
The defect types identified in the input image. |
When the imported model package is a multi-class defect segmentation model package, the output ports are as follows:
| Output ports | Data type | Description |
|---|---|---|
Defect Segmentation/Class 1 |
DLResult/DefectSegmention |
Defect segmentation results for class 1. |
Defect Segmentation/Class 2 |
DLResult/DefectSegmention |
Defect segmentation results for 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: After a Deep Learning Model Package is imported, this parameter is used to select the imported model package for this step.
|
Release original model package after switching |
Description: Controls whether the resources used by the original model package are released upon the switch.
|
Model package type |
Parameter description: Once a Model Name is selected, the Model Package Type will be filled automatically. |
Input batch size |
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.
|
Input data type |
Description: This parameter is used to specify the type of input data. The corresponding input ports will be displayed after the parameter is selected. Support 2D image and surface data input. |
Preprocessing
| Parameter | Description | ||||
|---|---|---|---|---|---|
ROI path |
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 the Open the editor button. Edit the ROI in the pop-up Set ROI window, and fill in the ROI name. Instructions for Setting ROI: Hold down the left mouse button and drag to select an ROI, and then click the left mouse button again to confirm. If you need to re-select the ROI, please click the left mouse button and drag again. The coordinates of the selected ROI will be displayed in the “ROI Properties” section. Click the OK button to save and exit.
|
Postprocessing
| Parameter | Description |
|---|---|
Inference configuration |
Description: Configures the inference settings for the defect segmentation model package. Click Open the editor to open the inference configuration window.
|
Visualization Settings
| Parameter | Description |
|---|---|
Draw result on image |
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). The default value is 1.5.
|