cloudmersive-image-recognition-api-client 2.0.3 → 2.0.4
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 +6 -4
- data/docs/CreateHandwritingRequest.md +11 -0
- data/docs/TextGenerationApi.md +63 -0
- data/lib/cloudmersive-image-recognition-api-client.rb +2 -0
- data/lib/cloudmersive-image-recognition-api-client/api/text_generation_api.rb +77 -0
- data/lib/cloudmersive-image-recognition-api-client/models/create_handwriting_request.rb +216 -0
- data/lib/cloudmersive-image-recognition-api-client/version.rb +1 -1
- data/spec/api/text_generation_api_spec.rb +47 -0
- data/spec/models/create_handwriting_request_spec.rb +59 -0
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c88ba84a26b95a36a2f5fa79ab829fd397e128521becfd2c327c2aeb7ca6a66e
|
|
4
|
+
data.tar.gz: 365759dab497fbae3626ffe13da3e8931880f5dd1705683b4056801931896096
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b532d3715ed1316177226e0690ca329c181221e693fb75ce2f47a8cc3ee430ee4e1afeafc9452219165f4fa813df44b8d91d9f442a11f1020539d755bf3c83e5
|
|
7
|
+
data.tar.gz: d78ad9f4461698c1fe60e29a86d838e7e576091a7e30320b66979f2338f42d8246edfe0459a256c7a4246b75712d7cab1626eef09117cfee97d47e1b76a6d8f8
|
data/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Image Recognition and Processing APIs let you use Machine Learning to recognize
|
|
|
7
7
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
|
8
8
|
|
|
9
9
|
- API version: v1
|
|
10
|
-
- Package version: 2.0.
|
|
10
|
+
- Package version: 2.0.4
|
|
11
11
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
@@ -23,15 +23,15 @@ gem build cloudmersive-image-recognition-api-client.gemspec
|
|
|
23
23
|
Then either install the gem locally:
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
|
-
gem install ./cloudmersive-image-recognition-api-client-2.0.
|
|
26
|
+
gem install ./cloudmersive-image-recognition-api-client-2.0.4.gem
|
|
27
27
|
```
|
|
28
|
-
(for development, run `gem install --dev ./cloudmersive-image-recognition-api-client-2.0.
|
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-image-recognition-api-client-2.0.4.gem` to install the development dependencies)
|
|
29
29
|
|
|
30
30
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
|
31
31
|
|
|
32
32
|
Finally add this to the Gemfile:
|
|
33
33
|
|
|
34
|
-
gem 'cloudmersive-image-recognition-api-client', '~> 2.0.
|
|
34
|
+
gem 'cloudmersive-image-recognition-api-client', '~> 2.0.4'
|
|
35
35
|
|
|
36
36
|
### Install from Git
|
|
37
37
|
|
|
@@ -135,12 +135,14 @@ Class | Method | HTTP request | Description
|
|
|
135
135
|
*CloudmersiveImageRecognitionApiClient::RecognizeApi* | [**recognize_find_symbol**](docs/RecognizeApi.md#recognize_find_symbol) | **POST** /image/recognize/find/symbol | Find the location of a symbol in an image
|
|
136
136
|
*CloudmersiveImageRecognitionApiClient::ResizeApi* | [**resize_post**](docs/ResizeApi.md#resize_post) | **POST** /image/resize/preserveAspectRatio/{maxWidth}/{maxHeight} | Resize an image while preserving aspect ratio
|
|
137
137
|
*CloudmersiveImageRecognitionApiClient::ResizeApi* | [**resize_resize_simple**](docs/ResizeApi.md#resize_resize_simple) | **POST** /image/resize/target/{width}/{height} | Resize an image
|
|
138
|
+
*CloudmersiveImageRecognitionApiClient::TextGenerationApi* | [**text_generation_create_handwriting_png**](docs/TextGenerationApi.md#text_generation_create_handwriting_png) | **POST** /image/text/create/handwriting/png | Create an image of handwriting in PNG format
|
|
138
139
|
|
|
139
140
|
|
|
140
141
|
## Documentation for Models
|
|
141
142
|
|
|
142
143
|
- [CloudmersiveImageRecognitionApiClient::AgeDetectionResult](docs/AgeDetectionResult.md)
|
|
143
144
|
- [CloudmersiveImageRecognitionApiClient::ColorResult](docs/ColorResult.md)
|
|
145
|
+
- [CloudmersiveImageRecognitionApiClient::CreateHandwritingRequest](docs/CreateHandwritingRequest.md)
|
|
144
146
|
- [CloudmersiveImageRecognitionApiClient::DetectedLicensePlate](docs/DetectedLicensePlate.md)
|
|
145
147
|
- [CloudmersiveImageRecognitionApiClient::DetectedObject](docs/DetectedObject.md)
|
|
146
148
|
- [CloudmersiveImageRecognitionApiClient::DominantColorResult](docs/DominantColorResult.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# CloudmersiveImageRecognitionApiClient::CreateHandwritingRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**text_input** | **String** | Text to convert to handwriting | [optional]
|
|
7
|
+
**target_width** | **Integer** | Desired width in pixels of the resulting image | [optional]
|
|
8
|
+
**stroke_width** | **Integer** | Optinoal; Width of the text stroke in pixels; default is 2 | [optional]
|
|
9
|
+
**color** | **String** | HTML hexadecimal color, or HTML common color name (e.g. 'black', 'red'), for the handwriting | [optional]
|
|
10
|
+
|
|
11
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# CloudmersiveImageRecognitionApiClient::TextGenerationApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.cloudmersive.com*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**text_generation_create_handwriting_png**](TextGenerationApi.md#text_generation_create_handwriting_png) | **POST** /image/text/create/handwriting/png | Create an image of handwriting in PNG format
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# **text_generation_create_handwriting_png**
|
|
11
|
+
> Object text_generation_create_handwriting_png(request)
|
|
12
|
+
|
|
13
|
+
Create an image of handwriting in PNG format
|
|
14
|
+
|
|
15
|
+
Uses Deep Learning to generate realistic handwriting and returns the result as a PNG image
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
```ruby
|
|
19
|
+
# load the gem
|
|
20
|
+
require 'cloudmersive-image-recognition-api-client'
|
|
21
|
+
# setup authorization
|
|
22
|
+
CloudmersiveImageRecognitionApiClient.configure do |config|
|
|
23
|
+
# Configure API key authorization: Apikey
|
|
24
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
|
25
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
26
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
api_instance = CloudmersiveImageRecognitionApiClient::TextGenerationApi.new
|
|
30
|
+
|
|
31
|
+
request = CloudmersiveImageRecognitionApiClient::CreateHandwritingRequest.new # CreateHandwritingRequest | Draw text parameters
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
begin
|
|
35
|
+
#Create an image of handwriting in PNG format
|
|
36
|
+
result = api_instance.text_generation_create_handwriting_png(request)
|
|
37
|
+
p result
|
|
38
|
+
rescue CloudmersiveImageRecognitionApiClient::ApiError => e
|
|
39
|
+
puts "Exception when calling TextGenerationApi->text_generation_create_handwriting_png: #{e}"
|
|
40
|
+
end
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Parameters
|
|
44
|
+
|
|
45
|
+
Name | Type | Description | Notes
|
|
46
|
+
------------- | ------------- | ------------- | -------------
|
|
47
|
+
**request** | [**CreateHandwritingRequest**](CreateHandwritingRequest.md)| Draw text parameters |
|
|
48
|
+
|
|
49
|
+
### Return type
|
|
50
|
+
|
|
51
|
+
**Object**
|
|
52
|
+
|
|
53
|
+
### Authorization
|
|
54
|
+
|
|
55
|
+
[Apikey](../README.md#Apikey)
|
|
56
|
+
|
|
57
|
+
### HTTP request headers
|
|
58
|
+
|
|
59
|
+
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
|
60
|
+
- **Accept**: application/octet-stream
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
@@ -19,6 +19,7 @@ require 'cloudmersive-image-recognition-api-client/configuration'
|
|
|
19
19
|
# Models
|
|
20
20
|
require 'cloudmersive-image-recognition-api-client/models/age_detection_result'
|
|
21
21
|
require 'cloudmersive-image-recognition-api-client/models/color_result'
|
|
22
|
+
require 'cloudmersive-image-recognition-api-client/models/create_handwriting_request'
|
|
22
23
|
require 'cloudmersive-image-recognition-api-client/models/detected_license_plate'
|
|
23
24
|
require 'cloudmersive-image-recognition-api-client/models/detected_object'
|
|
24
25
|
require 'cloudmersive-image-recognition-api-client/models/dominant_color_result'
|
|
@@ -62,6 +63,7 @@ require 'cloudmersive-image-recognition-api-client/api/info_api'
|
|
|
62
63
|
require 'cloudmersive-image-recognition-api-client/api/nsfw_api'
|
|
63
64
|
require 'cloudmersive-image-recognition-api-client/api/recognize_api'
|
|
64
65
|
require 'cloudmersive-image-recognition-api-client/api/resize_api'
|
|
66
|
+
require 'cloudmersive-image-recognition-api-client/api/text_generation_api'
|
|
65
67
|
|
|
66
68
|
module CloudmersiveImageRecognitionApiClient
|
|
67
69
|
class << self
|
|
@@ -0,0 +1,77 @@
|
|
|
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 'uri'
|
|
14
|
+
|
|
15
|
+
module CloudmersiveImageRecognitionApiClient
|
|
16
|
+
class TextGenerationApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create an image of handwriting in PNG format
|
|
23
|
+
# Uses Deep Learning to generate realistic handwriting and returns the result as a PNG image
|
|
24
|
+
# @param request Draw text parameters
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [Object]
|
|
27
|
+
def text_generation_create_handwriting_png(request, opts = {})
|
|
28
|
+
data, _status_code, _headers = text_generation_create_handwriting_png_with_http_info(request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create an image of handwriting in PNG format
|
|
33
|
+
# Uses Deep Learning to generate realistic handwriting and returns the result as a PNG image
|
|
34
|
+
# @param request Draw text parameters
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
|
|
37
|
+
def text_generation_create_handwriting_png_with_http_info(request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: TextGenerationApi.text_generation_create_handwriting_png ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'request' when calling TextGenerationApi.text_generation_create_handwriting_png"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/image/text/create/handwriting/png'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
|
57
|
+
|
|
58
|
+
# form parameters
|
|
59
|
+
form_params = {}
|
|
60
|
+
|
|
61
|
+
# http body (model)
|
|
62
|
+
post_body = @api_client.object_to_http_body(request)
|
|
63
|
+
auth_names = ['Apikey']
|
|
64
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
65
|
+
:header_params => header_params,
|
|
66
|
+
:query_params => query_params,
|
|
67
|
+
:form_params => form_params,
|
|
68
|
+
:body => post_body,
|
|
69
|
+
:auth_names => auth_names,
|
|
70
|
+
:return_type => 'Object')
|
|
71
|
+
if @api_client.config.debugging
|
|
72
|
+
@api_client.config.logger.debug "API called: TextGenerationApi#text_generation_create_handwriting_png\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
73
|
+
end
|
|
74
|
+
return data, status_code, headers
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,216 @@
|
|
|
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
|
+
# Request to create a PNG of handwriting
|
|
17
|
+
class CreateHandwritingRequest
|
|
18
|
+
# Text to convert to handwriting
|
|
19
|
+
attr_accessor :text_input
|
|
20
|
+
|
|
21
|
+
# Desired width in pixels of the resulting image
|
|
22
|
+
attr_accessor :target_width
|
|
23
|
+
|
|
24
|
+
# Optinoal; Width of the text stroke in pixels; default is 2
|
|
25
|
+
attr_accessor :stroke_width
|
|
26
|
+
|
|
27
|
+
# HTML hexadecimal color, or HTML common color name (e.g. 'black', 'red'), for the handwriting
|
|
28
|
+
attr_accessor :color
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'text_input' => :'TextInput',
|
|
34
|
+
:'target_width' => :'TargetWidth',
|
|
35
|
+
:'stroke_width' => :'StrokeWidth',
|
|
36
|
+
:'color' => :'Color'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.swagger_types
|
|
42
|
+
{
|
|
43
|
+
:'text_input' => :'String',
|
|
44
|
+
:'target_width' => :'Integer',
|
|
45
|
+
:'stroke_width' => :'Integer',
|
|
46
|
+
:'color' => :'String'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
return unless attributes.is_a?(Hash)
|
|
54
|
+
|
|
55
|
+
# convert string to symbol for hash key
|
|
56
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
57
|
+
|
|
58
|
+
if attributes.has_key?(:'TextInput')
|
|
59
|
+
self.text_input = attributes[:'TextInput']
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
if attributes.has_key?(:'TargetWidth')
|
|
63
|
+
self.target_width = attributes[:'TargetWidth']
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
if attributes.has_key?(:'StrokeWidth')
|
|
67
|
+
self.stroke_width = attributes[:'StrokeWidth']
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
if attributes.has_key?(:'Color')
|
|
71
|
+
self.color = attributes[:'Color']
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
76
|
+
# @return Array for valid properties with the reasons
|
|
77
|
+
def list_invalid_properties
|
|
78
|
+
invalid_properties = Array.new
|
|
79
|
+
invalid_properties
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Check to see if the all the properties in the model are valid
|
|
83
|
+
# @return true if the model is valid
|
|
84
|
+
def valid?
|
|
85
|
+
true
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Checks equality by comparing each attribute.
|
|
89
|
+
# @param [Object] Object to be compared
|
|
90
|
+
def ==(o)
|
|
91
|
+
return true if self.equal?(o)
|
|
92
|
+
self.class == o.class &&
|
|
93
|
+
text_input == o.text_input &&
|
|
94
|
+
target_width == o.target_width &&
|
|
95
|
+
stroke_width == o.stroke_width &&
|
|
96
|
+
color == o.color
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# @see the `==` method
|
|
100
|
+
# @param [Object] Object to be compared
|
|
101
|
+
def eql?(o)
|
|
102
|
+
self == o
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Calculates hash code according to all attributes.
|
|
106
|
+
# @return [Fixnum] Hash code
|
|
107
|
+
def hash
|
|
108
|
+
[text_input, target_width, stroke_width, color].hash
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Builds the object from hash
|
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
113
|
+
# @return [Object] Returns the model itself
|
|
114
|
+
def build_from_hash(attributes)
|
|
115
|
+
return nil unless attributes.is_a?(Hash)
|
|
116
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
117
|
+
if type =~ /\AArray<(.*)>/i
|
|
118
|
+
# check to ensure the input is an array given that the attribute
|
|
119
|
+
# is documented as an array but the input is not
|
|
120
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
121
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
122
|
+
end
|
|
123
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
124
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
125
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
self
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Deserializes the data based on type
|
|
132
|
+
# @param string type Data type
|
|
133
|
+
# @param string value Value to be deserialized
|
|
134
|
+
# @return [Object] Deserialized data
|
|
135
|
+
def _deserialize(type, value)
|
|
136
|
+
case type.to_sym
|
|
137
|
+
when :DateTime
|
|
138
|
+
DateTime.parse(value)
|
|
139
|
+
when :Date
|
|
140
|
+
Date.parse(value)
|
|
141
|
+
when :String
|
|
142
|
+
value.to_s
|
|
143
|
+
when :Integer
|
|
144
|
+
value.to_i
|
|
145
|
+
when :Float
|
|
146
|
+
value.to_f
|
|
147
|
+
when :BOOLEAN
|
|
148
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
149
|
+
true
|
|
150
|
+
else
|
|
151
|
+
false
|
|
152
|
+
end
|
|
153
|
+
when :Object
|
|
154
|
+
# generic object (usually a Hash), return directly
|
|
155
|
+
value
|
|
156
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
157
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
158
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
159
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
160
|
+
k_type = Regexp.last_match[:k_type]
|
|
161
|
+
v_type = Regexp.last_match[:v_type]
|
|
162
|
+
{}.tap do |hash|
|
|
163
|
+
value.each do |k, v|
|
|
164
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
else # model
|
|
168
|
+
temp_model = CloudmersiveImageRecognitionApiClient.const_get(type).new
|
|
169
|
+
temp_model.build_from_hash(value)
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Returns the string representation of the object
|
|
174
|
+
# @return [String] String presentation of the object
|
|
175
|
+
def to_s
|
|
176
|
+
to_hash.to_s
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
|
181
|
+
def to_body
|
|
182
|
+
to_hash
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Returns the object in the form of hash
|
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
|
187
|
+
def to_hash
|
|
188
|
+
hash = {}
|
|
189
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
190
|
+
value = self.send(attr)
|
|
191
|
+
next if value.nil?
|
|
192
|
+
hash[param] = _to_hash(value)
|
|
193
|
+
end
|
|
194
|
+
hash
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Outputs non-array value in the form of hash
|
|
198
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
199
|
+
# @param [Object] value Any valid value
|
|
200
|
+
# @return [Hash] Returns the value in the form of hash
|
|
201
|
+
def _to_hash(value)
|
|
202
|
+
if value.is_a?(Array)
|
|
203
|
+
value.compact.map { |v| _to_hash(v) }
|
|
204
|
+
elsif value.is_a?(Hash)
|
|
205
|
+
{}.tap do |hash|
|
|
206
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
207
|
+
end
|
|
208
|
+
elsif value.respond_to? :to_hash
|
|
209
|
+
value.to_hash
|
|
210
|
+
else
|
|
211
|
+
value
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
end
|
|
216
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for CloudmersiveImageRecognitionApiClient::TextGenerationApi
|
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'TextGenerationApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = CloudmersiveImageRecognitionApiClient::TextGenerationApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of TextGenerationApi' do
|
|
30
|
+
it 'should create an instance of TextGenerationApi' do
|
|
31
|
+
expect(@instance).to be_instance_of(CloudmersiveImageRecognitionApiClient::TextGenerationApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for text_generation_create_handwriting_png
|
|
36
|
+
# Create an image of handwriting in PNG format
|
|
37
|
+
# Uses Deep Learning to generate realistic handwriting and returns the result as a PNG image
|
|
38
|
+
# @param request Draw text parameters
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [Object]
|
|
41
|
+
describe 'text_generation_create_handwriting_png test' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for CloudmersiveImageRecognitionApiClient::CreateHandwritingRequest
|
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe 'CreateHandwritingRequest' do
|
|
21
|
+
before do
|
|
22
|
+
# run before each test
|
|
23
|
+
@instance = CloudmersiveImageRecognitionApiClient::CreateHandwritingRequest.new
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
after do
|
|
27
|
+
# run after each test
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test an instance of CreateHandwritingRequest' do
|
|
31
|
+
it 'should create an instance of CreateHandwritingRequest' do
|
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveImageRecognitionApiClient::CreateHandwritingRequest)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
describe 'test attribute "text_input"' do
|
|
36
|
+
it 'should work' do
|
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
describe 'test attribute "target_width"' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
describe 'test attribute "stroke_width"' do
|
|
48
|
+
it 'should work' do
|
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
describe 'test attribute "color"' do
|
|
54
|
+
it 'should work' do
|
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cloudmersive-image-recognition-api-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cloudmersive
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-01-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -207,6 +207,7 @@ files:
|
|
|
207
207
|
- "./docs/ArtisticApi.md"
|
|
208
208
|
- "./docs/ColorResult.md"
|
|
209
209
|
- "./docs/ConvertApi.md"
|
|
210
|
+
- "./docs/CreateHandwritingRequest.md"
|
|
210
211
|
- "./docs/DetectedLicensePlate.md"
|
|
211
212
|
- "./docs/DetectedObject.md"
|
|
212
213
|
- "./docs/DominantColorResult.md"
|
|
@@ -244,6 +245,7 @@ files:
|
|
|
244
245
|
- "./docs/RecognizeApi.md"
|
|
245
246
|
- "./docs/ResizeApi.md"
|
|
246
247
|
- "./docs/TextDetectionResult.md"
|
|
248
|
+
- "./docs/TextGenerationApi.md"
|
|
247
249
|
- "./docs/TextItem.md"
|
|
248
250
|
- "./docs/VehicleLicensePlateDetectionResult.md"
|
|
249
251
|
- "./git_push.sh"
|
|
@@ -257,11 +259,13 @@ files:
|
|
|
257
259
|
- "./lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb"
|
|
258
260
|
- "./lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb"
|
|
259
261
|
- "./lib/cloudmersive-image-recognition-api-client/api/resize_api.rb"
|
|
262
|
+
- "./lib/cloudmersive-image-recognition-api-client/api/text_generation_api.rb"
|
|
260
263
|
- "./lib/cloudmersive-image-recognition-api-client/api_client.rb"
|
|
261
264
|
- "./lib/cloudmersive-image-recognition-api-client/api_error.rb"
|
|
262
265
|
- "./lib/cloudmersive-image-recognition-api-client/configuration.rb"
|
|
263
266
|
- "./lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb"
|
|
264
267
|
- "./lib/cloudmersive-image-recognition-api-client/models/color_result.rb"
|
|
268
|
+
- "./lib/cloudmersive-image-recognition-api-client/models/create_handwriting_request.rb"
|
|
265
269
|
- "./lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb"
|
|
266
270
|
- "./lib/cloudmersive-image-recognition-api-client/models/detected_object.rb"
|
|
267
271
|
- "./lib/cloudmersive-image-recognition-api-client/models/dominant_color_result.rb"
|
|
@@ -304,10 +308,12 @@ files:
|
|
|
304
308
|
- "./spec/api/nsfw_api_spec.rb"
|
|
305
309
|
- "./spec/api/recognize_api_spec.rb"
|
|
306
310
|
- "./spec/api/resize_api_spec.rb"
|
|
311
|
+
- "./spec/api/text_generation_api_spec.rb"
|
|
307
312
|
- "./spec/api_client_spec.rb"
|
|
308
313
|
- "./spec/configuration_spec.rb"
|
|
309
314
|
- "./spec/models/age_detection_result_spec.rb"
|
|
310
315
|
- "./spec/models/color_result_spec.rb"
|
|
316
|
+
- "./spec/models/create_handwriting_request_spec.rb"
|
|
311
317
|
- "./spec/models/detected_license_plate_spec.rb"
|
|
312
318
|
- "./spec/models/detected_object_spec.rb"
|
|
313
319
|
- "./spec/models/dominant_color_result_spec.rb"
|