aws_sdk_rekognition/operation/compare_faces/
_compare_faces_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CompareFacesInput {
6    /// <p>The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.</p>
7    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
8    pub source_image: ::std::option::Option<crate::types::Image>,
9    /// <p>The target image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.</p>
10    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
11    pub target_image: ::std::option::Option<crate::types::Image>,
12    /// <p>The minimum level of confidence in the face matches that a match must meet to be included in the <code>FaceMatches</code> array.</p>
13    pub similarity_threshold: ::std::option::Option<f32>,
14    /// <p>A filter that specifies a quality bar for how much filtering is done to identify faces. Filtered faces aren't compared. If you specify <code>AUTO</code>, Amazon Rekognition chooses the quality bar. If you specify <code>LOW</code>, <code>MEDIUM</code>, or <code>HIGH</code>, filtering removes all faces that don’t meet the chosen quality bar. The quality bar is based on a variety of common use cases. Low-quality detections can occur for a number of reasons. Some examples are an object that's misidentified as a face, a face that's too blurry, or a face with a pose that's too extreme to use. If you specify <code>NONE</code>, no filtering is performed. The default value is <code>NONE</code>.</p>
15    /// <p>To use quality filtering, the collection you are using must be associated with version 3 of the face model or higher.</p>
16    pub quality_filter: ::std::option::Option<crate::types::QualityFilter>,
17}
18impl CompareFacesInput {
19    /// <p>The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.</p>
20    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
21    pub fn source_image(&self) -> ::std::option::Option<&crate::types::Image> {
22        self.source_image.as_ref()
23    }
24    /// <p>The target image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.</p>
25    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
26    pub fn target_image(&self) -> ::std::option::Option<&crate::types::Image> {
27        self.target_image.as_ref()
28    }
29    /// <p>The minimum level of confidence in the face matches that a match must meet to be included in the <code>FaceMatches</code> array.</p>
30    pub fn similarity_threshold(&self) -> ::std::option::Option<f32> {
31        self.similarity_threshold
32    }
33    /// <p>A filter that specifies a quality bar for how much filtering is done to identify faces. Filtered faces aren't compared. If you specify <code>AUTO</code>, Amazon Rekognition chooses the quality bar. If you specify <code>LOW</code>, <code>MEDIUM</code>, or <code>HIGH</code>, filtering removes all faces that don’t meet the chosen quality bar. The quality bar is based on a variety of common use cases. Low-quality detections can occur for a number of reasons. Some examples are an object that's misidentified as a face, a face that's too blurry, or a face with a pose that's too extreme to use. If you specify <code>NONE</code>, no filtering is performed. The default value is <code>NONE</code>.</p>
34    /// <p>To use quality filtering, the collection you are using must be associated with version 3 of the face model or higher.</p>
35    pub fn quality_filter(&self) -> ::std::option::Option<&crate::types::QualityFilter> {
36        self.quality_filter.as_ref()
37    }
38}
39impl CompareFacesInput {
40    /// Creates a new builder-style object to manufacture [`CompareFacesInput`](crate::operation::compare_faces::CompareFacesInput).
41    pub fn builder() -> crate::operation::compare_faces::builders::CompareFacesInputBuilder {
42        crate::operation::compare_faces::builders::CompareFacesInputBuilder::default()
43    }
44}
45
46/// A builder for [`CompareFacesInput`](crate::operation::compare_faces::CompareFacesInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CompareFacesInputBuilder {
50    pub(crate) source_image: ::std::option::Option<crate::types::Image>,
51    pub(crate) target_image: ::std::option::Option<crate::types::Image>,
52    pub(crate) similarity_threshold: ::std::option::Option<f32>,
53    pub(crate) quality_filter: ::std::option::Option<crate::types::QualityFilter>,
54}
55impl CompareFacesInputBuilder {
56    /// <p>The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.</p>
57    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
58    /// This field is required.
59    pub fn source_image(mut self, input: crate::types::Image) -> Self {
60        self.source_image = ::std::option::Option::Some(input);
61        self
62    }
63    /// <p>The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.</p>
64    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
65    pub fn set_source_image(mut self, input: ::std::option::Option<crate::types::Image>) -> Self {
66        self.source_image = input;
67        self
68    }
69    /// <p>The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.</p>
70    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
71    pub fn get_source_image(&self) -> &::std::option::Option<crate::types::Image> {
72        &self.source_image
73    }
74    /// <p>The target image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.</p>
75    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
76    /// This field is required.
77    pub fn target_image(mut self, input: crate::types::Image) -> Self {
78        self.target_image = ::std::option::Option::Some(input);
79        self
80    }
81    /// <p>The target image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.</p>
82    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
83    pub fn set_target_image(mut self, input: ::std::option::Option<crate::types::Image>) -> Self {
84        self.target_image = input;
85        self
86    }
87    /// <p>The target image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.</p>
88    /// <p>If you are using an AWS SDK to call Amazon Rekognition, you might not need to base64-encode image bytes passed using the <code>Bytes</code> field. For more information, see Images in the Amazon Rekognition developer guide.</p>
89    pub fn get_target_image(&self) -> &::std::option::Option<crate::types::Image> {
90        &self.target_image
91    }
92    /// <p>The minimum level of confidence in the face matches that a match must meet to be included in the <code>FaceMatches</code> array.</p>
93    pub fn similarity_threshold(mut self, input: f32) -> Self {
94        self.similarity_threshold = ::std::option::Option::Some(input);
95        self
96    }
97    /// <p>The minimum level of confidence in the face matches that a match must meet to be included in the <code>FaceMatches</code> array.</p>
98    pub fn set_similarity_threshold(mut self, input: ::std::option::Option<f32>) -> Self {
99        self.similarity_threshold = input;
100        self
101    }
102    /// <p>The minimum level of confidence in the face matches that a match must meet to be included in the <code>FaceMatches</code> array.</p>
103    pub fn get_similarity_threshold(&self) -> &::std::option::Option<f32> {
104        &self.similarity_threshold
105    }
106    /// <p>A filter that specifies a quality bar for how much filtering is done to identify faces. Filtered faces aren't compared. If you specify <code>AUTO</code>, Amazon Rekognition chooses the quality bar. If you specify <code>LOW</code>, <code>MEDIUM</code>, or <code>HIGH</code>, filtering removes all faces that don’t meet the chosen quality bar. The quality bar is based on a variety of common use cases. Low-quality detections can occur for a number of reasons. Some examples are an object that's misidentified as a face, a face that's too blurry, or a face with a pose that's too extreme to use. If you specify <code>NONE</code>, no filtering is performed. The default value is <code>NONE</code>.</p>
107    /// <p>To use quality filtering, the collection you are using must be associated with version 3 of the face model or higher.</p>
108    pub fn quality_filter(mut self, input: crate::types::QualityFilter) -> Self {
109        self.quality_filter = ::std::option::Option::Some(input);
110        self
111    }
112    /// <p>A filter that specifies a quality bar for how much filtering is done to identify faces. Filtered faces aren't compared. If you specify <code>AUTO</code>, Amazon Rekognition chooses the quality bar. If you specify <code>LOW</code>, <code>MEDIUM</code>, or <code>HIGH</code>, filtering removes all faces that don’t meet the chosen quality bar. The quality bar is based on a variety of common use cases. Low-quality detections can occur for a number of reasons. Some examples are an object that's misidentified as a face, a face that's too blurry, or a face with a pose that's too extreme to use. If you specify <code>NONE</code>, no filtering is performed. The default value is <code>NONE</code>.</p>
113    /// <p>To use quality filtering, the collection you are using must be associated with version 3 of the face model or higher.</p>
114    pub fn set_quality_filter(mut self, input: ::std::option::Option<crate::types::QualityFilter>) -> Self {
115        self.quality_filter = input;
116        self
117    }
118    /// <p>A filter that specifies a quality bar for how much filtering is done to identify faces. Filtered faces aren't compared. If you specify <code>AUTO</code>, Amazon Rekognition chooses the quality bar. If you specify <code>LOW</code>, <code>MEDIUM</code>, or <code>HIGH</code>, filtering removes all faces that don’t meet the chosen quality bar. The quality bar is based on a variety of common use cases. Low-quality detections can occur for a number of reasons. Some examples are an object that's misidentified as a face, a face that's too blurry, or a face with a pose that's too extreme to use. If you specify <code>NONE</code>, no filtering is performed. The default value is <code>NONE</code>.</p>
119    /// <p>To use quality filtering, the collection you are using must be associated with version 3 of the face model or higher.</p>
120    pub fn get_quality_filter(&self) -> &::std::option::Option<crate::types::QualityFilter> {
121        &self.quality_filter
122    }
123    /// Consumes the builder and constructs a [`CompareFacesInput`](crate::operation::compare_faces::CompareFacesInput).
124    pub fn build(
125        self,
126    ) -> ::std::result::Result<crate::operation::compare_faces::CompareFacesInput, ::aws_smithy_types::error::operation::BuildError> {
127        ::std::result::Result::Ok(crate::operation::compare_faces::CompareFacesInput {
128            source_image: self.source_image,
129            target_image: self.target_image,
130            similarity_threshold: self.similarity_threshold,
131            quality_filter: self.quality_filter,
132        })
133    }
134}