scnnr 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +14 -1
- data/lib/scnnr/client.rb +1 -1
- data/lib/scnnr/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1cec0a043ac50cceb01a1e2e0cea9f38db142653
|
|
4
|
+
data.tar.gz: 5bdc4a14a1e77bcac1e5e8e2b712f99571581372
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4fcde62832a6b3c1417ae828738940d0b595034475b4c4b669ab8aacb5970036a1b625dad9f8422b2bbeea0f1f8dfe7451be33f0d2949d747f8bc6d397c56219
|
|
7
|
+
data.tar.gz: 3c0641f3d67462a5f01b701539c5f7ac5582d8a5d33f005135e5997c6f74a2445d0f9efe735f940bbbdbf5727f2e7dff4825c2659a0195495c3a70898e33c01d
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [1.2.0] - 2018-10-11
|
|
8
|
+
### Added
|
|
9
|
+
- Support `target` parameter for `Scnnr::Client#coordinate`.
|
|
10
|
+
|
|
7
11
|
## [1.1.1] - 2018-06-20
|
|
8
12
|
### Added
|
|
9
13
|
- Support `force` parameter for `Scnnr::Client#recognize_url`.
|
data/README.md
CHANGED
|
@@ -4,17 +4,21 @@
|
|
|
4
4
|
- [API Documentation](https://api.scnnr.cubki.jp/v1/docs)
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
|
+
|
|
7
8
|
### Bundler
|
|
9
|
+
|
|
8
10
|
```
|
|
9
11
|
gem 'scnnr'
|
|
10
12
|
```
|
|
11
13
|
|
|
12
14
|
### Manual
|
|
15
|
+
|
|
13
16
|
```
|
|
14
17
|
gem install scnnr
|
|
15
18
|
```
|
|
16
19
|
|
|
17
20
|
## Configuration
|
|
21
|
+
|
|
18
22
|
You can pass configuration options as a block to `Scnnr::Client.new`.
|
|
19
23
|
|
|
20
24
|
```
|
|
@@ -35,6 +39,8 @@ end
|
|
|
35
39
|
|
|
36
40
|
Request image recognition by an image URL.
|
|
37
41
|
|
|
42
|
+
Refer: [`POST /v1/remote/recognitions`](https://api.scnnr.cubki.jp/v1/docs#tag/remoterecognitions%2Fpaths%2F~1remote~1recognitions%2Fpost)
|
|
43
|
+
|
|
38
44
|
```
|
|
39
45
|
url = 'https://example.com/dummy.jpg'
|
|
40
46
|
recognition = client.recognize_url(url)
|
|
@@ -45,6 +51,8 @@ recognition = client.recognize_url(url, timeout: 10)
|
|
|
45
51
|
|
|
46
52
|
Request image recognition by a binary image.
|
|
47
53
|
|
|
54
|
+
Refer: [`POST /v1/recognitions`](https://api.scnnr.cubki.jp/v1/docs#tag/recognitions%2Fpaths%2F~1recognitions%2Fpost)
|
|
55
|
+
|
|
48
56
|
```
|
|
49
57
|
img = File.open('dummy_image_file', 'rb')
|
|
50
58
|
recognition = client.recognize_image(img)
|
|
@@ -127,6 +135,8 @@ If the timeout value is zero or `nil`, you will get `Recognition` instance whose
|
|
|
127
135
|
|
|
128
136
|
Then you can fetch the recognition result using `Scnnr::Client#fetch`.
|
|
129
137
|
|
|
138
|
+
Refer: [`GET /v1/recognitions/*`](https://api.scnnr.cubki.jp/v1/docs#tag/recognitions%2Fpaths%2F~1recognitions~1*%2Fget)
|
|
139
|
+
|
|
130
140
|
```
|
|
131
141
|
recognition.queued?
|
|
132
142
|
=> true
|
|
@@ -143,8 +153,11 @@ recognition.finished?
|
|
|
143
153
|
|
|
144
154
|
Request fashion coordinates generation.
|
|
145
155
|
|
|
156
|
+
Refer: [`POST /v1/coordinates`](https://api.scnnr.cubki.jp/v1/docs#tag/coordinates%2Fpaths%2F~1coordinates%2Fpost)
|
|
157
|
+
|
|
146
158
|
```
|
|
147
|
-
|
|
159
|
+
tastes = { casual: 0.7, girly: 0.3 }
|
|
160
|
+
coordinate = client.coordinate('tops', ['グレー', 'パーカー'], tastes, target: 3)
|
|
148
161
|
|
|
149
162
|
coordinate.to_h
|
|
150
163
|
=> {"items"=>
|
data/lib/scnnr/client.rb
CHANGED
|
@@ -45,7 +45,7 @@ module Scnnr
|
|
|
45
45
|
|
|
46
46
|
def coordinate(category, labels, taste = {}, options = {})
|
|
47
47
|
options = merge_options options
|
|
48
|
-
uri = construct_uri('coordinates', %i[], options)
|
|
48
|
+
uri = construct_uri('coordinates', %i[target], options)
|
|
49
49
|
payload = {
|
|
50
50
|
item: { category: category, labels: labels },
|
|
51
51
|
taste: TASTES.each_with_object({}) { |key, memo| memo[key] = taste[key] if taste[key] },
|
data/lib/scnnr/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scnnr
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- NEWROPE Co. Ltd.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-10-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
83
83
|
version: '0'
|
|
84
84
|
requirements: []
|
|
85
85
|
rubyforge_project:
|
|
86
|
-
rubygems_version: 2.6.
|
|
86
|
+
rubygems_version: 2.6.13
|
|
87
87
|
signing_key:
|
|
88
88
|
specification_version: 4
|
|
89
89
|
summary: ''
|