huaweicloud-sdk-python-v3/huaweicloud-sdk-frs/huaweicloudsdkfrs/v2/model/face_quality.py

218 lines
5.8 KiB
Python
Raw Normal View History

2021-08-10 12:26:18 +00:00
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class FaceQuality:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
sensitive_list = []
openapi_types = {
'total_score': 'float',
'blur': 'float',
'pose': 'float',
'occlusion': 'float',
'illumination': 'float'
}
attribute_map = {
'total_score': 'total_score',
'blur': 'blur',
'pose': 'pose',
'occlusion': 'occlusion',
'illumination': 'illumination'
}
def __init__(self, total_score=None, blur=None, pose=None, occlusion=None, illumination=None):
"""FaceQuality - a model defined in huaweicloud sdk"""
self._total_score = None
self._blur = None
self._pose = None
self._occlusion = None
self._illumination = None
self.discriminator = None
self.total_score = total_score
self.blur = blur
self.pose = pose
self.occlusion = occlusion
self.illumination = illumination
@property
def total_score(self):
"""Gets the total_score of this FaceQuality.
人脸质量总分取值范围[0-1]分值越大质量越高
:return: The total_score of this FaceQuality.
:rtype: float
"""
return self._total_score
@total_score.setter
def total_score(self, total_score):
"""Sets the total_score of this FaceQuality.
人脸质量总分取值范围[0-1]分值越大质量越高
:param total_score: The total_score of this FaceQuality.
:type: float
"""
self._total_score = total_score
@property
def blur(self):
"""Gets the blur of this FaceQuality.
模糊度取值范围[0-1]分值越大模糊问题越严重
:return: The blur of this FaceQuality.
:rtype: float
"""
return self._blur
@blur.setter
def blur(self, blur):
"""Sets the blur of this FaceQuality.
模糊度取值范围[0-1]分值越大模糊问题越严重
:param blur: The blur of this FaceQuality.
:type: float
"""
self._blur = blur
@property
def pose(self):
"""Gets the pose of this FaceQuality.
姿态取值范围[0-1]分值越大姿态问题越严重
:return: The pose of this FaceQuality.
:rtype: float
"""
return self._pose
@pose.setter
def pose(self, pose):
"""Sets the pose of this FaceQuality.
姿态取值范围[0-1]分值越大姿态问题越严重
:param pose: The pose of this FaceQuality.
:type: float
"""
self._pose = pose
@property
def occlusion(self):
"""Gets the occlusion of this FaceQuality.
遮挡取值范围[0-1]分值越大遮挡问题越严重
:return: The occlusion of this FaceQuality.
:rtype: float
"""
return self._occlusion
@occlusion.setter
def occlusion(self, occlusion):
"""Sets the occlusion of this FaceQuality.
遮挡取值范围[0-1]分值越大遮挡问题越严重
:param occlusion: The occlusion of this FaceQuality.
:type: float
"""
self._occlusion = occlusion
@property
def illumination(self):
"""Gets the illumination of this FaceQuality.
光照取值范围[0-1]分值越大光照问题越严重
:return: The illumination of this FaceQuality.
:rtype: float
"""
return self._illumination
@illumination.setter
def illumination(self, illumination):
"""Sets the illumination of this FaceQuality.
光照取值范围[0-1]分值越大光照问题越严重
:param illumination: The illumination of this FaceQuality.
:type: float
"""
self._illumination = illumination
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
if attr in self.sensitive_list:
result[attr] = "****"
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
import simplejson as json
if six.PY2:
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
def __repr__(self):
"""For `print`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, FaceQuality):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other