cloudmersive-image-recognition-api-client 1.4.6 → 2.0.5
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/Gemfile +1 -1
- data/README.md +17 -6
- data/cloudmersive-image-recognition-api-client.gemspec +3 -3
- data/docs/ArtisticApi.md +2 -2
- data/docs/ConvertApi.md +7 -7
- data/docs/CreateHandwritingRequest.md +11 -0
- data/docs/DrawTextInstance.md +1 -1
- data/docs/EditApi.md +147 -11
- data/docs/FaceApi.md +8 -8
- data/docs/FilterApi.md +8 -8
- data/docs/ImageSimilarityComparisonResponse.md +10 -0
- data/docs/ImageSimilarityHashDistanceRequest.md +9 -0
- data/docs/ImageSimilarityHashDistanceResponse.md +9 -0
- data/docs/ImageSimilarityHashResponse.md +9 -0
- data/docs/InfoApi.md +2 -2
- data/docs/NsfwApi.md +1 -1
- data/docs/RecognizeApi.md +187 -11
- data/docs/ResizeApi.md +4 -4
- data/docs/TextGenerationApi.md +63 -0
- data/lib/cloudmersive-image-recognition-api-client.rb +7 -1
- data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +6 -7
- data/lib/cloudmersive-image-recognition-api-client/api/convert_api.rb +30 -37
- data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +199 -58
- data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +31 -38
- data/lib/cloudmersive-image-recognition-api-client/api/filter_api.rb +34 -42
- data/lib/cloudmersive-image-recognition-api-client/api/info_api.rb +10 -12
- data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +6 -7
- data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +214 -45
- data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +14 -16
- data/lib/cloudmersive-image-recognition-api-client/api/text_generation_api.rb +77 -0
- data/lib/cloudmersive-image-recognition-api-client/api_client.rb +11 -9
- data/lib/cloudmersive-image-recognition-api-client/api_error.rb +1 -1
- data/lib/cloudmersive-image-recognition-api-client/configuration.rb +2 -2
- data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/color_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/create_handwriting_request.rb +216 -0
- data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/dominant_color_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_instance.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_request.rb +9 -13
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +9 -13
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +8 -11
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +9 -13
- data/lib/cloudmersive-image-recognition-api-client/models/face.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/face_compare_response.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/face_locate_with_landmarks_response.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/face_match.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/face_point.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/face_with_landmarks.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/find_symbol_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/fine_text_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/fine_text_item.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/gender_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/image_metadata.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/image_metadata_exif_value.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_comparison_response.rb +206 -0
- data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_hash_distance_request.rb +196 -0
- data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_hash_distance_response.rb +196 -0
- data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_hash_response.rb +196 -0
- data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/person_with_gender.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/polygon_point.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/text_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/text_item.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +7 -10
- data/lib/cloudmersive-image-recognition-api-client/version.rb +2 -2
- data/spec/api/artistic_api_spec.rb +2 -2
- data/spec/api/convert_api_spec.rb +8 -8
- data/spec/api/edit_api_spec.rb +47 -13
- data/spec/api/face_api_spec.rb +8 -8
- data/spec/api/filter_api_spec.rb +9 -9
- data/spec/api/info_api_spec.rb +3 -3
- data/spec/api/nsfw_api_spec.rb +2 -2
- data/spec/api/recognize_api_spec.rb +49 -10
- data/spec/api/resize_api_spec.rb +5 -5
- data/spec/api/text_generation_api_spec.rb +47 -0
- data/spec/api_client_spec.rb +52 -35
- data/spec/configuration_spec.rb +9 -9
- data/spec/models/age_detection_result_spec.rb +4 -5
- data/spec/models/color_result_spec.rb +4 -5
- data/spec/models/create_handwriting_request_spec.rb +59 -0
- data/spec/models/detected_license_plate_spec.rb +8 -9
- data/spec/models/detected_object_spec.rb +7 -8
- data/spec/models/dominant_color_result_spec.rb +3 -4
- data/spec/models/draw_polygon_instance_spec.rb +5 -6
- data/spec/models/draw_polygon_request_spec.rb +4 -5
- data/spec/models/draw_rectangle_instance_spec.rb +8 -9
- data/spec/models/draw_rectangle_request_spec.rb +4 -5
- data/spec/models/draw_text_instance_spec.rb +9 -10
- data/spec/models/draw_text_request_spec.rb +4 -5
- data/spec/models/face_compare_response_spec.rb +5 -6
- data/spec/models/face_locate_response_spec.rb +5 -6
- data/spec/models/face_locate_with_landmarks_response_spec.rb +5 -6
- data/spec/models/face_match_spec.rb +7 -8
- data/spec/models/face_point_spec.rb +3 -4
- data/spec/models/face_spec.rb +5 -6
- data/spec/models/face_with_landmarks_spec.rb +14 -15
- data/spec/models/find_symbol_result_spec.rb +7 -8
- data/spec/models/fine_text_detection_result_spec.rb +4 -5
- data/spec/models/fine_text_item_spec.rb +12 -13
- data/spec/models/gender_detection_result_spec.rb +4 -5
- data/spec/models/image_description_response_spec.rb +5 -6
- data/spec/models/image_metadata_exif_value_spec.rb +4 -5
- data/spec/models/image_metadata_spec.rb +11 -12
- data/spec/models/image_similarity_comparison_response_spec.rb +53 -0
- data/spec/models/image_similarity_hash_distance_request_spec.rb +47 -0
- data/spec/models/image_similarity_hash_distance_response_spec.rb +47 -0
- data/spec/models/image_similarity_hash_response_spec.rb +47 -0
- data/spec/models/nsfw_result_spec.rb +4 -5
- data/spec/models/object_detection_result_spec.rb +4 -5
- data/spec/models/person_with_age_spec.rb +5 -6
- data/spec/models/person_with_gender_spec.rb +4 -5
- data/spec/models/polygon_point_spec.rb +3 -4
- data/spec/models/recognition_outcome_spec.rb +3 -4
- data/spec/models/text_detection_result_spec.rb +4 -5
- data/spec/models/text_item_spec.rb +5 -6
- data/spec/models/vehicle_license_plate_detection_result_spec.rb +4 -5
- data/spec/spec_helper.rb +1 -1
- metadata +20 -2
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -24,7 +24,6 @@ module CloudmersiveImageRecognitionApiClient
|
|
24
24
|
# Count of text items found in the input image
|
25
25
|
attr_accessor :text_items_count
|
26
26
|
|
27
|
-
|
28
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
29
28
|
def self.attribute_map
|
30
29
|
{
|
@@ -49,7 +48,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
49
48
|
return unless attributes.is_a?(Hash)
|
50
49
|
|
51
50
|
# convert string to symbol for hash key
|
52
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
53
52
|
|
54
53
|
if attributes.has_key?(:'Successful')
|
55
54
|
self.successful = attributes[:'Successful']
|
@@ -64,20 +63,19 @@ module CloudmersiveImageRecognitionApiClient
|
|
64
63
|
if attributes.has_key?(:'TextItemsCount')
|
65
64
|
self.text_items_count = attributes[:'TextItemsCount']
|
66
65
|
end
|
67
|
-
|
68
66
|
end
|
69
67
|
|
70
68
|
# Show invalid properties with the reasons. Usually used together with valid?
|
71
69
|
# @return Array for valid properties with the reasons
|
72
70
|
def list_invalid_properties
|
73
71
|
invalid_properties = Array.new
|
74
|
-
|
72
|
+
invalid_properties
|
75
73
|
end
|
76
74
|
|
77
75
|
# Check to see if the all the properties in the model are valid
|
78
76
|
# @return true if the model is valid
|
79
77
|
def valid?
|
80
|
-
|
78
|
+
true
|
81
79
|
end
|
82
80
|
|
83
81
|
# Checks equality by comparing each attribute.
|
@@ -109,10 +107,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
109
107
|
return nil unless attributes.is_a?(Hash)
|
110
108
|
self.class.swagger_types.each_pair do |key, type|
|
111
109
|
if type =~ /\AArray<(.*)>/i
|
112
|
-
# check to ensure the input is an array given that the
|
110
|
+
# check to ensure the input is an array given that the attribute
|
113
111
|
# is documented as an array but the input is not
|
114
112
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
115
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
113
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
116
114
|
end
|
117
115
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
118
116
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -194,7 +192,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
194
192
|
# @return [Hash] Returns the value in the form of hash
|
195
193
|
def _to_hash(value)
|
196
194
|
if value.is_a?(Array)
|
197
|
-
value.compact.map{ |v| _to_hash(v) }
|
195
|
+
value.compact.map { |v| _to_hash(v) }
|
198
196
|
elsif value.is_a?(Hash)
|
199
197
|
{}.tap do |hash|
|
200
198
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -207,5 +205,4 @@ module CloudmersiveImageRecognitionApiClient
|
|
207
205
|
end
|
208
206
|
|
209
207
|
end
|
210
|
-
|
211
208
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -48,7 +48,6 @@ module CloudmersiveImageRecognitionApiClient
|
|
48
48
|
# Rotation Angle in radians of the text
|
49
49
|
attr_accessor :angle
|
50
50
|
|
51
|
-
|
52
51
|
# Attribute mapping from ruby-style variable name to JSON key.
|
53
52
|
def self.attribute_map
|
54
53
|
{
|
@@ -89,7 +88,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
89
88
|
return unless attributes.is_a?(Hash)
|
90
89
|
|
91
90
|
# convert string to symbol for hash key
|
92
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
91
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
93
92
|
|
94
93
|
if attributes.has_key?(:'TopLeftX')
|
95
94
|
self.top_left_x = attributes[:'TopLeftX']
|
@@ -134,20 +133,19 @@ module CloudmersiveImageRecognitionApiClient
|
|
134
133
|
if attributes.has_key?(:'Angle')
|
135
134
|
self.angle = attributes[:'Angle']
|
136
135
|
end
|
137
|
-
|
138
136
|
end
|
139
137
|
|
140
138
|
# Show invalid properties with the reasons. Usually used together with valid?
|
141
139
|
# @return Array for valid properties with the reasons
|
142
140
|
def list_invalid_properties
|
143
141
|
invalid_properties = Array.new
|
144
|
-
|
142
|
+
invalid_properties
|
145
143
|
end
|
146
144
|
|
147
145
|
# Check to see if the all the properties in the model are valid
|
148
146
|
# @return true if the model is valid
|
149
147
|
def valid?
|
150
|
-
|
148
|
+
true
|
151
149
|
end
|
152
150
|
|
153
151
|
# Checks equality by comparing each attribute.
|
@@ -187,10 +185,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
187
185
|
return nil unless attributes.is_a?(Hash)
|
188
186
|
self.class.swagger_types.each_pair do |key, type|
|
189
187
|
if type =~ /\AArray<(.*)>/i
|
190
|
-
# check to ensure the input is an array given that the
|
188
|
+
# check to ensure the input is an array given that the attribute
|
191
189
|
# is documented as an array but the input is not
|
192
190
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
193
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
191
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
194
192
|
end
|
195
193
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
196
194
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -272,7 +270,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
272
270
|
# @return [Hash] Returns the value in the form of hash
|
273
271
|
def _to_hash(value)
|
274
272
|
if value.is_a?(Array)
|
275
|
-
value.compact.map{ |v| _to_hash(v) }
|
273
|
+
value.compact.map { |v| _to_hash(v) }
|
276
274
|
elsif value.is_a?(Hash)
|
277
275
|
{}.tap do |hash|
|
278
276
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -285,5 +283,4 @@ module CloudmersiveImageRecognitionApiClient
|
|
285
283
|
end
|
286
284
|
|
287
285
|
end
|
288
|
-
|
289
286
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -24,7 +24,6 @@ module CloudmersiveImageRecognitionApiClient
|
|
24
24
|
# Number of people identified in the image with a gender
|
25
25
|
attr_accessor :people_identified
|
26
26
|
|
27
|
-
|
28
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
29
28
|
def self.attribute_map
|
30
29
|
{
|
@@ -49,7 +48,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
49
48
|
return unless attributes.is_a?(Hash)
|
50
49
|
|
51
50
|
# convert string to symbol for hash key
|
52
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
53
52
|
|
54
53
|
if attributes.has_key?(:'Successful')
|
55
54
|
self.successful = attributes[:'Successful']
|
@@ -64,20 +63,19 @@ module CloudmersiveImageRecognitionApiClient
|
|
64
63
|
if attributes.has_key?(:'PeopleIdentified')
|
65
64
|
self.people_identified = attributes[:'PeopleIdentified']
|
66
65
|
end
|
67
|
-
|
68
66
|
end
|
69
67
|
|
70
68
|
# Show invalid properties with the reasons. Usually used together with valid?
|
71
69
|
# @return Array for valid properties with the reasons
|
72
70
|
def list_invalid_properties
|
73
71
|
invalid_properties = Array.new
|
74
|
-
|
72
|
+
invalid_properties
|
75
73
|
end
|
76
74
|
|
77
75
|
# Check to see if the all the properties in the model are valid
|
78
76
|
# @return true if the model is valid
|
79
77
|
def valid?
|
80
|
-
|
78
|
+
true
|
81
79
|
end
|
82
80
|
|
83
81
|
# Checks equality by comparing each attribute.
|
@@ -109,10 +107,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
109
107
|
return nil unless attributes.is_a?(Hash)
|
110
108
|
self.class.swagger_types.each_pair do |key, type|
|
111
109
|
if type =~ /\AArray<(.*)>/i
|
112
|
-
# check to ensure the input is an array given that the
|
110
|
+
# check to ensure the input is an array given that the attribute
|
113
111
|
# is documented as an array but the input is not
|
114
112
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
115
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
113
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
116
114
|
end
|
117
115
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
118
116
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -194,7 +192,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
194
192
|
# @return [Hash] Returns the value in the form of hash
|
195
193
|
def _to_hash(value)
|
196
194
|
if value.is_a?(Array)
|
197
|
-
value.compact.map{ |v| _to_hash(v) }
|
195
|
+
value.compact.map { |v| _to_hash(v) }
|
198
196
|
elsif value.is_a?(Hash)
|
199
197
|
{}.tap do |hash|
|
200
198
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -207,5 +205,4 @@ module CloudmersiveImageRecognitionApiClient
|
|
207
205
|
end
|
208
206
|
|
209
207
|
end
|
210
|
-
|
211
208
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -27,7 +27,6 @@ module CloudmersiveImageRecognitionApiClient
|
|
27
27
|
# Best backup (\"runner up\") Machine Learning outcome
|
28
28
|
attr_accessor :runner_up_outcome
|
29
29
|
|
30
|
-
|
31
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
32
31
|
def self.attribute_map
|
33
32
|
{
|
@@ -54,7 +53,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
54
53
|
return unless attributes.is_a?(Hash)
|
55
54
|
|
56
55
|
# convert string to symbol for hash key
|
57
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
56
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
58
57
|
|
59
58
|
if attributes.has_key?(:'Successful')
|
60
59
|
self.successful = attributes[:'Successful']
|
@@ -71,20 +70,19 @@ module CloudmersiveImageRecognitionApiClient
|
|
71
70
|
if attributes.has_key?(:'RunnerUpOutcome')
|
72
71
|
self.runner_up_outcome = attributes[:'RunnerUpOutcome']
|
73
72
|
end
|
74
|
-
|
75
73
|
end
|
76
74
|
|
77
75
|
# Show invalid properties with the reasons. Usually used together with valid?
|
78
76
|
# @return Array for valid properties with the reasons
|
79
77
|
def list_invalid_properties
|
80
78
|
invalid_properties = Array.new
|
81
|
-
|
79
|
+
invalid_properties
|
82
80
|
end
|
83
81
|
|
84
82
|
# Check to see if the all the properties in the model are valid
|
85
83
|
# @return true if the model is valid
|
86
84
|
def valid?
|
87
|
-
|
85
|
+
true
|
88
86
|
end
|
89
87
|
|
90
88
|
# Checks equality by comparing each attribute.
|
@@ -117,10 +115,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
117
115
|
return nil unless attributes.is_a?(Hash)
|
118
116
|
self.class.swagger_types.each_pair do |key, type|
|
119
117
|
if type =~ /\AArray<(.*)>/i
|
120
|
-
# check to ensure the input is an array given that the
|
118
|
+
# check to ensure the input is an array given that the attribute
|
121
119
|
# is documented as an array but the input is not
|
122
120
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
123
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
121
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
124
122
|
end
|
125
123
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
126
124
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -202,7 +200,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
202
200
|
# @return [Hash] Returns the value in the form of hash
|
203
201
|
def _to_hash(value)
|
204
202
|
if value.is_a?(Array)
|
205
|
-
value.compact.map{ |v| _to_hash(v) }
|
203
|
+
value.compact.map { |v| _to_hash(v) }
|
206
204
|
elsif value.is_a?(Hash)
|
207
205
|
{}.tap do |hash|
|
208
206
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -215,5 +213,4 @@ module CloudmersiveImageRecognitionApiClient
|
|
215
213
|
end
|
216
214
|
|
217
215
|
end
|
218
|
-
|
219
216
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -45,7 +45,6 @@ module CloudmersiveImageRecognitionApiClient
|
|
45
45
|
# EXIF tags and values embedded in the image
|
46
46
|
attr_accessor :exif_values
|
47
47
|
|
48
|
-
|
49
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
50
49
|
def self.attribute_map
|
51
50
|
{
|
@@ -84,7 +83,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
84
83
|
return unless attributes.is_a?(Hash)
|
85
84
|
|
86
85
|
# convert string to symbol for hash key
|
87
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
86
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
88
87
|
|
89
88
|
if attributes.has_key?(:'Successful')
|
90
89
|
self.successful = attributes[:'Successful']
|
@@ -127,20 +126,19 @@ module CloudmersiveImageRecognitionApiClient
|
|
127
126
|
self.exif_values = value
|
128
127
|
end
|
129
128
|
end
|
130
|
-
|
131
129
|
end
|
132
130
|
|
133
131
|
# Show invalid properties with the reasons. Usually used together with valid?
|
134
132
|
# @return Array for valid properties with the reasons
|
135
133
|
def list_invalid_properties
|
136
134
|
invalid_properties = Array.new
|
137
|
-
|
135
|
+
invalid_properties
|
138
136
|
end
|
139
137
|
|
140
138
|
# Check to see if the all the properties in the model are valid
|
141
139
|
# @return true if the model is valid
|
142
140
|
def valid?
|
143
|
-
|
141
|
+
true
|
144
142
|
end
|
145
143
|
|
146
144
|
# Checks equality by comparing each attribute.
|
@@ -179,10 +177,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
179
177
|
return nil unless attributes.is_a?(Hash)
|
180
178
|
self.class.swagger_types.each_pair do |key, type|
|
181
179
|
if type =~ /\AArray<(.*)>/i
|
182
|
-
# check to ensure the input is an array given that the
|
180
|
+
# check to ensure the input is an array given that the attribute
|
183
181
|
# is documented as an array but the input is not
|
184
182
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
185
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
183
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
186
184
|
end
|
187
185
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
188
186
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -264,7 +262,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
264
262
|
# @return [Hash] Returns the value in the form of hash
|
265
263
|
def _to_hash(value)
|
266
264
|
if value.is_a?(Array)
|
267
|
-
value.compact.map{ |v| _to_hash(v) }
|
265
|
+
value.compact.map { |v| _to_hash(v) }
|
268
266
|
elsif value.is_a?(Hash)
|
269
267
|
{}.tap do |hash|
|
270
268
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -277,5 +275,4 @@ module CloudmersiveImageRecognitionApiClient
|
|
277
275
|
end
|
278
276
|
|
279
277
|
end
|
280
|
-
|
281
278
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -24,7 +24,6 @@ module CloudmersiveImageRecognitionApiClient
|
|
24
24
|
# Value, formatted as a string of the EXIF value
|
25
25
|
attr_accessor :data_value
|
26
26
|
|
27
|
-
|
28
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
29
28
|
def self.attribute_map
|
30
29
|
{
|
@@ -49,7 +48,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
49
48
|
return unless attributes.is_a?(Hash)
|
50
49
|
|
51
50
|
# convert string to symbol for hash key
|
52
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
53
52
|
|
54
53
|
if attributes.has_key?(:'Tag')
|
55
54
|
self.tag = attributes[:'Tag']
|
@@ -62,20 +61,19 @@ module CloudmersiveImageRecognitionApiClient
|
|
62
61
|
if attributes.has_key?(:'DataValue')
|
63
62
|
self.data_value = attributes[:'DataValue']
|
64
63
|
end
|
65
|
-
|
66
64
|
end
|
67
65
|
|
68
66
|
# Show invalid properties with the reasons. Usually used together with valid?
|
69
67
|
# @return Array for valid properties with the reasons
|
70
68
|
def list_invalid_properties
|
71
69
|
invalid_properties = Array.new
|
72
|
-
|
70
|
+
invalid_properties
|
73
71
|
end
|
74
72
|
|
75
73
|
# Check to see if the all the properties in the model are valid
|
76
74
|
# @return true if the model is valid
|
77
75
|
def valid?
|
78
|
-
|
76
|
+
true
|
79
77
|
end
|
80
78
|
|
81
79
|
# Checks equality by comparing each attribute.
|
@@ -107,10 +105,10 @@ module CloudmersiveImageRecognitionApiClient
|
|
107
105
|
return nil unless attributes.is_a?(Hash)
|
108
106
|
self.class.swagger_types.each_pair do |key, type|
|
109
107
|
if type =~ /\AArray<(.*)>/i
|
110
|
-
# check to ensure the input is an array given that the
|
108
|
+
# check to ensure the input is an array given that the attribute
|
111
109
|
# is documented as an array but the input is not
|
112
110
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
113
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
111
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
114
112
|
end
|
115
113
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
116
114
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -192,7 +190,7 @@ module CloudmersiveImageRecognitionApiClient
|
|
192
190
|
# @return [Hash] Returns the value in the form of hash
|
193
191
|
def _to_hash(value)
|
194
192
|
if value.is_a?(Array)
|
195
|
-
value.compact.map{ |v| _to_hash(v) }
|
193
|
+
value.compact.map { |v| _to_hash(v) }
|
196
194
|
elsif value.is_a?(Hash)
|
197
195
|
{}.tap do |hash|
|
198
196
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -205,5 +203,4 @@ module CloudmersiveImageRecognitionApiClient
|
|
205
203
|
end
|
206
204
|
|
207
205
|
end
|
208
|
-
|
209
206
|
end
|
data/lib/cloudmersive-image-recognition-api-client/models/image_similarity_comparison_response.rb
ADDED
@@ -0,0 +1,206 @@
|
|
1
|
+
=begin
|
2
|
+
#imageapi
|
3
|
+
|
4
|
+
#Image Recognition and Processing APIs let you use 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 performing an image similarity operation
|
17
|
+
class ImageSimilarityComparisonResponse
|
18
|
+
# True if successful, false otherwise
|
19
|
+
attr_accessor :successful
|
20
|
+
|
21
|
+
# True if images are similar, false otherwise
|
22
|
+
attr_accessor :are_images_similar
|
23
|
+
|
24
|
+
# Similarity score between 0.0 and 1.0, with 1.0 meaning highly similar and 0.0 meaning highly dissimilar
|
25
|
+
attr_accessor :image_similarity_score
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'successful' => :'Successful',
|
31
|
+
:'are_images_similar' => :'AreImagesSimilar',
|
32
|
+
:'image_similarity_score' => :'ImageSimilarityScore'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.swagger_types
|
38
|
+
{
|
39
|
+
:'successful' => :'BOOLEAN',
|
40
|
+
:'are_images_similar' => :'BOOLEAN',
|
41
|
+
:'image_similarity_score' => :'Float'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
return unless attributes.is_a?(Hash)
|
49
|
+
|
50
|
+
# convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
52
|
+
|
53
|
+
if attributes.has_key?(:'Successful')
|
54
|
+
self.successful = attributes[:'Successful']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.has_key?(:'AreImagesSimilar')
|
58
|
+
self.are_images_similar = attributes[:'AreImagesSimilar']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'ImageSimilarityScore')
|
62
|
+
self.image_similarity_score = attributes[:'ImageSimilarityScore']
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
67
|
+
# @return Array for valid properties with the reasons
|
68
|
+
def list_invalid_properties
|
69
|
+
invalid_properties = Array.new
|
70
|
+
invalid_properties
|
71
|
+
end
|
72
|
+
|
73
|
+
# Check to see if the all the properties in the model are valid
|
74
|
+
# @return true if the model is valid
|
75
|
+
def valid?
|
76
|
+
true
|
77
|
+
end
|
78
|
+
|
79
|
+
# Checks equality by comparing each attribute.
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def ==(o)
|
82
|
+
return true if self.equal?(o)
|
83
|
+
self.class == o.class &&
|
84
|
+
successful == o.successful &&
|
85
|
+
are_images_similar == o.are_images_similar &&
|
86
|
+
image_similarity_score == o.image_similarity_score
|
87
|
+
end
|
88
|
+
|
89
|
+
# @see the `==` method
|
90
|
+
# @param [Object] Object to be compared
|
91
|
+
def eql?(o)
|
92
|
+
self == o
|
93
|
+
end
|
94
|
+
|
95
|
+
# Calculates hash code according to all attributes.
|
96
|
+
# @return [Fixnum] Hash code
|
97
|
+
def hash
|
98
|
+
[successful, are_images_similar, image_similarity_score].hash
|
99
|
+
end
|
100
|
+
|
101
|
+
# Builds the object from hash
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @return [Object] Returns the model itself
|
104
|
+
def build_from_hash(attributes)
|
105
|
+
return nil unless attributes.is_a?(Hash)
|
106
|
+
self.class.swagger_types.each_pair do |key, type|
|
107
|
+
if type =~ /\AArray<(.*)>/i
|
108
|
+
# check to ensure the input is an array given that the attribute
|
109
|
+
# is documented as an array but the input is not
|
110
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
111
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
112
|
+
end
|
113
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
114
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
115
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
116
|
+
end
|
117
|
+
|
118
|
+
self
|
119
|
+
end
|
120
|
+
|
121
|
+
# Deserializes the data based on type
|
122
|
+
# @param string type Data type
|
123
|
+
# @param string value Value to be deserialized
|
124
|
+
# @return [Object] Deserialized data
|
125
|
+
def _deserialize(type, value)
|
126
|
+
case type.to_sym
|
127
|
+
when :DateTime
|
128
|
+
DateTime.parse(value)
|
129
|
+
when :Date
|
130
|
+
Date.parse(value)
|
131
|
+
when :String
|
132
|
+
value.to_s
|
133
|
+
when :Integer
|
134
|
+
value.to_i
|
135
|
+
when :Float
|
136
|
+
value.to_f
|
137
|
+
when :BOOLEAN
|
138
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
139
|
+
true
|
140
|
+
else
|
141
|
+
false
|
142
|
+
end
|
143
|
+
when :Object
|
144
|
+
# generic object (usually a Hash), return directly
|
145
|
+
value
|
146
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
147
|
+
inner_type = Regexp.last_match[:inner_type]
|
148
|
+
value.map { |v| _deserialize(inner_type, v) }
|
149
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
150
|
+
k_type = Regexp.last_match[:k_type]
|
151
|
+
v_type = Regexp.last_match[:v_type]
|
152
|
+
{}.tap do |hash|
|
153
|
+
value.each do |k, v|
|
154
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
else # model
|
158
|
+
temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
|
159
|
+
temp_model.build_from_hash(value)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
# Returns the string representation of the object
|
164
|
+
# @return [String] String presentation of the object
|
165
|
+
def to_s
|
166
|
+
to_hash.to_s
|
167
|
+
end
|
168
|
+
|
169
|
+
# to_body is an alias to to_hash (backward compatibility)
|
170
|
+
# @return [Hash] Returns the object in the form of hash
|
171
|
+
def to_body
|
172
|
+
to_hash
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the object in the form of hash
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
177
|
+
def to_hash
|
178
|
+
hash = {}
|
179
|
+
self.class.attribute_map.each_pair do |attr, param|
|
180
|
+
value = self.send(attr)
|
181
|
+
next if value.nil?
|
182
|
+
hash[param] = _to_hash(value)
|
183
|
+
end
|
184
|
+
hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Outputs non-array value in the form of hash
|
188
|
+
# For object, use to_hash. Otherwise, just return the value
|
189
|
+
# @param [Object] value Any valid value
|
190
|
+
# @return [Hash] Returns the value in the form of hash
|
191
|
+
def _to_hash(value)
|
192
|
+
if value.is_a?(Array)
|
193
|
+
value.compact.map { |v| _to_hash(v) }
|
194
|
+
elsif value.is_a?(Hash)
|
195
|
+
{}.tap do |hash|
|
196
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
197
|
+
end
|
198
|
+
elsif value.respond_to? :to_hash
|
199
|
+
value.to_hash
|
200
|
+
else
|
201
|
+
value
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
end
|
206
|
+
end
|