cloudmersive-image-recognition-api-client 2.0.5 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +19 -19
- data/cloudmersive-image-recognition-api-client.gemspec +1 -1
- data/docs/AgeDetectionResult.md +1 -1
- data/docs/AiImageDetectionApi.md +63 -0
- data/docs/ConvertApi.md +58 -3
- data/docs/FaceApi.md +4 -4
- data/docs/FineTextItem.md +1 -0
- data/docs/ImageAiDetectionResult.md +10 -0
- data/docs/NsfwAdvancedResult.md +19 -0
- data/docs/NsfwApi.md +169 -4
- data/docs/PersonWithAge.md +4 -1
- data/docs/RecognizeApi.md +0 -110
- data/docs/ResizeApi.md +55 -0
- data/docs/TextItem.md +1 -0
- data/lib/cloudmersive-image-recognition-api-client/api/ai_image_detection_api.rb +78 -0
- data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/api/convert_api.rb +58 -3
- data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +8 -8
- data/lib/cloudmersive-image-recognition-api-client/api/filter_api.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/api/info_api.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +170 -5
- data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +1 -111
- data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +56 -1
- data/lib/cloudmersive-image-recognition-api-client/api/text_generation_api.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/api_client.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/api_error.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/configuration.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +3 -3
- data/lib/cloudmersive-image-recognition-api-client/models/color_result.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/create_handwriting_request.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/dominant_color_result.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_instance.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_request.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/face.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/face_compare_response.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/face_locate_with_landmarks_response.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/face_match.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/face_point.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/face_with_landmarks.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/find_symbol_result.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/fine_text_detection_result.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/fine_text_item.rb +12 -2
- data/lib/cloudmersive-image-recognition-api-client/models/{gender_detection_result.rb → image_ai_detection_result.rb} +25 -27
- data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/image_metadata.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/image_metadata_exif_value.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_comparison_response.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_hash_distance_request.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_hash_distance_response.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_hash_response.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/nsfw_advanced_result.rb +296 -0
- data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +36 -5
- data/lib/cloudmersive-image-recognition-api-client/models/polygon_point.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/text_detection_result.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/models/text_item.rb +12 -2
- data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/version.rb +2 -2
- data/lib/cloudmersive-image-recognition-api-client.rb +4 -5
- data/spec/api/ai_image_detection_api_spec.rb +47 -0
- data/spec/api/artistic_api_spec.rb +1 -1
- data/spec/api/convert_api_spec.rb +14 -2
- data/spec/api/edit_api_spec.rb +1 -1
- data/spec/api/face_api_spec.rb +4 -4
- data/spec/api/filter_api_spec.rb +1 -1
- data/spec/api/info_api_spec.rb +1 -1
- data/spec/api/nsfw_api_spec.rb +39 -3
- data/spec/api/recognize_api_spec.rb +1 -25
- data/spec/api/resize_api_spec.rb +13 -1
- data/spec/api/text_generation_api_spec.rb +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/age_detection_result_spec.rb +1 -1
- data/spec/models/color_result_spec.rb +1 -1
- data/spec/models/create_handwriting_request_spec.rb +1 -1
- data/spec/models/detected_license_plate_spec.rb +1 -1
- data/spec/models/dominant_color_result_spec.rb +1 -1
- data/spec/models/draw_polygon_instance_spec.rb +1 -1
- data/spec/models/draw_polygon_request_spec.rb +1 -1
- data/spec/models/draw_rectangle_instance_spec.rb +1 -1
- data/spec/models/draw_rectangle_request_spec.rb +1 -1
- data/spec/models/draw_text_instance_spec.rb +1 -1
- data/spec/models/draw_text_request_spec.rb +1 -1
- data/spec/models/face_compare_response_spec.rb +1 -1
- data/spec/models/face_locate_response_spec.rb +1 -1
- data/spec/models/face_locate_with_landmarks_response_spec.rb +1 -1
- data/spec/models/face_match_spec.rb +1 -1
- data/spec/models/face_point_spec.rb +1 -1
- data/spec/models/face_spec.rb +1 -1
- data/spec/models/face_with_landmarks_spec.rb +1 -1
- data/spec/models/find_symbol_result_spec.rb +1 -1
- data/spec/models/fine_text_detection_result_spec.rb +1 -1
- data/spec/models/fine_text_item_spec.rb +7 -1
- data/spec/models/{person_with_gender_spec.rb → image_ai_detection_result_spec.rb} +10 -10
- data/spec/models/image_description_response_spec.rb +1 -1
- data/spec/models/image_metadata_exif_value_spec.rb +1 -1
- data/spec/models/image_metadata_spec.rb +1 -1
- data/spec/models/image_similarity_comparison_response_spec.rb +1 -1
- data/spec/models/image_similarity_hash_distance_request_spec.rb +1 -1
- data/spec/models/image_similarity_hash_distance_response_spec.rb +1 -1
- data/spec/models/image_similarity_hash_response_spec.rb +1 -1
- data/spec/models/nsfw_advanced_result_spec.rb +107 -0
- data/spec/models/nsfw_result_spec.rb +1 -1
- data/spec/models/person_with_age_spec.rb +19 -1
- data/spec/models/polygon_point_spec.rb +1 -1
- data/spec/models/recognition_outcome_spec.rb +1 -1
- data/spec/models/text_detection_result_spec.rb +1 -1
- data/spec/models/text_item_spec.rb +7 -1
- data/spec/models/vehicle_license_plate_detection_result_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +27 -30
- data/docs/DetectedObject.md +0 -13
- data/docs/GenderDetectionResult.md +0 -10
- data/docs/ObjectDetectionResult.md +0 -10
- data/docs/PersonWithGender.md +0 -10
- data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +0 -236
- data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +0 -208
- data/lib/cloudmersive-image-recognition-api-client/models/person_with_gender.rb +0 -206
- data/spec/models/detected_object_spec.rb +0 -71
- data/spec/models/gender_detection_result_spec.rb +0 -53
- data/spec/models/object_detection_result_spec.rb +0 -53
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -15,6 +15,9 @@ require 'date'
|
|
|
15
15
|
module CloudmersiveImageRecognitionApiClient
|
|
16
16
|
# Individual instance of text occuring in an image; one piece of text
|
|
17
17
|
class FineTextItem
|
|
18
|
+
# Detected text in the image
|
|
19
|
+
attr_accessor :detected_text
|
|
20
|
+
|
|
18
21
|
# X coordinate of the top/left text location; 0 represents the left edge of the input image
|
|
19
22
|
attr_accessor :top_left_x
|
|
20
23
|
|
|
@@ -51,6 +54,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
51
54
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
52
55
|
def self.attribute_map
|
|
53
56
|
{
|
|
57
|
+
:'detected_text' => :'DetectedText',
|
|
54
58
|
:'top_left_x' => :'TopLeftX',
|
|
55
59
|
:'top_left_y' => :'TopLeftY',
|
|
56
60
|
:'top_right_x' => :'TopRightX',
|
|
@@ -68,6 +72,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
68
72
|
# Attribute type mapping.
|
|
69
73
|
def self.swagger_types
|
|
70
74
|
{
|
|
75
|
+
:'detected_text' => :'String',
|
|
71
76
|
:'top_left_x' => :'Integer',
|
|
72
77
|
:'top_left_y' => :'Integer',
|
|
73
78
|
:'top_right_x' => :'Integer',
|
|
@@ -90,6 +95,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
90
95
|
# convert string to symbol for hash key
|
|
91
96
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
92
97
|
|
|
98
|
+
if attributes.has_key?(:'DetectedText')
|
|
99
|
+
self.detected_text = attributes[:'DetectedText']
|
|
100
|
+
end
|
|
101
|
+
|
|
93
102
|
if attributes.has_key?(:'TopLeftX')
|
|
94
103
|
self.top_left_x = attributes[:'TopLeftX']
|
|
95
104
|
end
|
|
@@ -153,6 +162,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
153
162
|
def ==(o)
|
|
154
163
|
return true if self.equal?(o)
|
|
155
164
|
self.class == o.class &&
|
|
165
|
+
detected_text == o.detected_text &&
|
|
156
166
|
top_left_x == o.top_left_x &&
|
|
157
167
|
top_left_y == o.top_left_y &&
|
|
158
168
|
top_right_x == o.top_right_x &&
|
|
@@ -175,7 +185,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
175
185
|
# Calculates hash code according to all attributes.
|
|
176
186
|
# @return [Fixnum] Hash code
|
|
177
187
|
def hash
|
|
178
|
-
[top_left_x, top_left_y, top_right_x, top_right_y, bottom_left_x, bottom_left_y, bottom_right_x, bottom_right_y, width, height, angle].hash
|
|
188
|
+
[detected_text, top_left_x, top_left_y, top_right_x, top_right_y, bottom_left_x, bottom_left_y, bottom_right_x, bottom_right_y, width, height, angle].hash
|
|
179
189
|
end
|
|
180
190
|
|
|
181
191
|
# Builds the object from hash
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -13,32 +13,32 @@ Swagger Codegen version: 2.4.14
|
|
|
13
13
|
require 'date'
|
|
14
14
|
|
|
15
15
|
module CloudmersiveImageRecognitionApiClient
|
|
16
|
-
# Result
|
|
17
|
-
class
|
|
18
|
-
# True if the
|
|
19
|
-
attr_accessor :
|
|
16
|
+
# Result of performing an AI Image detection
|
|
17
|
+
class ImageAiDetectionResult
|
|
18
|
+
# True if the image is clean (not AI generated) and false otherwise
|
|
19
|
+
attr_accessor :clean_result
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
attr_accessor :
|
|
21
|
+
# Risk score between 0.0 (no risk) and 1.0 (highest risk), with anything over 0.8 being high risk
|
|
22
|
+
attr_accessor :ai_generated_risk_score
|
|
23
23
|
|
|
24
|
-
#
|
|
25
|
-
attr_accessor :
|
|
24
|
+
# Tool used to generate the image, if identified (this cannot always be identified)
|
|
25
|
+
attr_accessor :ai_source
|
|
26
26
|
|
|
27
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
28
|
def self.attribute_map
|
|
29
29
|
{
|
|
30
|
-
:'
|
|
31
|
-
:'
|
|
32
|
-
:'
|
|
30
|
+
:'clean_result' => :'CleanResult',
|
|
31
|
+
:'ai_generated_risk_score' => :'AiGeneratedRiskScore',
|
|
32
|
+
:'ai_source' => :'AiSource'
|
|
33
33
|
}
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
# Attribute type mapping.
|
|
37
37
|
def self.swagger_types
|
|
38
38
|
{
|
|
39
|
-
:'
|
|
40
|
-
:'
|
|
41
|
-
:'
|
|
39
|
+
:'clean_result' => :'BOOLEAN',
|
|
40
|
+
:'ai_generated_risk_score' => :'Float',
|
|
41
|
+
:'ai_source' => :'String'
|
|
42
42
|
}
|
|
43
43
|
end
|
|
44
44
|
|
|
@@ -50,18 +50,16 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
50
50
|
# convert string to symbol for hash key
|
|
51
51
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
52
52
|
|
|
53
|
-
if attributes.has_key?(:'
|
|
54
|
-
self.
|
|
53
|
+
if attributes.has_key?(:'CleanResult')
|
|
54
|
+
self.clean_result = attributes[:'CleanResult']
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
if attributes.has_key?(:'
|
|
58
|
-
|
|
59
|
-
self.person_with_gender = value
|
|
60
|
-
end
|
|
57
|
+
if attributes.has_key?(:'AiGeneratedRiskScore')
|
|
58
|
+
self.ai_generated_risk_score = attributes[:'AiGeneratedRiskScore']
|
|
61
59
|
end
|
|
62
60
|
|
|
63
|
-
if attributes.has_key?(:'
|
|
64
|
-
self.
|
|
61
|
+
if attributes.has_key?(:'AiSource')
|
|
62
|
+
self.ai_source = attributes[:'AiSource']
|
|
65
63
|
end
|
|
66
64
|
end
|
|
67
65
|
|
|
@@ -83,9 +81,9 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
83
81
|
def ==(o)
|
|
84
82
|
return true if self.equal?(o)
|
|
85
83
|
self.class == o.class &&
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
clean_result == o.clean_result &&
|
|
85
|
+
ai_generated_risk_score == o.ai_generated_risk_score &&
|
|
86
|
+
ai_source == o.ai_source
|
|
89
87
|
end
|
|
90
88
|
|
|
91
89
|
# @see the `==` method
|
|
@@ -97,7 +95,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
97
95
|
# Calculates hash code according to all attributes.
|
|
98
96
|
# @return [Fixnum] Hash code
|
|
99
97
|
def hash
|
|
100
|
-
[
|
|
98
|
+
[clean_result, ai_generated_risk_score, ai_source].hash
|
|
101
99
|
end
|
|
102
100
|
|
|
103
101
|
# Builds the object from hash
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_comparison_response.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_hash_distance_request.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_hash_distance_response.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#imageapi
|
|
3
|
+
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.14
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module CloudmersiveImageRecognitionApiClient
|
|
16
|
+
# Result of an Advanced NSFW classification
|
|
17
|
+
class NsfwAdvancedResult
|
|
18
|
+
# True if the classification was successfully run, false otherwise
|
|
19
|
+
attr_accessor :successful
|
|
20
|
+
|
|
21
|
+
# True if the result was clean, false otherwise
|
|
22
|
+
attr_accessor :clean_result
|
|
23
|
+
|
|
24
|
+
# True if the image contains nudity or sex, false otherwise
|
|
25
|
+
attr_accessor :contains_nudity
|
|
26
|
+
|
|
27
|
+
# True if the image contains graphic violence and/or gore, false otherwise
|
|
28
|
+
attr_accessor :contains_graphic_violence
|
|
29
|
+
|
|
30
|
+
# True if the image contains non-graphic violence, e.g. weapons, false otherwise
|
|
31
|
+
attr_accessor :contains_non_graphic_violence
|
|
32
|
+
|
|
33
|
+
# True if the image contains self-harm or suicide imagery, false otherwise
|
|
34
|
+
attr_accessor :contains_self_harm
|
|
35
|
+
|
|
36
|
+
# True if the image contains hate, false otherwise
|
|
37
|
+
attr_accessor :contains_hate
|
|
38
|
+
|
|
39
|
+
# True if the image contains potentially illegal activity such as drugs, false otherwise
|
|
40
|
+
attr_accessor :contains_potential_illegal_activity
|
|
41
|
+
|
|
42
|
+
# True if the image contains medical imagery, false otherwise
|
|
43
|
+
attr_accessor :contains_medical_imagery
|
|
44
|
+
|
|
45
|
+
# True if the image contains profanity or obscenities, false otherwise
|
|
46
|
+
attr_accessor :contains_profanity
|
|
47
|
+
|
|
48
|
+
# Score between 0.0 and 1.0. Scores of 0.0-0.2 represent high probability safe content, while scores 0.8-1.0 represent high probability unsafe content. Content between 0.2 and 0.8 is of increasing raciness.
|
|
49
|
+
attr_accessor :score
|
|
50
|
+
|
|
51
|
+
# Classification result into four categories: SafeContent_HighProbability, UnsafeContent_HighProbability, RacyContent, SafeContent_ModerateProbability
|
|
52
|
+
attr_accessor :classification_outcome
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'successful' => :'Successful',
|
|
58
|
+
:'clean_result' => :'CleanResult',
|
|
59
|
+
:'contains_nudity' => :'ContainsNudity',
|
|
60
|
+
:'contains_graphic_violence' => :'ContainsGraphicViolence',
|
|
61
|
+
:'contains_non_graphic_violence' => :'ContainsNonGraphicViolence',
|
|
62
|
+
:'contains_self_harm' => :'ContainsSelfHarm',
|
|
63
|
+
:'contains_hate' => :'ContainsHate',
|
|
64
|
+
:'contains_potential_illegal_activity' => :'ContainsPotentialIllegalActivity',
|
|
65
|
+
:'contains_medical_imagery' => :'ContainsMedicalImagery',
|
|
66
|
+
:'contains_profanity' => :'ContainsProfanity',
|
|
67
|
+
:'score' => :'Score',
|
|
68
|
+
:'classification_outcome' => :'ClassificationOutcome'
|
|
69
|
+
}
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Attribute type mapping.
|
|
73
|
+
def self.swagger_types
|
|
74
|
+
{
|
|
75
|
+
:'successful' => :'BOOLEAN',
|
|
76
|
+
:'clean_result' => :'BOOLEAN',
|
|
77
|
+
:'contains_nudity' => :'BOOLEAN',
|
|
78
|
+
:'contains_graphic_violence' => :'BOOLEAN',
|
|
79
|
+
:'contains_non_graphic_violence' => :'BOOLEAN',
|
|
80
|
+
:'contains_self_harm' => :'BOOLEAN',
|
|
81
|
+
:'contains_hate' => :'BOOLEAN',
|
|
82
|
+
:'contains_potential_illegal_activity' => :'BOOLEAN',
|
|
83
|
+
:'contains_medical_imagery' => :'BOOLEAN',
|
|
84
|
+
:'contains_profanity' => :'BOOLEAN',
|
|
85
|
+
:'score' => :'Float',
|
|
86
|
+
:'classification_outcome' => :'String'
|
|
87
|
+
}
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Initializes the object
|
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
92
|
+
def initialize(attributes = {})
|
|
93
|
+
return unless attributes.is_a?(Hash)
|
|
94
|
+
|
|
95
|
+
# convert string to symbol for hash key
|
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
97
|
+
|
|
98
|
+
if attributes.has_key?(:'Successful')
|
|
99
|
+
self.successful = attributes[:'Successful']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.has_key?(:'CleanResult')
|
|
103
|
+
self.clean_result = attributes[:'CleanResult']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.has_key?(:'ContainsNudity')
|
|
107
|
+
self.contains_nudity = attributes[:'ContainsNudity']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.has_key?(:'ContainsGraphicViolence')
|
|
111
|
+
self.contains_graphic_violence = attributes[:'ContainsGraphicViolence']
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.has_key?(:'ContainsNonGraphicViolence')
|
|
115
|
+
self.contains_non_graphic_violence = attributes[:'ContainsNonGraphicViolence']
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.has_key?(:'ContainsSelfHarm')
|
|
119
|
+
self.contains_self_harm = attributes[:'ContainsSelfHarm']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.has_key?(:'ContainsHate')
|
|
123
|
+
self.contains_hate = attributes[:'ContainsHate']
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.has_key?(:'ContainsPotentialIllegalActivity')
|
|
127
|
+
self.contains_potential_illegal_activity = attributes[:'ContainsPotentialIllegalActivity']
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.has_key?(:'ContainsMedicalImagery')
|
|
131
|
+
self.contains_medical_imagery = attributes[:'ContainsMedicalImagery']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.has_key?(:'ContainsProfanity')
|
|
135
|
+
self.contains_profanity = attributes[:'ContainsProfanity']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.has_key?(:'Score')
|
|
139
|
+
self.score = attributes[:'Score']
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.has_key?(:'ClassificationOutcome')
|
|
143
|
+
self.classification_outcome = attributes[:'ClassificationOutcome']
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
148
|
+
# @return Array for valid properties with the reasons
|
|
149
|
+
def list_invalid_properties
|
|
150
|
+
invalid_properties = Array.new
|
|
151
|
+
invalid_properties
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Check to see if the all the properties in the model are valid
|
|
155
|
+
# @return true if the model is valid
|
|
156
|
+
def valid?
|
|
157
|
+
true
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Checks equality by comparing each attribute.
|
|
161
|
+
# @param [Object] Object to be compared
|
|
162
|
+
def ==(o)
|
|
163
|
+
return true if self.equal?(o)
|
|
164
|
+
self.class == o.class &&
|
|
165
|
+
successful == o.successful &&
|
|
166
|
+
clean_result == o.clean_result &&
|
|
167
|
+
contains_nudity == o.contains_nudity &&
|
|
168
|
+
contains_graphic_violence == o.contains_graphic_violence &&
|
|
169
|
+
contains_non_graphic_violence == o.contains_non_graphic_violence &&
|
|
170
|
+
contains_self_harm == o.contains_self_harm &&
|
|
171
|
+
contains_hate == o.contains_hate &&
|
|
172
|
+
contains_potential_illegal_activity == o.contains_potential_illegal_activity &&
|
|
173
|
+
contains_medical_imagery == o.contains_medical_imagery &&
|
|
174
|
+
contains_profanity == o.contains_profanity &&
|
|
175
|
+
score == o.score &&
|
|
176
|
+
classification_outcome == o.classification_outcome
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# @see the `==` method
|
|
180
|
+
# @param [Object] Object to be compared
|
|
181
|
+
def eql?(o)
|
|
182
|
+
self == o
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Calculates hash code according to all attributes.
|
|
186
|
+
# @return [Fixnum] Hash code
|
|
187
|
+
def hash
|
|
188
|
+
[successful, clean_result, contains_nudity, contains_graphic_violence, contains_non_graphic_violence, contains_self_harm, contains_hate, contains_potential_illegal_activity, contains_medical_imagery, contains_profanity, score, classification_outcome].hash
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Builds the object from hash
|
|
192
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
193
|
+
# @return [Object] Returns the model itself
|
|
194
|
+
def build_from_hash(attributes)
|
|
195
|
+
return nil unless attributes.is_a?(Hash)
|
|
196
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
197
|
+
if type =~ /\AArray<(.*)>/i
|
|
198
|
+
# check to ensure the input is an array given that the attribute
|
|
199
|
+
# is documented as an array but the input is not
|
|
200
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
201
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
202
|
+
end
|
|
203
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
204
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
205
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
self
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Deserializes the data based on type
|
|
212
|
+
# @param string type Data type
|
|
213
|
+
# @param string value Value to be deserialized
|
|
214
|
+
# @return [Object] Deserialized data
|
|
215
|
+
def _deserialize(type, value)
|
|
216
|
+
case type.to_sym
|
|
217
|
+
when :DateTime
|
|
218
|
+
DateTime.parse(value)
|
|
219
|
+
when :Date
|
|
220
|
+
Date.parse(value)
|
|
221
|
+
when :String
|
|
222
|
+
value.to_s
|
|
223
|
+
when :Integer
|
|
224
|
+
value.to_i
|
|
225
|
+
when :Float
|
|
226
|
+
value.to_f
|
|
227
|
+
when :BOOLEAN
|
|
228
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
229
|
+
true
|
|
230
|
+
else
|
|
231
|
+
false
|
|
232
|
+
end
|
|
233
|
+
when :Object
|
|
234
|
+
# generic object (usually a Hash), return directly
|
|
235
|
+
value
|
|
236
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
237
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
238
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
239
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
240
|
+
k_type = Regexp.last_match[:k_type]
|
|
241
|
+
v_type = Regexp.last_match[:v_type]
|
|
242
|
+
{}.tap do |hash|
|
|
243
|
+
value.each do |k, v|
|
|
244
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
else # model
|
|
248
|
+
temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
|
|
249
|
+
temp_model.build_from_hash(value)
|
|
250
|
+
end
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Returns the string representation of the object
|
|
254
|
+
# @return [String] String presentation of the object
|
|
255
|
+
def to_s
|
|
256
|
+
to_hash.to_s
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
260
|
+
# @return [Hash] Returns the object in the form of hash
|
|
261
|
+
def to_body
|
|
262
|
+
to_hash
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Returns the object in the form of hash
|
|
266
|
+
# @return [Hash] Returns the object in the form of hash
|
|
267
|
+
def to_hash
|
|
268
|
+
hash = {}
|
|
269
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
270
|
+
value = self.send(attr)
|
|
271
|
+
next if value.nil?
|
|
272
|
+
hash[param] = _to_hash(value)
|
|
273
|
+
end
|
|
274
|
+
hash
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Outputs non-array value in the form of hash
|
|
278
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
279
|
+
# @param [Object] value Any valid value
|
|
280
|
+
# @return [Hash] Returns the value in the form of hash
|
|
281
|
+
def _to_hash(value)
|
|
282
|
+
if value.is_a?(Array)
|
|
283
|
+
value.compact.map { |v| _to_hash(v) }
|
|
284
|
+
elsif value.is_a?(Hash)
|
|
285
|
+
{}.tap do |hash|
|
|
286
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
287
|
+
end
|
|
288
|
+
elsif value.respond_to? :to_hash
|
|
289
|
+
value.to_hash
|
|
290
|
+
else
|
|
291
|
+
value
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
end
|
|
296
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -24,15 +24,28 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
24
24
|
# The person's age range classification result in years; possible values are \"0-2\", \"4-6\", \"8-13\", \"15-20\", \"25-32\", \"38-43\", \"48-53\", \"60+\"
|
|
25
25
|
attr_accessor :age_class
|
|
26
26
|
|
|
27
|
+
# The specific estimated age of the person
|
|
27
28
|
attr_accessor :age
|
|
28
29
|
|
|
30
|
+
# Gender estimation classification as Female or Male
|
|
31
|
+
attr_accessor :gender_classification
|
|
32
|
+
|
|
33
|
+
# Confidence level of classification as female; possible values are between 0.0 and 1.0
|
|
34
|
+
attr_accessor :gender_female_confidence
|
|
35
|
+
|
|
36
|
+
# Confidence level of classification as male; possible values are between 0.0 and 1.0
|
|
37
|
+
attr_accessor :gender_male_confidence
|
|
38
|
+
|
|
29
39
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
30
40
|
def self.attribute_map
|
|
31
41
|
{
|
|
32
42
|
:'face_location' => :'FaceLocation',
|
|
33
43
|
:'age_classification_confidence' => :'AgeClassificationConfidence',
|
|
34
44
|
:'age_class' => :'AgeClass',
|
|
35
|
-
:'age' => :'Age'
|
|
45
|
+
:'age' => :'Age',
|
|
46
|
+
:'gender_classification' => :'GenderClassification',
|
|
47
|
+
:'gender_female_confidence' => :'GenderFemaleConfidence',
|
|
48
|
+
:'gender_male_confidence' => :'GenderMaleConfidence'
|
|
36
49
|
}
|
|
37
50
|
end
|
|
38
51
|
|
|
@@ -42,7 +55,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
42
55
|
:'face_location' => :'Face',
|
|
43
56
|
:'age_classification_confidence' => :'Float',
|
|
44
57
|
:'age_class' => :'String',
|
|
45
|
-
:'age' => :'Float'
|
|
58
|
+
:'age' => :'Float',
|
|
59
|
+
:'gender_classification' => :'String',
|
|
60
|
+
:'gender_female_confidence' => :'Float',
|
|
61
|
+
:'gender_male_confidence' => :'Float'
|
|
46
62
|
}
|
|
47
63
|
end
|
|
48
64
|
|
|
@@ -69,6 +85,18 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
69
85
|
if attributes.has_key?(:'Age')
|
|
70
86
|
self.age = attributes[:'Age']
|
|
71
87
|
end
|
|
88
|
+
|
|
89
|
+
if attributes.has_key?(:'GenderClassification')
|
|
90
|
+
self.gender_classification = attributes[:'GenderClassification']
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.has_key?(:'GenderFemaleConfidence')
|
|
94
|
+
self.gender_female_confidence = attributes[:'GenderFemaleConfidence']
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.has_key?(:'GenderMaleConfidence')
|
|
98
|
+
self.gender_male_confidence = attributes[:'GenderMaleConfidence']
|
|
99
|
+
end
|
|
72
100
|
end
|
|
73
101
|
|
|
74
102
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -92,7 +120,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
92
120
|
face_location == o.face_location &&
|
|
93
121
|
age_classification_confidence == o.age_classification_confidence &&
|
|
94
122
|
age_class == o.age_class &&
|
|
95
|
-
age == o.age
|
|
123
|
+
age == o.age &&
|
|
124
|
+
gender_classification == o.gender_classification &&
|
|
125
|
+
gender_female_confidence == o.gender_female_confidence &&
|
|
126
|
+
gender_male_confidence == o.gender_male_confidence
|
|
96
127
|
end
|
|
97
128
|
|
|
98
129
|
# @see the `==` method
|
|
@@ -104,7 +135,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
|
104
135
|
# Calculates hash code according to all attributes.
|
|
105
136
|
# @return [Fixnum] Hash code
|
|
106
137
|
def hash
|
|
107
|
-
[face_location, age_classification_confidence, age_class, age].hash
|
|
138
|
+
[face_location, age_classification_confidence, age_class, age, gender_classification, gender_female_confidence, gender_male_confidence].hash
|
|
108
139
|
end
|
|
109
140
|
|
|
110
141
|
# Builds the object from hash
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#imageapi
|
|
3
3
|
|
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
4
|
+
#Image Recognition and Processing APIs let you use Artificial Intelligence and Machine Learning to recognize and process images, and also perform useful image modification operations.
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|