ditto_api 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ditto.rb +1 -0
- data/lib/ditto/image.rb +16 -0
- data/lib/ditto/label.rb +21 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98a534ece7b3755ba8c9f8cf2055f178dbfe10d1
|
4
|
+
data.tar.gz: 14e9f5a8fc8bb1031587507b39a4ac321eecaf83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c23013234f503e258c215127074f2a14a093fac05403ac3dbd3c017e06d78cffb793d91dd9cdd529b18bddf17833b8f8bac8b27143b088fef8a3508e9f7fe57
|
7
|
+
data.tar.gz: 86ffd6fdde77e87e4967262ecf95fc0bf14cb895e930d2d178d4f0988b0f7b4cb66ace749aeedc6af4b3f39aa277bd327e591128a7c3d6e4a57dc46a1d6bdb15
|
data/lib/ditto.rb
CHANGED
data/lib/ditto/image.rb
CHANGED
@@ -22,6 +22,10 @@ module Ditto
|
|
22
22
|
data[:image_height]
|
23
23
|
end
|
24
24
|
|
25
|
+
def label_confidence_threshold
|
26
|
+
attributes[:confidence_threshold]
|
27
|
+
end
|
28
|
+
|
25
29
|
def faces
|
26
30
|
faces_array.map { |face| Face.new(face) }
|
27
31
|
end
|
@@ -34,6 +38,10 @@ module Ditto
|
|
34
38
|
data[:matches].map { |logo| Logo.new(logo) }
|
35
39
|
end
|
36
40
|
|
41
|
+
def labels
|
42
|
+
labels_array.map { |label| Label.new(label) }
|
43
|
+
end
|
44
|
+
|
37
45
|
private
|
38
46
|
|
39
47
|
def data
|
@@ -47,5 +55,13 @@ module Ditto
|
|
47
55
|
def moods_array
|
48
56
|
data[:moods] || []
|
49
57
|
end
|
58
|
+
|
59
|
+
def attributes
|
60
|
+
data[:attributes] || {}
|
61
|
+
end
|
62
|
+
|
63
|
+
def labels_array
|
64
|
+
data[:attributes].nil? ? [] : data[:attributes][:labels]
|
65
|
+
end
|
50
66
|
end
|
51
67
|
end
|
data/lib/ditto/label.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ditto_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Sheehan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- lib/ditto/error.rb
|
50
50
|
- lib/ditto/face.rb
|
51
51
|
- lib/ditto/image.rb
|
52
|
+
- lib/ditto/label.rb
|
52
53
|
- lib/ditto/logo.rb
|
53
54
|
- lib/ditto/mood.rb
|
54
55
|
homepage:
|
@@ -71,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
72
|
version: '0'
|
72
73
|
requirements: []
|
73
74
|
rubyforge_project:
|
74
|
-
rubygems_version: 2.
|
75
|
+
rubygems_version: 2.5.1
|
75
76
|
signing_key:
|
76
77
|
specification_version: 4
|
77
78
|
summary: A Ruby interface to the Ditto Photo Reader API.
|