facer 0.0.3 → 0.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.
- data/Gemfile +3 -1
- data/README.rdoc +41 -0
- data/lib/facer.rb +4 -1
- metadata +23 -8
- data/README +0 -41
data/Gemfile
CHANGED
data/README.rdoc
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
This Gem is a very alpha version and is provided as is without any warranty.
|
2
|
+
|
3
|
+
I coded it as a convenient and easy interface to face.com's API for a project I'm working on and I must prepone some assumption on using it:
|
4
|
+
|
5
|
+
* you are a brave
|
6
|
+
* you will send images with only ONE recognizable face at time
|
7
|
+
* you expect some errors and bugs and have the bravery and patience to fix them
|
8
|
+
|
9
|
+
If those requirements are met, go on and use it. If not stop reading and trash the gem...
|
10
|
+
|
11
|
+
If you are reading this you are brave (or crazy).
|
12
|
+
|
13
|
+
A little example of usage:
|
14
|
+
|
15
|
+
linkr=Facer::Linker.new("yourapp","yourkey","yoursecret")
|
16
|
+
puts linkr.account.private_namespaces?.inspect
|
17
|
+
puts linkr.account.limits?.inspect
|
18
|
+
|
19
|
+
trainSet={
|
20
|
+
"vanessa_paradis" => [
|
21
|
+
"http://www.superiorpics.com/hs/vanessa_paradis/main1.jpg",
|
22
|
+
"http://nymag.com/daily/fashion/14_paradis_lgl.jpg",
|
23
|
+
"http://imstars.aufeminin.com/stars/fan/vanessa-paradis/vanessa-paradis-20060208-107457.jpg",
|
24
|
+
"http://www.realbeauty.com/cm/realbeauty/images/NF/rby-hair-vanessa-paradis-5-de.jpg",
|
25
|
+
"http://www.wallpaperweb.org/wallpaper/babes/1280x960/vanessa_paradis_20070722_0171_1280x960.jpg",
|
26
|
+
"http://chansons-fle.wikispaces.com/file/view/vanessa_paradis_reference.jpg/59524266/vanessa_paradis_reference.jpg"
|
27
|
+
]
|
28
|
+
}
|
29
|
+
|
30
|
+
trainSet.each_pair do |key,value|
|
31
|
+
succ= linkr.faces.associate_multi(value,key,"yournamespace").inspect
|
32
|
+
puts "Associating #{key}: #{succ}"
|
33
|
+
end
|
34
|
+
|
35
|
+
puts linkr.faces.train_all("clinik").inspect
|
36
|
+
|
37
|
+
puts linkr.faces.recognize("http://static1.purepeople.com/articles/7/17/12/7/@/85769-vanessa-paradis-et-johnny-depp-637x0-1.jpg","yournamespace").inspect
|
38
|
+
puts linkr.faces.recognize("http://howzar.com/Galleries/Vanessa%20Paradis/vanessa-paradis-32.jpg","yournamespace").inspect
|
39
|
+
puts linkr.faces.recognize("http://pictures.directnews.co.uk/liveimages/Old+man+smiling_1500_19112072_0_0_7006461_300.jpg","yournamespace").inspect
|
40
|
+
|
41
|
+
Stefano Valicchia (stefano.valicchia@gmail.com)
|
data/lib/facer.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
$LOAD_PATH << './lib/facer'
|
3
3
|
require 'rubygems'
|
4
|
+
|
4
5
|
gem 'multipart-post'
|
6
|
+
gem 'mime-types'
|
7
|
+
gem 'json'
|
5
8
|
|
6
9
|
require "net/http"
|
7
10
|
require "net/http/post/multipart"
|
@@ -21,5 +24,5 @@ require "faces"
|
|
21
24
|
# Copyright:: Copyright (c) 2002 Giano
|
22
25
|
# License:: Distributes under the same terms as Ruby
|
23
26
|
module Facer
|
24
|
-
VERSION = "0.0.
|
27
|
+
VERSION = "0.0.4"
|
25
28
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: facer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stefano Valicchia
|
@@ -50,6 +50,21 @@ dependencies:
|
|
50
50
|
version: 1.4.6
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: mime-types
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 47
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 16
|
65
|
+
version: "1.16"
|
66
|
+
type: :runtime
|
67
|
+
version_requirements: *id003
|
53
68
|
description: Simple wrapper for face.com api.
|
54
69
|
email: stefano.valicchia@gmail.com
|
55
70
|
executables: []
|
@@ -59,7 +74,7 @@ extensions: []
|
|
59
74
|
extra_rdoc_files:
|
60
75
|
- Gemfile
|
61
76
|
- Manifest.txt
|
62
|
-
- README
|
77
|
+
- README.rdoc
|
63
78
|
files:
|
64
79
|
- lib/facer/account.rb
|
65
80
|
- lib/facer/faces.rb
|
@@ -69,10 +84,10 @@ files:
|
|
69
84
|
- init.rb
|
70
85
|
- Manifest.txt
|
71
86
|
- Gemfile
|
72
|
-
- README
|
87
|
+
- README.rdoc
|
73
88
|
- test/facer_test.rb
|
74
89
|
has_rdoc: true
|
75
|
-
homepage:
|
90
|
+
homepage: https://github.com/giano/FaceR
|
76
91
|
licenses: []
|
77
92
|
|
78
93
|
post_install_message:
|
@@ -100,9 +115,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
115
|
- 0
|
101
116
|
version: "0"
|
102
117
|
requirements:
|
103
|
-
- The gem uses multipart-post
|
118
|
+
- The gem uses multipart-post, mime-types and JSON gem
|
104
119
|
rubyforge_project:
|
105
|
-
rubygems_version: 1.4.
|
120
|
+
rubygems_version: 1.4.2
|
106
121
|
signing_key:
|
107
122
|
specification_version: 3
|
108
123
|
summary: Wrapper for face.com API.
|
data/README
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
This Gem is a very alpha version and is provided as is without any warranty.
|
2
|
-
|
3
|
-
I coded it as a convenient and easy interface to face.com's API for a project I'm working on and I must prepone some assumption on using it:
|
4
|
-
|
5
|
-
- you are a brave
|
6
|
-
- you will send images with only ONE recognizable face at time
|
7
|
-
- you expect some errors and bugs and have the bravery and patience to fix them
|
8
|
-
|
9
|
-
If those requirements are met, go on and use it. If not stop reading and trash the gem...
|
10
|
-
|
11
|
-
If you are reading this you are brave (or crazy).
|
12
|
-
|
13
|
-
A little example of usage:
|
14
|
-
|
15
|
-
linkr=Facer::Linker.new("yourapp","yourkey","yoursecret")
|
16
|
-
puts linkr.account.private_namespaces?.inspect
|
17
|
-
puts linkr.account.limits?.inspect
|
18
|
-
|
19
|
-
trainSet={
|
20
|
-
"vanessa_paradis" => [
|
21
|
-
"http://www.superiorpics.com/hs/vanessa_paradis/main1.jpg",
|
22
|
-
"http://nymag.com/daily/fashion/14_paradis_lgl.jpg",
|
23
|
-
"http://imstars.aufeminin.com/stars/fan/vanessa-paradis/vanessa-paradis-20060208-107457.jpg",
|
24
|
-
"http://www.realbeauty.com/cm/realbeauty/images/NF/rby-hair-vanessa-paradis-5-de.jpg",
|
25
|
-
"http://www.wallpaperweb.org/wallpaper/babes/1280x960/vanessa_paradis_20070722_0171_1280x960.jpg",
|
26
|
-
"http://chansons-fle.wikispaces.com/file/view/vanessa_paradis_reference.jpg/59524266/vanessa_paradis_reference.jpg"
|
27
|
-
]
|
28
|
-
}
|
29
|
-
|
30
|
-
trainSet.each_pair do |key,value|
|
31
|
-
succ= linkr.faces.associate_multi(value,key,"yournamespace").inspect
|
32
|
-
puts "Associating #{key}: #{succ}"
|
33
|
-
end
|
34
|
-
|
35
|
-
puts linkr.faces.train_all("clinik").inspect
|
36
|
-
|
37
|
-
puts linkr.faces.recognize("http://static1.purepeople.com/articles/7/17/12/7/@/85769-vanessa-paradis-et-johnny-depp-637x0-1.jpg","yournamespace").inspect
|
38
|
-
puts linkr.faces.recognize("http://howzar.com/Galleries/Vanessa%20Paradis/vanessa-paradis-32.jpg","yournamespace").inspect
|
39
|
-
puts linkr.faces.recognize("http://pictures.directnews.co.uk/liveimages/Old+man+smiling_1500_19112072_0_0_7006461_300.jpg","yournamespace").inspect
|
40
|
-
|
41
|
-
Stefano Valicchia (stefano.valicchia@gmail.com)
|