/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace LookoutforVision { namespace Model { /** *

The prediction results from a call to DetectAnomalies. * DetectAnomalyResult includes classification information for the * prediction (IsAnomalous and Confidence). If the model * you use is an image segementation model, DetectAnomalyResult also * includes segmentation information (Anomalies and * AnomalyMask). Classification information is calculated separately * from segmentation information and you shouldn't assume a relationship between * them.

See Also:

AWS * API Reference

*/ class DetectAnomalyResult { public: AWS_LOOKOUTFORVISION_API DetectAnomalyResult(); AWS_LOOKOUTFORVISION_API DetectAnomalyResult(Aws::Utils::Json::JsonView jsonValue); AWS_LOOKOUTFORVISION_API DetectAnomalyResult& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_LOOKOUTFORVISION_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The source of the image that was analyzed. direct means that the * images was supplied from the local computer. No other values are supported.

*/ inline const ImageSource& GetSource() const{ return m_source; } /** *

The source of the image that was analyzed. direct means that the * images was supplied from the local computer. No other values are supported.

*/ inline bool SourceHasBeenSet() const { return m_sourceHasBeenSet; } /** *

The source of the image that was analyzed. direct means that the * images was supplied from the local computer. No other values are supported.

*/ inline void SetSource(const ImageSource& value) { m_sourceHasBeenSet = true; m_source = value; } /** *

The source of the image that was analyzed. direct means that the * images was supplied from the local computer. No other values are supported.

*/ inline void SetSource(ImageSource&& value) { m_sourceHasBeenSet = true; m_source = std::move(value); } /** *

The source of the image that was analyzed. direct means that the * images was supplied from the local computer. No other values are supported.

*/ inline DetectAnomalyResult& WithSource(const ImageSource& value) { SetSource(value); return *this;} /** *

The source of the image that was analyzed. direct means that the * images was supplied from the local computer. No other values are supported.

*/ inline DetectAnomalyResult& WithSource(ImageSource&& value) { SetSource(std::move(value)); return *this;} /** *

True if Amazon Lookout for Vision classifies the image as containing an * anomaly, otherwise false.

*/ inline bool GetIsAnomalous() const{ return m_isAnomalous; } /** *

True if Amazon Lookout for Vision classifies the image as containing an * anomaly, otherwise false.

*/ inline bool IsAnomalousHasBeenSet() const { return m_isAnomalousHasBeenSet; } /** *

True if Amazon Lookout for Vision classifies the image as containing an * anomaly, otherwise false.

*/ inline void SetIsAnomalous(bool value) { m_isAnomalousHasBeenSet = true; m_isAnomalous = value; } /** *

True if Amazon Lookout for Vision classifies the image as containing an * anomaly, otherwise false.

*/ inline DetectAnomalyResult& WithIsAnomalous(bool value) { SetIsAnomalous(value); return *this;} /** *

The confidence that Lookout for Vision has in the accuracy of the * classification in IsAnomalous.

*/ inline double GetConfidence() const{ return m_confidence; } /** *

The confidence that Lookout for Vision has in the accuracy of the * classification in IsAnomalous.

*/ inline bool ConfidenceHasBeenSet() const { return m_confidenceHasBeenSet; } /** *

The confidence that Lookout for Vision has in the accuracy of the * classification in IsAnomalous.

*/ inline void SetConfidence(double value) { m_confidenceHasBeenSet = true; m_confidence = value; } /** *

The confidence that Lookout for Vision has in the accuracy of the * classification in IsAnomalous.

*/ inline DetectAnomalyResult& WithConfidence(double value) { SetConfidence(value); return *this;} /** *

If the model is an image segmentation model, Anomalies contains * a list of anomaly types found in the image. There is one entry for each type of * anomaly found (even if multiple instances of an anomaly type exist on the * image). The first element in the list is always an anomaly type representing the * image background ('background') and shouldn't be considered an anomaly. Amazon * Lookout for Vision automatically add the background anomaly type to the * response, and you don't need to declare a background anomaly type in your * dataset.

If the list has one entry ('background'), no anomalies were * found on the image.

An image classification model doesn't return an * Anomalies list.

*/ inline const Aws::Vector& GetAnomalies() const{ return m_anomalies; } /** *

If the model is an image segmentation model, Anomalies contains * a list of anomaly types found in the image. There is one entry for each type of * anomaly found (even if multiple instances of an anomaly type exist on the * image). The first element in the list is always an anomaly type representing the * image background ('background') and shouldn't be considered an anomaly. Amazon * Lookout for Vision automatically add the background anomaly type to the * response, and you don't need to declare a background anomaly type in your * dataset.

If the list has one entry ('background'), no anomalies were * found on the image.

An image classification model doesn't return an * Anomalies list.

*/ inline bool AnomaliesHasBeenSet() const { return m_anomaliesHasBeenSet; } /** *

If the model is an image segmentation model, Anomalies contains * a list of anomaly types found in the image. There is one entry for each type of * anomaly found (even if multiple instances of an anomaly type exist on the * image). The first element in the list is always an anomaly type representing the * image background ('background') and shouldn't be considered an anomaly. Amazon * Lookout for Vision automatically add the background anomaly type to the * response, and you don't need to declare a background anomaly type in your * dataset.

If the list has one entry ('background'), no anomalies were * found on the image.

An image classification model doesn't return an * Anomalies list.

*/ inline void SetAnomalies(const Aws::Vector& value) { m_anomaliesHasBeenSet = true; m_anomalies = value; } /** *

If the model is an image segmentation model, Anomalies contains * a list of anomaly types found in the image. There is one entry for each type of * anomaly found (even if multiple instances of an anomaly type exist on the * image). The first element in the list is always an anomaly type representing the * image background ('background') and shouldn't be considered an anomaly. Amazon * Lookout for Vision automatically add the background anomaly type to the * response, and you don't need to declare a background anomaly type in your * dataset.

If the list has one entry ('background'), no anomalies were * found on the image.

An image classification model doesn't return an * Anomalies list.

*/ inline void SetAnomalies(Aws::Vector&& value) { m_anomaliesHasBeenSet = true; m_anomalies = std::move(value); } /** *

If the model is an image segmentation model, Anomalies contains * a list of anomaly types found in the image. There is one entry for each type of * anomaly found (even if multiple instances of an anomaly type exist on the * image). The first element in the list is always an anomaly type representing the * image background ('background') and shouldn't be considered an anomaly. Amazon * Lookout for Vision automatically add the background anomaly type to the * response, and you don't need to declare a background anomaly type in your * dataset.

If the list has one entry ('background'), no anomalies were * found on the image.

An image classification model doesn't return an * Anomalies list.

*/ inline DetectAnomalyResult& WithAnomalies(const Aws::Vector& value) { SetAnomalies(value); return *this;} /** *

If the model is an image segmentation model, Anomalies contains * a list of anomaly types found in the image. There is one entry for each type of * anomaly found (even if multiple instances of an anomaly type exist on the * image). The first element in the list is always an anomaly type representing the * image background ('background') and shouldn't be considered an anomaly. Amazon * Lookout for Vision automatically add the background anomaly type to the * response, and you don't need to declare a background anomaly type in your * dataset.

If the list has one entry ('background'), no anomalies were * found on the image.

An image classification model doesn't return an * Anomalies list.

*/ inline DetectAnomalyResult& WithAnomalies(Aws::Vector&& value) { SetAnomalies(std::move(value)); return *this;} /** *

If the model is an image segmentation model, Anomalies contains * a list of anomaly types found in the image. There is one entry for each type of * anomaly found (even if multiple instances of an anomaly type exist on the * image). The first element in the list is always an anomaly type representing the * image background ('background') and shouldn't be considered an anomaly. Amazon * Lookout for Vision automatically add the background anomaly type to the * response, and you don't need to declare a background anomaly type in your * dataset.

If the list has one entry ('background'), no anomalies were * found on the image.

An image classification model doesn't return an * Anomalies list.

*/ inline DetectAnomalyResult& AddAnomalies(const Anomaly& value) { m_anomaliesHasBeenSet = true; m_anomalies.push_back(value); return *this; } /** *

If the model is an image segmentation model, Anomalies contains * a list of anomaly types found in the image. There is one entry for each type of * anomaly found (even if multiple instances of an anomaly type exist on the * image). The first element in the list is always an anomaly type representing the * image background ('background') and shouldn't be considered an anomaly. Amazon * Lookout for Vision automatically add the background anomaly type to the * response, and you don't need to declare a background anomaly type in your * dataset.

If the list has one entry ('background'), no anomalies were * found on the image.

An image classification model doesn't return an * Anomalies list.

*/ inline DetectAnomalyResult& AddAnomalies(Anomaly&& value) { m_anomaliesHasBeenSet = true; m_anomalies.push_back(std::move(value)); return *this; } /** *

If the model is an image segmentation model, AnomalyMask * contains pixel masks that covers all anomaly types found on the image. Each * anomaly type has a different mask color. To map a color to an anomaly type, see * the color field of the PixelAnomaly object.

An image * classification model doesn't return an Anomalies list.

*/ inline const Aws::Utils::ByteBuffer& GetAnomalyMask() const{ return m_anomalyMask; } /** *

If the model is an image segmentation model, AnomalyMask * contains pixel masks that covers all anomaly types found on the image. Each * anomaly type has a different mask color. To map a color to an anomaly type, see * the color field of the PixelAnomaly object.

An image * classification model doesn't return an Anomalies list.

*/ inline bool AnomalyMaskHasBeenSet() const { return m_anomalyMaskHasBeenSet; } /** *

If the model is an image segmentation model, AnomalyMask * contains pixel masks that covers all anomaly types found on the image. Each * anomaly type has a different mask color. To map a color to an anomaly type, see * the color field of the PixelAnomaly object.

An image * classification model doesn't return an Anomalies list.

*/ inline void SetAnomalyMask(const Aws::Utils::ByteBuffer& value) { m_anomalyMaskHasBeenSet = true; m_anomalyMask = value; } /** *

If the model is an image segmentation model, AnomalyMask * contains pixel masks that covers all anomaly types found on the image. Each * anomaly type has a different mask color. To map a color to an anomaly type, see * the color field of the PixelAnomaly object.

An image * classification model doesn't return an Anomalies list.

*/ inline void SetAnomalyMask(Aws::Utils::ByteBuffer&& value) { m_anomalyMaskHasBeenSet = true; m_anomalyMask = std::move(value); } /** *

If the model is an image segmentation model, AnomalyMask * contains pixel masks that covers all anomaly types found on the image. Each * anomaly type has a different mask color. To map a color to an anomaly type, see * the color field of the PixelAnomaly object.

An image * classification model doesn't return an Anomalies list.

*/ inline DetectAnomalyResult& WithAnomalyMask(const Aws::Utils::ByteBuffer& value) { SetAnomalyMask(value); return *this;} /** *

If the model is an image segmentation model, AnomalyMask * contains pixel masks that covers all anomaly types found on the image. Each * anomaly type has a different mask color. To map a color to an anomaly type, see * the color field of the PixelAnomaly object.

An image * classification model doesn't return an Anomalies list.

*/ inline DetectAnomalyResult& WithAnomalyMask(Aws::Utils::ByteBuffer&& value) { SetAnomalyMask(std::move(value)); return *this;} private: ImageSource m_source; bool m_sourceHasBeenSet = false; bool m_isAnomalous; bool m_isAnomalousHasBeenSet = false; double m_confidence; bool m_confidenceHasBeenSet = false; Aws::Vector m_anomalies; bool m_anomaliesHasBeenSet = false; Aws::Utils::ByteBuffer m_anomalyMask; bool m_anomalyMaskHasBeenSet = false; }; } // namespace Model } // namespace LookoutforVision } // namespace Aws