AnomalyDetection.h¶
Go to the source code of this file.
Anomaly Detection is a function that learns only normal images and detects abnormal images and their areas.
SAIGE VISION provides the Anomaly Detection function that detects abnormal images and their areas by learning only normal images. The Anomaly Detection function detects the abnormal area as a SaigeSegmentedObject structure, which is a Contour. Therefore, it is similar to the Segmentation function, and additionally provides whether the image is abnormal, and the overall abnormal score of the image.
Inference Options¶
You can set whether to calculate the Mask, Object, and Heatmap, which are the inference results of Anomaly Detection. The Scoremap is calculated by default and cannot be set not to be calculated.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
See also:
- SaigeInferenceOption::calcMask
- SaigeInferenceOption::calcObject - SaigeInferenceOption::calcObjectScoreAndApplyThreshold - SaigeInferenceOption::calcObjectAreaAndApplyThreshold - SaigeInferenceOption::objectScoreThresholdPerClass - SaigeInferenceOption::objectAreaThresholdPerClass
- SaigeInferenceOption::calcHeatmap
Heatmap¶
In Anomaly Detection, the Scoremap can be colored as a Heatmap. The Score in Anomaly Detection is expressed as a real number greater than or equal to 0, unlike other functions. Therefore, you can set the maximum and minimum Score values corresponding to the color area. The trained model has a suitable Score range calculated and set, but you can adjust the range if it is not clearly visible.
182 183 184 185 186 187 188 189 190 191 192 193 | |
- Before

- After

See also: SaigeInferenceOption::heatmapColorRangeMin, SaigeInferenceOption::heatmapColorRangeMax
Inference Results¶
You can get the basic inference results of Anomaly Detection, isNg, anomalyScore, scoreMin, and scoreMax.
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
See also: SaigeGetInferenceResultAnomalyScores, SaigeGetInferenceResultIsNg
ScoremapIAD¶
The Scoremap, which is the inference result of Anomaly Detection, is represented as a float array to express a real number greater than or equal to 0.
333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |
For other results such as Mask, Object, Heatmap, please refer to the example code and API documentation.