cloudmersive-image-recognition-api-client 1.2.9

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.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +132 -0
  4. data/Rakefile +8 -0
  5. data/cloudmersive-image-recognition-api-client.gemspec +45 -0
  6. data/docs/AgeDetectionResult.md +10 -0
  7. data/docs/ArtisticApi.md +66 -0
  8. data/docs/DetectedLicensePlate.md +14 -0
  9. data/docs/DetectedObject.md +13 -0
  10. data/docs/DrawRectangleInstance.md +14 -0
  11. data/docs/DrawRectangleRequest.md +10 -0
  12. data/docs/DrawTextInstance.md +15 -0
  13. data/docs/DrawTextRequest.md +10 -0
  14. data/docs/EditApi.md +179 -0
  15. data/docs/Face.md +11 -0
  16. data/docs/FaceApi.md +228 -0
  17. data/docs/FaceLocateResponse.md +11 -0
  18. data/docs/ImageDescriptionResponse.md +11 -0
  19. data/docs/NsfwApi.md +63 -0
  20. data/docs/NsfwResult.md +10 -0
  21. data/docs/ObjectDetectionResult.md +10 -0
  22. data/docs/PersonWithAge.md +10 -0
  23. data/docs/RecognitionOutcome.md +9 -0
  24. data/docs/RecognizeApi.md +287 -0
  25. data/docs/ResizeApi.md +69 -0
  26. data/docs/VehicleLicensePlateDetectionResult.md +10 -0
  27. data/git_push.sh +55 -0
  28. data/lib/cloudmersive-image-recognition-api-client.rb +60 -0
  29. data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +85 -0
  30. data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +202 -0
  31. data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +247 -0
  32. data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +79 -0
  33. data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +306 -0
  34. data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +91 -0
  35. data/lib/cloudmersive-image-recognition-api-client/api_client.rb +389 -0
  36. data/lib/cloudmersive-image-recognition-api-client/api_error.rb +38 -0
  37. data/lib/cloudmersive-image-recognition-api-client/configuration.rb +209 -0
  38. data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +211 -0
  39. data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +245 -0
  40. data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +239 -0
  41. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +249 -0
  42. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +227 -0
  43. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +259 -0
  44. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +227 -0
  45. data/lib/cloudmersive-image-recognition-api-client/models/face.rb +219 -0
  46. data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +220 -0
  47. data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +219 -0
  48. data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +209 -0
  49. data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +211 -0
  50. data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +209 -0
  51. data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +199 -0
  52. data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +211 -0
  53. data/lib/cloudmersive-image-recognition-api-client/version.rb +15 -0
  54. data/spec/api/artistic_api_spec.rb +48 -0
  55. data/spec/api/edit_api_spec.rb +73 -0
  56. data/spec/api/face_api_spec.rb +83 -0
  57. data/spec/api/nsfw_api_spec.rb +47 -0
  58. data/spec/api/recognize_api_spec.rb +96 -0
  59. data/spec/api/resize_api_spec.rb +49 -0
  60. data/spec/api_client_spec.rb +226 -0
  61. data/spec/configuration_spec.rb +42 -0
  62. data/spec/models/age_detection_result_spec.rb +54 -0
  63. data/spec/models/detected_license_plate_spec.rb +78 -0
  64. data/spec/models/detected_object_spec.rb +72 -0
  65. data/spec/models/draw_rectangle_instance_spec.rb +78 -0
  66. data/spec/models/draw_rectangle_request_spec.rb +54 -0
  67. data/spec/models/draw_text_instance_spec.rb +84 -0
  68. data/spec/models/draw_text_request_spec.rb +54 -0
  69. data/spec/models/face_locate_response_spec.rb +60 -0
  70. data/spec/models/face_spec.rb +60 -0
  71. data/spec/models/image_description_response_spec.rb +60 -0
  72. data/spec/models/nsfw_result_spec.rb +54 -0
  73. data/spec/models/object_detection_result_spec.rb +54 -0
  74. data/spec/models/person_with_age_spec.rb +54 -0
  75. data/spec/models/recognition_outcome_spec.rb +48 -0
  76. data/spec/models/vehicle_license_plate_detection_result_spec.rb +54 -0
  77. data/spec/spec_helper.rb +111 -0
  78. metadata +302 -0
@@ -0,0 +1,247 @@
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: unset
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module CloudmersiveImageRecognitionApiClient
16
+ class FaceApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Crop image to face (square)
24
+ # Crop an image to the face (rectangular crop). If there is more than one face present, choose the first one.
25
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [String]
28
+ def face_crop_first(image_file, opts = {})
29
+ data, _status_code, _headers = face_crop_first_with_http_info(image_file, opts)
30
+ return data
31
+ end
32
+
33
+ # Crop image to face (square)
34
+ # Crop an image to the face (rectangular crop). If there is more than one face present, choose the first one.
35
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
38
+ def face_crop_first_with_http_info(image_file, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug "Calling API: FaceApi.face_crop_first ..."
41
+ end
42
+ # verify the required parameter 'image_file' is set
43
+ if @api_client.config.client_side_validation && image_file.nil?
44
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_crop_first"
45
+ end
46
+ # resource path
47
+ local_var_path = "/image/face/crop/first"
48
+
49
+ # query parameters
50
+ query_params = {}
51
+
52
+ # header parameters
53
+ header_params = {}
54
+ # HTTP header 'Accept' (if needed)
55
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
56
+ # HTTP header 'Content-Type'
57
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
58
+
59
+ # form parameters
60
+ form_params = {}
61
+ form_params["imageFile"] = image_file
62
+
63
+ # http body (model)
64
+ post_body = nil
65
+ auth_names = ['Apikey']
66
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => 'String')
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: FaceApi#face_crop_first\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ # Crop image to face (round)
80
+ # Crop an image to the face (circular/round crop). If there is more than one face present, choose the first one.
81
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
82
+ # @param [Hash] opts the optional parameters
83
+ # @return [String]
84
+ def face_crop_first_round(image_file, opts = {})
85
+ data, _status_code, _headers = face_crop_first_round_with_http_info(image_file, opts)
86
+ return data
87
+ end
88
+
89
+ # Crop image to face (round)
90
+ # Crop an image to the face (circular/round crop). If there is more than one face present, choose the first one.
91
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
94
+ def face_crop_first_round_with_http_info(image_file, opts = {})
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug "Calling API: FaceApi.face_crop_first_round ..."
97
+ end
98
+ # verify the required parameter 'image_file' is set
99
+ if @api_client.config.client_side_validation && image_file.nil?
100
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_crop_first_round"
101
+ end
102
+ # resource path
103
+ local_var_path = "/image/face/crop/first/round"
104
+
105
+ # query parameters
106
+ query_params = {}
107
+
108
+ # header parameters
109
+ header_params = {}
110
+ # HTTP header 'Accept' (if needed)
111
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
112
+ # HTTP header 'Content-Type'
113
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
114
+
115
+ # form parameters
116
+ form_params = {}
117
+ form_params["imageFile"] = image_file
118
+
119
+ # http body (model)
120
+ post_body = nil
121
+ auth_names = ['Apikey']
122
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
123
+ :header_params => header_params,
124
+ :query_params => query_params,
125
+ :form_params => form_params,
126
+ :body => post_body,
127
+ :auth_names => auth_names,
128
+ :return_type => 'String')
129
+ if @api_client.config.debugging
130
+ @api_client.config.logger.debug "API called: FaceApi#face_crop_first_round\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
131
+ end
132
+ return data, status_code, headers
133
+ end
134
+
135
+ # Detect the age of people in an image
136
+ # Identify the age, position, and size of human faces in an image, along with a recognition confidence level. People in the image do NOT need to be facing the camera; they can be facing away, edge-on, etc.
137
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
138
+ # @param [Hash] opts the optional parameters
139
+ # @return [AgeDetectionResult]
140
+ def face_detect_age(image_file, opts = {})
141
+ data, _status_code, _headers = face_detect_age_with_http_info(image_file, opts)
142
+ return data
143
+ end
144
+
145
+ # Detect the age of people in an image
146
+ # Identify the age, position, and size of human faces in an image, along with a recognition confidence level. People in the image do NOT need to be facing the camera; they can be facing away, edge-on, etc.
147
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
148
+ # @param [Hash] opts the optional parameters
149
+ # @return [Array<(AgeDetectionResult, Fixnum, Hash)>] AgeDetectionResult data, response status code and response headers
150
+ def face_detect_age_with_http_info(image_file, opts = {})
151
+ if @api_client.config.debugging
152
+ @api_client.config.logger.debug "Calling API: FaceApi.face_detect_age ..."
153
+ end
154
+ # verify the required parameter 'image_file' is set
155
+ if @api_client.config.client_side_validation && image_file.nil?
156
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_detect_age"
157
+ end
158
+ # resource path
159
+ local_var_path = "/image/face/detect-age"
160
+
161
+ # query parameters
162
+ query_params = {}
163
+
164
+ # header parameters
165
+ header_params = {}
166
+ # HTTP header 'Accept' (if needed)
167
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
168
+ # HTTP header 'Content-Type'
169
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
170
+
171
+ # form parameters
172
+ form_params = {}
173
+ form_params["imageFile"] = image_file
174
+
175
+ # http body (model)
176
+ post_body = nil
177
+ auth_names = ['Apikey']
178
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
179
+ :header_params => header_params,
180
+ :query_params => query_params,
181
+ :form_params => form_params,
182
+ :body => post_body,
183
+ :auth_names => auth_names,
184
+ :return_type => 'AgeDetectionResult')
185
+ if @api_client.config.debugging
186
+ @api_client.config.logger.debug "API called: FaceApi#face_detect_age\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
187
+ end
188
+ return data, status_code, headers
189
+ end
190
+
191
+ # Find faces in an image
192
+ # Locate the positions of all faces in an image
193
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
194
+ # @param [Hash] opts the optional parameters
195
+ # @return [FaceLocateResponse]
196
+ def face_locate(image_file, opts = {})
197
+ data, _status_code, _headers = face_locate_with_http_info(image_file, opts)
198
+ return data
199
+ end
200
+
201
+ # Find faces in an image
202
+ # Locate the positions of all faces in an image
203
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
204
+ # @param [Hash] opts the optional parameters
205
+ # @return [Array<(FaceLocateResponse, Fixnum, Hash)>] FaceLocateResponse data, response status code and response headers
206
+ def face_locate_with_http_info(image_file, opts = {})
207
+ if @api_client.config.debugging
208
+ @api_client.config.logger.debug "Calling API: FaceApi.face_locate ..."
209
+ end
210
+ # verify the required parameter 'image_file' is set
211
+ if @api_client.config.client_side_validation && image_file.nil?
212
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_locate"
213
+ end
214
+ # resource path
215
+ local_var_path = "/image/face/locate"
216
+
217
+ # query parameters
218
+ query_params = {}
219
+
220
+ # header parameters
221
+ header_params = {}
222
+ # HTTP header 'Accept' (if needed)
223
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
224
+ # HTTP header 'Content-Type'
225
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
226
+
227
+ # form parameters
228
+ form_params = {}
229
+ form_params["imageFile"] = image_file
230
+
231
+ # http body (model)
232
+ post_body = nil
233
+ auth_names = ['Apikey']
234
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
235
+ :header_params => header_params,
236
+ :query_params => query_params,
237
+ :form_params => form_params,
238
+ :body => post_body,
239
+ :auth_names => auth_names,
240
+ :return_type => 'FaceLocateResponse')
241
+ if @api_client.config.debugging
242
+ @api_client.config.logger.debug "API called: FaceApi#face_locate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
243
+ end
244
+ return data, status_code, headers
245
+ end
246
+ end
247
+ end
@@ -0,0 +1,79 @@
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: unset
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module CloudmersiveImageRecognitionApiClient
16
+ class NsfwApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Not safe for work (NSFW) racy content classification
24
+ # Classify an image into Not Safe For Work (NSFW)/Porn/Racy content and Safe Content.
25
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [NsfwResult]
28
+ def nsfw_classify(image_file, opts = {})
29
+ data, _status_code, _headers = nsfw_classify_with_http_info(image_file, opts)
30
+ return data
31
+ end
32
+
33
+ # Not safe for work (NSFW) racy content classification
34
+ # Classify an image into Not Safe For Work (NSFW)/Porn/Racy content and Safe Content.
35
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<(NsfwResult, Fixnum, Hash)>] NsfwResult data, response status code and response headers
38
+ def nsfw_classify_with_http_info(image_file, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug "Calling API: NsfwApi.nsfw_classify ..."
41
+ end
42
+ # verify the required parameter 'image_file' is set
43
+ if @api_client.config.client_side_validation && image_file.nil?
44
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling NsfwApi.nsfw_classify"
45
+ end
46
+ # resource path
47
+ local_var_path = "/image/nsfw/classify"
48
+
49
+ # query parameters
50
+ query_params = {}
51
+
52
+ # header parameters
53
+ header_params = {}
54
+ # HTTP header 'Accept' (if needed)
55
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
56
+ # HTTP header 'Content-Type'
57
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
58
+
59
+ # form parameters
60
+ form_params = {}
61
+ form_params["imageFile"] = image_file
62
+
63
+ # http body (model)
64
+ post_body = nil
65
+ auth_names = ['Apikey']
66
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => 'NsfwResult')
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: NsfwApi#nsfw_classify\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,306 @@
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: unset
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module CloudmersiveImageRecognitionApiClient
16
+ class RecognizeApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Describe an image in natural language
24
+ # Generate an English language text description of the image as a sentence.
25
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [ImageDescriptionResponse]
28
+ def recognize_describe(image_file, opts = {})
29
+ data, _status_code, _headers = recognize_describe_with_http_info(image_file, opts)
30
+ return data
31
+ end
32
+
33
+ # Describe an image in natural language
34
+ # Generate an English language text description of the image as a sentence.
35
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<(ImageDescriptionResponse, Fixnum, Hash)>] ImageDescriptionResponse data, response status code and response headers
38
+ def recognize_describe_with_http_info(image_file, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug "Calling API: RecognizeApi.recognize_describe ..."
41
+ end
42
+ # verify the required parameter 'image_file' is set
43
+ if @api_client.config.client_side_validation && image_file.nil?
44
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling RecognizeApi.recognize_describe"
45
+ end
46
+ # resource path
47
+ local_var_path = "/image/recognize/describe"
48
+
49
+ # query parameters
50
+ query_params = {}
51
+
52
+ # header parameters
53
+ header_params = {}
54
+ # HTTP header 'Accept' (if needed)
55
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
56
+ # HTTP header 'Content-Type'
57
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
58
+
59
+ # form parameters
60
+ form_params = {}
61
+ form_params["imageFile"] = image_file
62
+
63
+ # http body (model)
64
+ post_body = nil
65
+ auth_names = ['Apikey']
66
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => 'ImageDescriptionResponse')
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: RecognizeApi#recognize_describe\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ # Detect and unskew a photo of a document
80
+ # Detect and unskew a photo of a document (e.g. taken on a cell phone) into a perfectly square image. Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
81
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
82
+ # @param [Hash] opts the optional parameters
83
+ # @option opts [String] :post_processing_effect Optional, post-processing effects to apply to the email, default is None. Possible values are None and BlackAndWhite (force the image into a black and white view to aid in OCR operations).
84
+ # @return [String]
85
+ def recognize_detect_and_unskew_document(image_file, opts = {})
86
+ data, _status_code, _headers = recognize_detect_and_unskew_document_with_http_info(image_file, opts)
87
+ return data
88
+ end
89
+
90
+ # Detect and unskew a photo of a document
91
+ # Detect and unskew a photo of a document (e.g. taken on a cell phone) into a perfectly square image. Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
92
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
93
+ # @param [Hash] opts the optional parameters
94
+ # @option opts [String] :post_processing_effect Optional, post-processing effects to apply to the email, default is None. Possible values are None and BlackAndWhite (force the image into a black and white view to aid in OCR operations).
95
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
96
+ def recognize_detect_and_unskew_document_with_http_info(image_file, opts = {})
97
+ if @api_client.config.debugging
98
+ @api_client.config.logger.debug "Calling API: RecognizeApi.recognize_detect_and_unskew_document ..."
99
+ end
100
+ # verify the required parameter 'image_file' is set
101
+ if @api_client.config.client_side_validation && image_file.nil?
102
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling RecognizeApi.recognize_detect_and_unskew_document"
103
+ end
104
+ # resource path
105
+ local_var_path = "/image/recognize/detect-document/unskew"
106
+
107
+ # query parameters
108
+ query_params = {}
109
+
110
+ # header parameters
111
+ header_params = {}
112
+ # HTTP header 'Accept' (if needed)
113
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
114
+ # HTTP header 'Content-Type'
115
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
116
+ header_params[:'PostProcessingEffect'] = opts[:'post_processing_effect'] if !opts[:'post_processing_effect'].nil?
117
+
118
+ # form parameters
119
+ form_params = {}
120
+ form_params["imageFile"] = image_file
121
+
122
+ # http body (model)
123
+ post_body = nil
124
+ auth_names = ['Apikey']
125
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
126
+ :header_params => header_params,
127
+ :query_params => query_params,
128
+ :form_params => form_params,
129
+ :body => post_body,
130
+ :auth_names => auth_names,
131
+ :return_type => 'String')
132
+ if @api_client.config.debugging
133
+ @api_client.config.logger.debug "API called: RecognizeApi#recognize_detect_and_unskew_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
134
+ end
135
+ return data, status_code, headers
136
+ end
137
+
138
+ # Detect objects, including types and locations, in an image
139
+ # Identify the position, size and description of objects in an image, along with a recognition confidence level. Detects both human people and objects in an image.
140
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
141
+ # @param [Hash] opts the optional parameters
142
+ # @return [ObjectDetectionResult]
143
+ def recognize_detect_objects(image_file, opts = {})
144
+ data, _status_code, _headers = recognize_detect_objects_with_http_info(image_file, opts)
145
+ return data
146
+ end
147
+
148
+ # Detect objects, including types and locations, in an image
149
+ # Identify the position, size and description of objects in an image, along with a recognition confidence level. Detects both human people and objects in an image.
150
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
151
+ # @param [Hash] opts the optional parameters
152
+ # @return [Array<(ObjectDetectionResult, Fixnum, Hash)>] ObjectDetectionResult data, response status code and response headers
153
+ def recognize_detect_objects_with_http_info(image_file, opts = {})
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug "Calling API: RecognizeApi.recognize_detect_objects ..."
156
+ end
157
+ # verify the required parameter 'image_file' is set
158
+ if @api_client.config.client_side_validation && image_file.nil?
159
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling RecognizeApi.recognize_detect_objects"
160
+ end
161
+ # resource path
162
+ local_var_path = "/image/recognize/detect-objects"
163
+
164
+ # query parameters
165
+ query_params = {}
166
+
167
+ # header parameters
168
+ header_params = {}
169
+ # HTTP header 'Accept' (if needed)
170
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
171
+ # HTTP header 'Content-Type'
172
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
173
+
174
+ # form parameters
175
+ form_params = {}
176
+ form_params["imageFile"] = image_file
177
+
178
+ # http body (model)
179
+ post_body = nil
180
+ auth_names = ['Apikey']
181
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
182
+ :header_params => header_params,
183
+ :query_params => query_params,
184
+ :form_params => form_params,
185
+ :body => post_body,
186
+ :auth_names => auth_names,
187
+ :return_type => 'ObjectDetectionResult')
188
+ if @api_client.config.debugging
189
+ @api_client.config.logger.debug "API called: RecognizeApi#recognize_detect_objects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
190
+ end
191
+ return data, status_code, headers
192
+ end
193
+
194
+ # Detect people, including locations, in an image
195
+ # Identify the position, and size of human people in an image, along with a recognition confidence level. People in the image do NOT need to be facing the camera; they can be facing away, edge-on, etc.
196
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
197
+ # @param [Hash] opts the optional parameters
198
+ # @return [ObjectDetectionResult]
199
+ def recognize_detect_people(image_file, opts = {})
200
+ data, _status_code, _headers = recognize_detect_people_with_http_info(image_file, opts)
201
+ return data
202
+ end
203
+
204
+ # Detect people, including locations, in an image
205
+ # Identify the position, and size of human people in an image, along with a recognition confidence level. People in the image do NOT need to be facing the camera; they can be facing away, edge-on, etc.
206
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
207
+ # @param [Hash] opts the optional parameters
208
+ # @return [Array<(ObjectDetectionResult, Fixnum, Hash)>] ObjectDetectionResult data, response status code and response headers
209
+ def recognize_detect_people_with_http_info(image_file, opts = {})
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug "Calling API: RecognizeApi.recognize_detect_people ..."
212
+ end
213
+ # verify the required parameter 'image_file' is set
214
+ if @api_client.config.client_side_validation && image_file.nil?
215
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling RecognizeApi.recognize_detect_people"
216
+ end
217
+ # resource path
218
+ local_var_path = "/image/recognize/detect-people"
219
+
220
+ # query parameters
221
+ query_params = {}
222
+
223
+ # header parameters
224
+ header_params = {}
225
+ # HTTP header 'Accept' (if needed)
226
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
227
+ # HTTP header 'Content-Type'
228
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
229
+
230
+ # form parameters
231
+ form_params = {}
232
+ form_params["imageFile"] = image_file
233
+
234
+ # http body (model)
235
+ post_body = nil
236
+ auth_names = ['Apikey']
237
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
238
+ :header_params => header_params,
239
+ :query_params => query_params,
240
+ :form_params => form_params,
241
+ :body => post_body,
242
+ :auth_names => auth_names,
243
+ :return_type => 'ObjectDetectionResult')
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug "API called: RecognizeApi#recognize_detect_people\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
246
+ end
247
+ return data, status_code, headers
248
+ end
249
+
250
+ # Detect vehicle license plates in an image
251
+ # Identify the position, and size, and content of vehicle license plates in an image. License plates should be within 15-20 degrees on-axis to the camera.
252
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
253
+ # @param [Hash] opts the optional parameters
254
+ # @return [VehicleLicensePlateDetectionResult]
255
+ def recognize_detect_vehicle_license_plates(image_file, opts = {})
256
+ data, _status_code, _headers = recognize_detect_vehicle_license_plates_with_http_info(image_file, opts)
257
+ return data
258
+ end
259
+
260
+ # Detect vehicle license plates in an image
261
+ # Identify the position, and size, and content of vehicle license plates in an image. License plates should be within 15-20 degrees on-axis to the camera.
262
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
263
+ # @param [Hash] opts the optional parameters
264
+ # @return [Array<(VehicleLicensePlateDetectionResult, Fixnum, Hash)>] VehicleLicensePlateDetectionResult data, response status code and response headers
265
+ def recognize_detect_vehicle_license_plates_with_http_info(image_file, opts = {})
266
+ if @api_client.config.debugging
267
+ @api_client.config.logger.debug "Calling API: RecognizeApi.recognize_detect_vehicle_license_plates ..."
268
+ end
269
+ # verify the required parameter 'image_file' is set
270
+ if @api_client.config.client_side_validation && image_file.nil?
271
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling RecognizeApi.recognize_detect_vehicle_license_plates"
272
+ end
273
+ # resource path
274
+ local_var_path = "/image/recognize/detect-vehicle-license-plates"
275
+
276
+ # query parameters
277
+ query_params = {}
278
+
279
+ # header parameters
280
+ header_params = {}
281
+ # HTTP header 'Accept' (if needed)
282
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
283
+ # HTTP header 'Content-Type'
284
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
285
+
286
+ # form parameters
287
+ form_params = {}
288
+ form_params["imageFile"] = image_file
289
+
290
+ # http body (model)
291
+ post_body = nil
292
+ auth_names = ['Apikey']
293
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
294
+ :header_params => header_params,
295
+ :query_params => query_params,
296
+ :form_params => form_params,
297
+ :body => post_body,
298
+ :auth_names => auth_names,
299
+ :return_type => 'VehicleLicensePlateDetectionResult')
300
+ if @api_client.config.debugging
301
+ @api_client.config.logger.debug "API called: RecognizeApi#recognize_detect_vehicle_license_plates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
302
+ end
303
+ return data, status_code, headers
304
+ end
305
+ end
306
+ end