scaleapi 0.1.0 → 0.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/README.md +2 -1
- data/lib/scale.rb +10 -0
- data/lib/scale/api/task_list.rb +4 -0
- data/lib/scale/api/tasks/image_recognition.rb +4 -2
- data/lib/scale/api/tasks/lineannotation.rb +28 -0
- data/lib/scale/api/tasks/polygonannotation.rb +28 -0
- data/scaleapi-ruby.gemspec +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c70f03137d4fe1b30b139f845d0d270b987cde3
|
4
|
+
data.tar.gz: 2d2406d189a74f98ba29279d91184564e6be526e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d115f9f2adfc8d5c2ed9ad52c5b527551443a03050a240ecf06a2e7101564f116439ed37ac3d5876c03e38bc01de95ba1788ebfaabfc84a3e07524a6bf4468ad
|
7
|
+
data.tar.gz: 6dfac25ce29cd374946dc8450f5fc766c58c7f203eddbcfe01a81e55728b4aed3d55aa26ed26ecd7751e51f8b7716b4064cb68cad6a198ac3800e6dad74b65f6
|
data/README.md
CHANGED
@@ -567,7 +567,8 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/scalea
|
|
567
567
|
|
568
568
|
Currently, this repository has no tests - and adding tests using RSpec would make a for a great PR :)
|
569
569
|
|
570
|
+
Thanks to [wikiti](https://github.com/wikiti/) for creating the first unofficial Scale API Ruby Client!
|
571
|
+
|
570
572
|
## License
|
571
573
|
|
572
574
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
573
|
-
|
data/lib/scale.rb
CHANGED
@@ -48,6 +48,14 @@ class Scale
|
|
48
48
|
Api::Tasks::ImageRecognition.create(args.merge(client: client))
|
49
49
|
end
|
50
50
|
|
51
|
+
def create_polygonannotation_task(args = {})
|
52
|
+
Api::Tasks::Polygonannotation.create(args.merge(client: client))
|
53
|
+
end
|
54
|
+
|
55
|
+
def create_lineannotation_task(args = {})
|
56
|
+
Api::Tasks::Lineannotation.create(args.merge(client: client))
|
57
|
+
end
|
58
|
+
|
51
59
|
def create_phone_call_task(args = {})
|
52
60
|
Api::Tasks::PhoneCall.create(args.merge(client: client))
|
53
61
|
end
|
@@ -89,6 +97,8 @@ require 'scale/api/tasks/datacollection'
|
|
89
97
|
require 'scale/api/tasks/categorization'
|
90
98
|
require 'scale/api/tasks/comparison'
|
91
99
|
require 'scale/api/tasks/image_recognition'
|
100
|
+
require 'scale/api/tasks/polygonannotation'
|
101
|
+
require 'scale/api/tasks/lineannotation'
|
92
102
|
require 'scale/api/tasks/phone_call'
|
93
103
|
require 'scale/api/tasks/transcription'
|
94
104
|
require 'scale/api/task_list'
|
data/lib/scale/api/task_list.rb
CHANGED
@@ -4,6 +4,8 @@ require 'scale/api/tasks/datacollection'
|
|
4
4
|
require 'scale/api/tasks/categorization'
|
5
5
|
require 'scale/api/tasks/comparison'
|
6
6
|
require 'scale/api/tasks/image_recognition'
|
7
|
+
require 'scale/api/tasks/polygonannotation'
|
8
|
+
require 'scale/api/tasks/lineannotation'
|
7
9
|
require 'scale/api/tasks/phone_call'
|
8
10
|
require 'scale/api/tasks/transcription'
|
9
11
|
|
@@ -20,6 +22,8 @@ class Scale
|
|
20
22
|
'comparison' => ::Scale::Api::Tasks::Comparison,
|
21
23
|
'datacollection' => ::Scale::Api::Tasks::Datacollection,
|
22
24
|
'annotation' => ::Scale::Api::Tasks::ImageRecognition,
|
25
|
+
'polygonannotation' => ::Scale::Api::Tasks::Polygonannotation,
|
26
|
+
'lineannotation' => ::Scale::Api::Tasks::Lineannotation,
|
23
27
|
'phonecall' => ::Scale::Api::Tasks::PhoneCall,
|
24
28
|
'transcription' => ::Scale::Api::Tasks::Transcription
|
25
29
|
}.freeze
|
@@ -7,7 +7,7 @@ class Scale
|
|
7
7
|
class ImageRecognition < Scale::Api::Tasks::BaseTask
|
8
8
|
CREATE_PATH = 'task/annotation'.freeze
|
9
9
|
|
10
|
-
def self.create(callback_url: nil, instruction: nil, attachment_type: nil, attachment: null, objects_to_annotate: [], with_labels: false, examples: [], urgency: 'day', metadata: {}, client: nil)
|
10
|
+
def self.create(callback_url: nil, instruction: nil, attachment_type: nil, attachment: null, objects_to_annotate: [], with_labels: false, min_width: nil, min_height: nil, examples: [], urgency: 'day', metadata: {}, client: nil)
|
11
11
|
response = client.post(CREATE_PATH, {
|
12
12
|
callback_url: callback_url,
|
13
13
|
instruction: instruction,
|
@@ -15,6 +15,8 @@ class Scale
|
|
15
15
|
attachment: attachment,
|
16
16
|
objects_to_annotate: objects_to_annotate,
|
17
17
|
with_labels: with_labels,
|
18
|
+
min_width: min_width,
|
19
|
+
min_height: min_height,
|
18
20
|
examples: examples,
|
19
21
|
urgency: urgency,
|
20
22
|
metadata: metadata
|
@@ -25,4 +27,4 @@ class Scale
|
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
28
|
-
end
|
30
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'scale/api/tasks/base_task'
|
3
|
+
|
4
|
+
class Scale
|
5
|
+
class Api
|
6
|
+
class Tasks
|
7
|
+
class Lineannotation < Scale::Api::Tasks::BaseTask
|
8
|
+
CREATE_PATH = 'task/lineannotation'.freeze
|
9
|
+
|
10
|
+
def self.create(callback_url: nil, instruction: nil, attachment_type: nil, attachment: null, objects_to_annotate: [], with_labels: false, examples: [], urgency: 'day', metadata: {}, client: nil)
|
11
|
+
response = client.post(CREATE_PATH, {
|
12
|
+
callback_url: callback_url,
|
13
|
+
instruction: instruction,
|
14
|
+
attachment_type: attachment_type,
|
15
|
+
attachment: attachment,
|
16
|
+
objects_to_annotate: objects_to_annotate,
|
17
|
+
with_labels: with_labels,
|
18
|
+
examples: examples,
|
19
|
+
urgency: urgency,
|
20
|
+
metadata: metadata
|
21
|
+
})
|
22
|
+
|
23
|
+
Lineannotation.new(JSON.parse(response.body))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'scale/api/tasks/base_task'
|
3
|
+
|
4
|
+
class Scale
|
5
|
+
class Api
|
6
|
+
class Tasks
|
7
|
+
class Polygonannotation < Scale::Api::Tasks::BaseTask
|
8
|
+
CREATE_PATH = 'task/polygonannotation'.freeze
|
9
|
+
|
10
|
+
def self.create(callback_url: nil, instruction: nil, attachment_type: nil, attachment: null, objects_to_annotate: [], with_labels: false, examples: [], urgency: 'day', metadata: {}, client: nil)
|
11
|
+
response = client.post(CREATE_PATH, {
|
12
|
+
callback_url: callback_url,
|
13
|
+
instruction: instruction,
|
14
|
+
attachment_type: attachment_type,
|
15
|
+
attachment: attachment,
|
16
|
+
objects_to_annotate: objects_to_annotate,
|
17
|
+
with_labels: with_labels,
|
18
|
+
examples: examples,
|
19
|
+
urgency: urgency,
|
20
|
+
metadata: metadata
|
21
|
+
})
|
22
|
+
|
23
|
+
Polygonannotation.new(JSON.parse(response.body))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/scaleapi-ruby.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scaleapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandr Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -79,7 +79,9 @@ files:
|
|
79
79
|
- lib/scale/api/tasks/comparison.rb
|
80
80
|
- lib/scale/api/tasks/datacollection.rb
|
81
81
|
- lib/scale/api/tasks/image_recognition.rb
|
82
|
+
- lib/scale/api/tasks/lineannotation.rb
|
82
83
|
- lib/scale/api/tasks/phone_call.rb
|
84
|
+
- lib/scale/api/tasks/polygonannotation.rb
|
83
85
|
- lib/scale/api/tasks/transcription.rb
|
84
86
|
- scaleapi-ruby.gemspec
|
85
87
|
homepage: https://www.scaleapi.com
|