kairos-api 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +62 -0
- data/Rakefile +1 -0
- data/kairos.gemspec +33 -0
- data/lib/kairos.rb +10 -0
- data/lib/kairos/client.rb +114 -0
- data/lib/kairos/configuration.rb +43 -0
- data/lib/kairos/version.rb +3 -0
- data/spec/kairos/client_spec.rb +65 -0
- data/spec/kairos/configuration_spec.rb +28 -0
- data/spec/kairos/detect_spec.rb +51 -0
- data/spec/kairos/enroll_spec.rb +68 -0
- data/spec/kairos/gallery_list_all_spec.rb +32 -0
- data/spec/kairos/gallery_remove_subject_spec.rb +50 -0
- data/spec/kairos/gallery_view_spec.rb +32 -0
- data/spec/kairos/recognize_spec.rb +97 -0
- data/spec/kairos/version_spec.rb +7 -0
- data/spec/spec_helper.rb +14 -0
- data/spec/vcr/detect.yml +124 -0
- data/spec/vcr/detect_with_missing_parameters.yml +42 -0
- data/spec/vcr/detect_with_no_faces_in_image.yml +42 -0
- data/spec/vcr/enroll.yml +44 -0
- data/spec/vcr/enroll_with_invalid_image_url.yml +44 -0
- data/spec/vcr/enroll_with_missing_parameters.yml +43 -0
- data/spec/vcr/gallery_list_all.yml +39 -0
- data/spec/vcr/gallery_remove_subject.yml +43 -0
- data/spec/vcr/gallery_remove_subject_with_missing_parameters.yml +43 -0
- data/spec/vcr/gallery_remove_subject_with_unmatched_subject.yml +43 -0
- data/spec/vcr/gallery_view.yml +43 -0
- data/spec/vcr/recognize.yml +47 -0
- data/spec/vcr/recognize_with_invalid_image_url.yml +44 -0
- data/spec/vcr/recognize_with_missing_parameters.yml +44 -0
- data/spec/vcr/recognize_with_unrecognizable_image.yml +44 -0
- data/spec/vcr/recognize_with_url_and_gallery_name.yml +50 -0
- metadata +263 -0
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Kairos::Client do
|
4
|
+
|
5
|
+
describe '#enroll' do
|
6
|
+
before do
|
7
|
+
@config = {
|
8
|
+
:app_id => 'abc1234',
|
9
|
+
:app_key => 'asdfadsfasdfasdfasdf'
|
10
|
+
}
|
11
|
+
@client = Kairos::Client.new(@config)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'responds to enroll' do
|
15
|
+
@client.should respond_to(:enroll)
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'with valid credentials' do
|
19
|
+
context 'with missing parameters' do
|
20
|
+
it 'should not enroll an image' do
|
21
|
+
VCR.use_cassette('enroll_with_missing_parameters') do
|
22
|
+
response = @client.enroll(:url => 'https://some.image.url/123abc.jpg', :subject_id => 'image123abc')
|
23
|
+
response.should eq({"Errors"=>[{"ErrorCode"=>5006, "Message"=>"the following required parameter is not included: gallery_name"}]})
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
context 'with invalid image url' do
|
28
|
+
it 'should not enroll an image' do
|
29
|
+
VCR.use_cassette('enroll_with_invalid_image_url') do
|
30
|
+
response = @client.enroll(:url => 'https://some.image.url/123abc.jpg', :subject_id => 'image123abc', :gallery_name => 'randomgallery')
|
31
|
+
response.should eq({"images"=>[{"status"=>"failure", "message"=>"no face(s) found in image"}]})
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
context 'with required parameters' do
|
36
|
+
before(:each) do
|
37
|
+
VCR.use_cassette('enroll') do
|
38
|
+
@response = @client.enroll(:url => 'https://some.image.url/123abc.jpg', :subject_id => 'image123abc', :gallery_name => 'randomgallery')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
describe 'response' do
|
42
|
+
it 'contains an images array element' do
|
43
|
+
@response.first[0].should eq('images')
|
44
|
+
end
|
45
|
+
it 'contains 2 hash keys' do
|
46
|
+
@response.first[1][0].keys.should include('time','transaction')
|
47
|
+
end
|
48
|
+
it 'contains how long it took to complete the task' do
|
49
|
+
@response.first[1][0]['time'].should eq(2.02606)
|
50
|
+
end
|
51
|
+
it 'contains the status' do
|
52
|
+
@response.first[1][0]['transaction']['status'].should eq('Complete')
|
53
|
+
end
|
54
|
+
it 'contains the api assigned face_id' do
|
55
|
+
@response.first[1][0]['transaction']['face_id'].should eq('7d3a0571cb8c59d5be3fee2c19fff4a3')
|
56
|
+
end
|
57
|
+
it 'contains the subject_id you assigned' do
|
58
|
+
@response.first[1][0]['transaction']['subject_id'].should eq('image123abc')
|
59
|
+
end
|
60
|
+
it 'contains the gallery_name you assigned' do
|
61
|
+
@response.first[1][0]['transaction']['gallery_name'].should eq('randomgallery')
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Kairos::Client do
|
4
|
+
|
5
|
+
describe '#gallery_list_all' do
|
6
|
+
before do
|
7
|
+
@config = {
|
8
|
+
:app_id => 'abc1234',
|
9
|
+
:app_key => 'asdfadsfasdfasdfasdf'
|
10
|
+
}
|
11
|
+
@client = Kairos::Client.new(@config)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'responds to gallery_list_all' do
|
15
|
+
@client.should respond_to(:gallery_list_all)
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'with valid credentials' do
|
19
|
+
before(:each) do
|
20
|
+
VCR.use_cassette('gallery_list_all') do
|
21
|
+
@response = @client.gallery_list_all
|
22
|
+
end
|
23
|
+
end
|
24
|
+
describe 'response' do
|
25
|
+
it 'lists all galleries' do
|
26
|
+
@response.should eq({"time"=>0.00808, "status"=>"Complete", "gallery_ids"=>["testgallery"]})
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Kairos::Client do
|
4
|
+
|
5
|
+
describe '#gallery_remove_subject' do
|
6
|
+
before do
|
7
|
+
@config = {
|
8
|
+
:app_id => 'abc1234',
|
9
|
+
:app_key => 'asdfadsfasdfasdfasdf'
|
10
|
+
}
|
11
|
+
@client = Kairos::Client.new(@config)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'responds to recognize' do
|
15
|
+
@client.should respond_to(:gallery_remove_subject)
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'with valid credentials' do
|
19
|
+
context 'with missing parameters' do
|
20
|
+
it 'should not remove subject' do
|
21
|
+
VCR.use_cassette('gallery_remove_subject_with_missing_parameters') do
|
22
|
+
response = @client.gallery_remove_subject(:gallery_name => 'gemtest')
|
23
|
+
response.should eq({"Errors"=>[{"ErrorCode"=>5006, "Message"=>"the following required parameter is not included: subject_id"}]})
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
context 'with unmatched subject_id' do
|
28
|
+
it 'should accept any subject and try to remove it, if it exists' do
|
29
|
+
VCR.use_cassette('gallery_remove_subject_with_unmatched_subject') do
|
30
|
+
response = @client.gallery_remove_subject(:gallery_name => 'gemtest', :subject_id => 'abcdefghi')
|
31
|
+
response.should eq("INVALID_JSON: {\n\t\"status\": \"complete\",\n\t\"message\": \"subject id abcdefghi has been successfully removed }")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
context 'with required parameters' do
|
36
|
+
before(:each) do
|
37
|
+
VCR.use_cassette('gallery_remove_subject') do
|
38
|
+
@response = @client.gallery_remove_subject(:gallery_name => 'randomgallery', :subject_id => 'image123abc')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
describe 'response' do
|
42
|
+
it 'subject is removed from gallery' do
|
43
|
+
@response.should eq("INVALID_JSON: {\n\t\"status\": \"complete\",\n\t\"message\": \"subject id image123abc has been successfully removed }")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Kairos::Client do
|
4
|
+
|
5
|
+
describe '#gallery_view' do
|
6
|
+
before do
|
7
|
+
@config = {
|
8
|
+
:app_id => 'abc1234',
|
9
|
+
:app_key => 'asdfadsfasdfasdfasdf'
|
10
|
+
}
|
11
|
+
@client = Kairos::Client.new(@config)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'responds to gallery_view' do
|
15
|
+
@client.should respond_to(:gallery_view)
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'with valid credentials' do
|
19
|
+
before(:each) do
|
20
|
+
VCR.use_cassette('gallery_view') do
|
21
|
+
@response = @client.gallery_view(:gallery_name => 'testgallery')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
describe 'response' do
|
25
|
+
it 'lists all subjects in gallery' do
|
26
|
+
@response.should eq({"time"=>0.00287, "status"=>"Complete", "subject_ids"=>["gemtest", "gemtest", "gemtest", "gemtest", "gemtest", "gemtest"]})
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Kairos::Client do
|
4
|
+
|
5
|
+
describe '#recognize' do
|
6
|
+
before do
|
7
|
+
@config = {
|
8
|
+
:app_id => 'abc1234',
|
9
|
+
:app_key => 'asdfadsfasdfasdfasdf'
|
10
|
+
}
|
11
|
+
@client = Kairos::Client.new(@config)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'responds to recognize' do
|
15
|
+
@client.should respond_to(:recognize)
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'with valid credentials' do
|
19
|
+
context 'with missing parameters' do
|
20
|
+
it 'should not recognize an image' do
|
21
|
+
VCR.use_cassette('recognize_with_missing_parameters') do
|
22
|
+
response = @client.recognize(:url => 'https://some.image.url/123abc.jpg')
|
23
|
+
response.should eq({"images"=>[{"status"=>"failure", "message"=>{"errors"=>{"gallery_id"=>"gallery_id field required"}}}]})
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
context 'with invalid image url' do
|
28
|
+
it 'should not recognize an image' do
|
29
|
+
VCR.use_cassette('recognize_with_invalid_image_url') do
|
30
|
+
response = @client.recognize(:url => 'https://some.image.url/123abc.jpg', :gallery_name => 'randomgallery')
|
31
|
+
response.should eq({"images"=>[{"status"=>"failure", "message"=>"no face(s) found in image"}]})
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
context 'with only url and gallery_name parameters with unrecognizable image' do
|
36
|
+
before(:each) do
|
37
|
+
VCR.use_cassette('recognize_with_unrecognizable_image') do
|
38
|
+
@response = @client.recognize(:url => 'http://upload.wikimedia.org/wikipedia/commons/f/f9/Obama_portrait_crop.jpg', :gallery_name => 'randomgallery')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
describe 'response' do
|
42
|
+
it 'should not recognize an image' do
|
43
|
+
@response.should eq("INVALID_JSON: {\n\t\"images\": [\n\t\t{\n\t\t\t\"transaction\": {\n\t\t\t\t\"status\": \"failure\",\n\t\t\t\t\"message\": \"No match found\",\n\t\t\t\t\"subject\": image123abc,\n\t\t\t\t\"confidence\": 0.56,\n\t\t\t\t\"threshold\": 0.8\n\t\t\t}\n\t\t}\n\t]\n}")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
context 'with only url and gallery_name parameters' do
|
48
|
+
before(:each) do
|
49
|
+
VCR.use_cassette('recognize_with_url_and_gallery_name') do
|
50
|
+
@response = @client.recognize(:url => 'https://some.image.url/123abc.jpg', :gallery_name => 'randomgallery')
|
51
|
+
end
|
52
|
+
end
|
53
|
+
describe 'response' do
|
54
|
+
it 'successfully recognizes an image' do
|
55
|
+
@response.first[1][0]['transaction']['status'].should eq('success')
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
context 'with required parameters' do
|
60
|
+
before(:each) do
|
61
|
+
VCR.use_cassette('recognize') do
|
62
|
+
@response = @client.recognize(:url => 'https://some.image.url/123abc.jpg', :gallery_name => 'randomgallery', :threshold => '.2', :max_num_results => '5')
|
63
|
+
end
|
64
|
+
end
|
65
|
+
describe 'response' do
|
66
|
+
it 'contains an images array element' do
|
67
|
+
@response.first[0].should eq('images')
|
68
|
+
end
|
69
|
+
it 'contains 3 hash keys' do
|
70
|
+
@response.first[1][0].keys.should include('time','transaction','candidates')
|
71
|
+
end
|
72
|
+
it 'contains how long it took to complete the task' do
|
73
|
+
@response.first[1][0]['time'].should eq(2.02489)
|
74
|
+
end
|
75
|
+
it 'contains the status' do
|
76
|
+
@response.first[1][0]['transaction']['status'].should eq('success')
|
77
|
+
end
|
78
|
+
it 'contains the api assigned face_id' do
|
79
|
+
@response.first[1][0]['transaction']['face_id'].should eq('cc9424ff049026675b9f1ecccec2c076')
|
80
|
+
end
|
81
|
+
it 'contains the subject_id you assigned' do
|
82
|
+
@response.first[1][0]['transaction']['subject'].should eq('image123abc')
|
83
|
+
end
|
84
|
+
it 'contains the gallery_name you assigned' do
|
85
|
+
@response.first[1][0]['transaction']['gallery_name'].should eq('randomgallery')
|
86
|
+
end
|
87
|
+
it 'contains possible other candidates' do
|
88
|
+
@response.first[1][0]['candidates'].size.should eq(5)
|
89
|
+
@response.first[1][0]['candidates'].class.should eq(Array)
|
90
|
+
@response.first[1][0]['candidates'].should eq([{"image456abc"=>"1"}, {"image789abc"=>"2"}, {"image012abc"=>"3"}, {"image345abc"=>"4"}, {"image678abc"=>"5"}])
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'kairos'
|
2
|
+
require 'rspec'
|
3
|
+
require 'vcr'
|
4
|
+
|
5
|
+
# Configure rspec options
|
6
|
+
RSpec.configure do |config|
|
7
|
+
#config.mock_framework = :mocha
|
8
|
+
end
|
9
|
+
|
10
|
+
VCR.configure do |c|
|
11
|
+
c.hook_into :webmock
|
12
|
+
c.cassette_library_dir = "spec/vcr"
|
13
|
+
c.allow_http_connections_when_no_cassette = false
|
14
|
+
end
|
data/spec/vcr/detect.yml
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://api.kairos.io/detect
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"url":"http://www.history.com/s3static/video-thumbnails/AETN-History_Prod/24/226/History_First_Combat_By_Black_Pilots_Speech_SF_still_624x352.jpg","selector":"FULL"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.9
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
App-Id:
|
15
|
+
- abc1234
|
16
|
+
App-Key:
|
17
|
+
- asdfadsfasdfasdfasdf
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
Accept:
|
21
|
+
- "*/*"
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- ngx_openresty/1.2.8.6
|
29
|
+
Date:
|
30
|
+
- Sat, 19 Jul 2014 16:05:05 GMT
|
31
|
+
Content-Type:
|
32
|
+
- text/html; charset=UTF-8
|
33
|
+
Content-Length:
|
34
|
+
- '6620'
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
body:
|
38
|
+
encoding: UTF-8
|
39
|
+
string: "{\n\t\"images\": [\n\t\t{\n\t\t\t\"time\": 3.28787,\n\t\t\t\"status\":
|
40
|
+
\"Complete\",\n\t\t\t\"file\": \"http:\\/\\/www.history.com\\/s3static\\/video-thumbnails\\/AETN-History_Prod\\/24\\/226\\/History_First_Combat_By_Black_Pilots_Speech_SF_still_624x352.jpg\",\n\t\t\t\"width\":
|
41
|
+
624,\n\t\t\t\"height\": 352,\n\t\t\t\"faces\": [\n\t\t\t\t{\n\t\t\t\t\t\"topLeftX\":
|
42
|
+
428,\n\t\t\t\t\t\"topLeftY\": 54,\n\t\t\t\t\t\"width\": 74,\n\t\t\t\t\t\"height\":
|
43
|
+
74,\n\t\t\t\t\t\"leftEyeCenterX\": 453.28333333333,\n\t\t\t\t\t\"leftEyeCenterY\":
|
44
|
+
84.216666666667,\n\t\t\t\t\t\"rightEyeCenterX\": 477.95,\n\t\t\t\t\t\"rightEyeCenterY\":
|
45
|
+
77.125,\n\t\t\t\t\t\"noseTipX\": 464.41128389334,\n\t\t\t\t\t\"noseTipY\":
|
46
|
+
97.543807447067,\n\t\t\t\t\t\"noseBtwEyesX\": 462.93953972625,\n\t\t\t\t\t\"noseBtwEyesY\":
|
47
|
+
81.08648394164,\n\t\t\t\t\t\"chinTipX\": 478.58984310969,\n\t\t\t\t\t\"chinTipY\":
|
48
|
+
127.91363834176,\n\t\t\t\t\t\"leftEyeCornerLeftX\": 449.04375,\n\t\t\t\t\t\"leftEyeCornerLeftY\":
|
49
|
+
85.435546875,\n\t\t\t\t\t\"leftEyeCornerRightX\": 458.12994791667,\n\t\t\t\t\t\"leftEyeCornerRightY\":
|
50
|
+
83.6578125,\n\t\t\t\t\t\"rightEyeCornerLeftX\": 473.54661458333,\n\t\t\t\t\t\"rightEyeCornerLeftY\":
|
51
|
+
79.225520833333,\n\t\t\t\t\t\"rightEyeCornerRightX\": 483.73125,\n\t\t\t\t\t\"rightEyeCornerRightY\":
|
52
|
+
75.462890625,\n\t\t\t\t\t\"rightEarTragusX\": 504.41182109872,\n\t\t\t\t\t\"rightEarTragusY\":
|
53
|
+
85.76017844713,\n\t\t\t\t\t\"leftEarTragusX\": -1,\n\t\t\t\t\t\"leftEarTragusY\":
|
54
|
+
-1,\n\t\t\t\t\t\"leftEyeBrowLeftX\": 441.63314307609,\n\t\t\t\t\t\"leftEyeBrowLeftY\":
|
55
|
+
82.705854430062,\n\t\t\t\t\t\"leftEyeBrowMiddleX\": 446.30086991832,\n\t\t\t\t\t\"leftEyeBrowMiddleY\":
|
56
|
+
79.054246367575,\n\t\t\t\t\t\"leftEyeBrowRightX\": 454.52953166193,\n\t\t\t\t\t\"leftEyeBrowRightY\":
|
57
|
+
78.318374288683,\n\t\t\t\t\t\"rightEyeBrowLeftX\": 467.83281967694,\n\t\t\t\t\t\"rightEyeBrowLeftY\":
|
58
|
+
73.806501000062,\n\t\t\t\t\t\"rightEyeBrowMiddleX\": 476.97644023996,\n\t\t\t\t\t\"rightEyeBrowMiddleY\":
|
59
|
+
68.786568317925,\n\t\t\t\t\t\"rightEyeBrowRightX\": 486.67458656583,\n\t\t\t\t\t\"rightEyeBrowRightY\":
|
60
|
+
68.491315656652,\n\t\t\t\t\t\"nostrilLeftHoleBottomX\": 463.37193192656,\n\t\t\t\t\t\"nostrilLeftHoleBottomY\":
|
61
|
+
101.42096862064,\n\t\t\t\t\t\"nostrilRightHoleBottomX\": 470.53800851709,\n\t\t\t\t\t\"nostrilRightHoleBottomY\":
|
62
|
+
100.12008397689,\n\t\t\t\t\t\"nostrilLeftSideX\": 460.55735590944,\n\t\t\t\t\t\"nostrilLeftSideY\":
|
63
|
+
100.94662921507,\n\t\t\t\t\t\"nostrilRightSideX\": 474.79883593016,\n\t\t\t\t\t\"nostrilRightSideY\":
|
64
|
+
96.592869061641,\n\t\t\t\t\t\"lipCornerLeftX\": 466.09809436817,\n\t\t\t\t\t\"lipCornerLeftY\":
|
65
|
+
116.16002124809,\n\t\t\t\t\t\"lipLineMiddleX\": 472.20158580561,\n\t\t\t\t\t\"lipLineMiddleY\":
|
66
|
+
114.29412403948,\n\t\t\t\t\t\"lipCornerRightX\": 480.74647381804,\n\t\t\t\t\t\"lipCornerRightY\":
|
67
|
+
111.68186794742,\n\t\t\t\t\t\"pitch\": 3.894871137306,\n\t\t\t\t\t\"yaw\":
|
68
|
+
19.928029385591,\n\t\t\t\t\t\"roll\": -16.376846999339\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"topLeftX\":
|
69
|
+
331,\n\t\t\t\t\t\"topLeftY\": 74,\n\t\t\t\t\t\"width\": 70,\n\t\t\t\t\t\"height\":
|
70
|
+
70,\n\t\t\t\t\t\"leftEyeCenterX\": 353.75,\n\t\t\t\t\t\"leftEyeCenterY\":
|
71
|
+
97.166666666667,\n\t\t\t\t\t\"rightEyeCenterX\": 380.58333333333,\n\t\t\t\t\t\"rightEyeCenterY\":
|
72
|
+
101.54166666667,\n\t\t\t\t\t\"noseTipX\": 369.402552281,\n\t\t\t\t\t\"noseTipY\":
|
73
|
+
116.12289328391,\n\t\t\t\t\t\"noseBtwEyesX\": 368.62358703188,\n\t\t\t\t\t\"noseBtwEyesY\":
|
74
|
+
98.207841755884,\n\t\t\t\t\t\"chinTipX\": 362.98377957768,\n\t\t\t\t\t\"chinTipY\":
|
75
|
+
146.76653362108,\n\t\t\t\t\t\"leftEyeCornerLeftX\": 346.55403645833,\n\t\t\t\t\t\"leftEyeCornerLeftY\":
|
76
|
+
96.423828125,\n\t\t\t\t\t\"leftEyeCornerRightX\": 358.22526041667,\n\t\t\t\t\t\"leftEyeCornerRightY\":
|
77
|
+
98.757161458333,\n\t\t\t\t\t\"rightEyeCornerLeftX\": 374.64518229167,\n\t\t\t\t\t\"rightEyeCornerLeftY\":
|
78
|
+
101.00390625,\n\t\t\t\t\t\"rightEyeCornerRightX\": 384.77604166667,\n\t\t\t\t\t\"rightEyeCornerRightY\":
|
79
|
+
102.22526041667,\n\t\t\t\t\t\"rightEarTragusX\": -1,\n\t\t\t\t\t\"rightEarTragusY\":
|
80
|
+
-1,\n\t\t\t\t\t\"leftEarTragusX\": -1,\n\t\t\t\t\t\"leftEarTragusY\": -1,\n\t\t\t\t\t\"leftEyeBrowLeftX\":
|
81
|
+
343.72506249672,\n\t\t\t\t\t\"leftEyeBrowLeftY\": 89.824400265891,\n\t\t\t\t\t\"leftEyeBrowMiddleX\":
|
82
|
+
353.83409281874,\n\t\t\t\t\t\"leftEyeBrowMiddleY\": 89.361984115826,\n\t\t\t\t\t\"leftEyeBrowRightX\":
|
83
|
+
362.56192234923,\n\t\t\t\t\t\"leftEyeBrowRightY\": 92.366489433952,\n\t\t\t\t\t\"rightEyeBrowLeftX\":
|
84
|
+
376.85328963705,\n\t\t\t\t\t\"rightEyeBrowLeftY\": 94.751815942951,\n\t\t\t\t\t\"rightEyeBrowMiddleX\":
|
85
|
+
385.1078073733,\n\t\t\t\t\t\"rightEyeBrowMiddleY\": 94.495792729262,\n\t\t\t\t\t\"rightEyeBrowRightX\":
|
86
|
+
390.3081895317,\n\t\t\t\t\t\"rightEyeBrowRightY\": 96.567593920138,\n\t\t\t\t\t\"nostrilLeftHoleBottomX\":
|
87
|
+
362.57886559845,\n\t\t\t\t\t\"nostrilLeftHoleBottomY\": 119.3120002279,\n\t\t\t\t\t\"nostrilRightHoleBottomX\":
|
88
|
+
370.9792503321,\n\t\t\t\t\t\"nostrilRightHoleBottomY\": 121.35898628011,\n\t\t\t\t\t\"nostrilLeftSideX\":
|
89
|
+
358.00855790266,\n\t\t\t\t\t\"nostrilLeftSideY\": 115.95523496959,\n\t\t\t\t\t\"nostrilRightSideX\":
|
90
|
+
373.13639258363,\n\t\t\t\t\t\"nostrilRightSideY\": 118.9101100104,\n\t\t\t\t\t\"lipCornerLeftX\":
|
91
|
+
353.13864433023,\n\t\t\t\t\t\"lipCornerLeftY\": 131.73795937417,\n\t\t\t\t\t\"lipLineMiddleX\":
|
92
|
+
365.36910610172,\n\t\t\t\t\t\"lipLineMiddleY\": 132.4751662203,\n\t\t\t\t\t\"lipCornerRightX\":
|
93
|
+
374.33903936483,\n\t\t\t\t\t\"lipCornerRightY\": 133.68568487176,\n\t\t\t\t\t\"pitch\":
|
94
|
+
2.07513157518,\n\t\t\t\t\t\"yaw\": -17.934877012782,\n\t\t\t\t\t\"roll\":
|
95
|
+
7.5354338308672\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"topLeftX\": 516,\n\t\t\t\t\t\"topLeftY\":
|
96
|
+
34,\n\t\t\t\t\t\"width\": 96,\n\t\t\t\t\t\"height\": 96,\n\t\t\t\t\t\"leftEyeCenterX\":
|
97
|
+
547.6,\n\t\t\t\t\t\"leftEyeCenterY\": 74.4,\n\t\t\t\t\t\"rightEyeCenterX\":
|
98
|
+
580,\n\t\t\t\t\t\"rightEyeCenterY\": 64.4,\n\t\t\t\t\t\"noseTipX\": 564.23147949035,\n\t\t\t\t\t\"noseTipY\":
|
99
|
+
91.061818090372,\n\t\t\t\t\t\"noseBtwEyesX\": 559.85138496241,\n\t\t\t\t\t\"noseBtwEyesY\":
|
100
|
+
67.292694708019,\n\t\t\t\t\t\"chinTipX\": 578.72466240275,\n\t\t\t\t\t\"chinTipY\":
|
101
|
+
125.25547165783,\n\t\t\t\t\t\"leftEyeCornerLeftX\": 540.2,\n\t\t\t\t\t\"leftEyeCornerLeftY\":
|
102
|
+
75.575,\n\t\t\t\t\t\"leftEyeCornerRightX\": 552.85625,\n\t\t\t\t\t\"leftEyeCornerRightY\":
|
103
|
+
71.66875,\n\t\t\t\t\t\"rightEyeCornerLeftX\": 573.6125,\n\t\t\t\t\t\"rightEyeCornerLeftY\":
|
104
|
+
65.2625,\n\t\t\t\t\t\"rightEyeCornerRightX\": 586.1125,\n\t\t\t\t\t\"rightEyeCornerRightY\":
|
105
|
+
60.85,\n\t\t\t\t\t\"rightEarTragusX\": 614.99694573172,\n\t\t\t\t\t\"rightEarTragusY\":
|
106
|
+
75.808622428921,\n\t\t\t\t\t\"leftEarTragusX\": -1,\n\t\t\t\t\t\"leftEarTragusY\":
|
107
|
+
-1,\n\t\t\t\t\t\"leftEyeBrowLeftX\": 530.85071272266,\n\t\t\t\t\t\"leftEyeBrowLeftY\":
|
108
|
+
68.622717032231,\n\t\t\t\t\t\"leftEyeBrowMiddleX\": 538.95090117278,\n\t\t\t\t\t\"leftEyeBrowMiddleY\":
|
109
|
+
65.901227781742,\n\t\t\t\t\t\"leftEyeBrowRightX\": 551.01689547039,\n\t\t\t\t\t\"leftEyeBrowRightY\":
|
110
|
+
64.2511930865,\n\t\t\t\t\t\"rightEyeBrowLeftX\": 565.95581462711,\n\t\t\t\t\t\"rightEyeBrowLeftY\":
|
111
|
+
58.631067255059,\n\t\t\t\t\t\"rightEyeBrowMiddleX\": 578.54896562638,\n\t\t\t\t\t\"rightEyeBrowMiddleY\":
|
112
|
+
51.395189018273,\n\t\t\t\t\t\"rightEyeBrowRightX\": 591.69498505067,\n\t\t\t\t\t\"rightEyeBrowRightY\":
|
113
|
+
49.382289089633,\n\t\t\t\t\t\"nostrilLeftHoleBottomX\": 562.98287760849,\n\t\t\t\t\t\"nostrilLeftHoleBottomY\":
|
114
|
+
96.289081684756,\n\t\t\t\t\t\"nostrilRightHoleBottomX\": 572.8845363655,\n\t\t\t\t\t\"nostrilRightHoleBottomY\":
|
115
|
+
93.56330714803,\n\t\t\t\t\t\"nostrilLeftSideX\": 558.47705919767,\n\t\t\t\t\t\"nostrilLeftSideY\":
|
116
|
+
95.399059746207,\n\t\t\t\t\t\"nostrilRightSideX\": 577.5589315315,\n\t\t\t\t\t\"nostrilRightSideY\":
|
117
|
+
89.588930725593,\n\t\t\t\t\t\"lipCornerLeftX\": 563.38431042726,\n\t\t\t\t\t\"lipCornerLeftY\":
|
118
|
+
113.58233958702,\n\t\t\t\t\t\"lipLineMiddleX\": 572.38309138722,\n\t\t\t\t\t\"lipLineMiddleY\":
|
119
|
+
109.95797253927,\n\t\t\t\t\t\"lipCornerRightX\": 584.62623301446,\n\t\t\t\t\t\"lipCornerRightY\":
|
120
|
+
107.0464800996,\n\t\t\t\t\t\"pitch\": 4.2484231422416,\n\t\t\t\t\t\"yaw\":
|
121
|
+
21.926953273675,\n\t\t\t\t\t\"roll\": -17.483671086395\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}"
|
122
|
+
http_version:
|
123
|
+
recorded_at: Sat, 19 Jul 2014 16:04:56 GMT
|
124
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://api.kairos.io/detect
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"selector":"FULL"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.9
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
App-Id:
|
15
|
+
- abc1234
|
16
|
+
App-Key:
|
17
|
+
- asdfadsfasdfasdfasdf
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
Accept:
|
21
|
+
- "*/*"
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- ngx_openresty/1.2.8.6
|
29
|
+
Date:
|
30
|
+
- Sat, 19 Jul 2014 15:49:34 GMT
|
31
|
+
Content-Type:
|
32
|
+
- text/html; charset=UTF-8
|
33
|
+
Content-Length:
|
34
|
+
- '66'
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
body:
|
38
|
+
encoding: UTF-8
|
39
|
+
string: '["errors:"{"Errcode":5001,"Message":"some unknown service error"}]'
|
40
|
+
http_version:
|
41
|
+
recorded_at: Sat, 19 Jul 2014 15:49:25 GMT
|
42
|
+
recorded_with: VCR 2.9.2
|