Class: Findface::Utility

Inherits:
Object
  • Object
show all
Defined in:
lib/findface/utility.rb

Class Method Summary collapse

Class Method Details

.detect(options) ⇒ Object

Endpoint: api.findface.pro/v0/detect/ (POST) | Usage: FindFace::Utility.detect

Output: A list of rectangles (bounding boxes) for the detected faces.


8
9
10
# File 'lib/findface/utility.rb', line 8

def detect options
  API::request(:post, 'detect', options)
end

.identify(options) ⇒ Object

Endpoint: api.findface.pro/v0/identify/ (POST) | Usage: FindFace::Utility.identify

Output: A map with - Detected or provided face bounding boxes, as keys,
Arrays of matching Face objects along with match confidence, as values.


23
24
25
# File 'lib/findface/utility.rb', line 23

def identify options
  API::request(:post, 'identify', options)
end

Endpoint: api.findface.pro/v0/faces/gallery/:galley_name/identify/ (POST) | Usage: FindFace::Utility.identify_in_gallery

Output: Same as identification alogorithm, but it is applied on datasets which belongs to particular gallery


30
31
32
# File 'lib/findface/utility.rb', line 30

def identify_in_gallery name, options
  API::request(:post, "faces/gallery/#{name}/identify", options)
end

Endpoint: api.findface.pro/v0/faces/gallery/:gallery_name/ (GET) | Usage: FindFace::Utility.list_faces_from_gallery

Output: Returns list of faces data which belongs to particular gallery


37
38
39
# File 'lib/findface/utility.rb', line 37

def list_faces_from_gallery name, pages = nil
  Findface.get_list "faces/gallery/#{name}/", pages
end

Endpoint: api.findface.pro/v0/face/gallery/:gallery_name/meta/:meta_string (GET) | Usage: FindFace::Utility.list_faces_from_gallery_by_meta

Output: Retuns list of faces which belongs to particular gallery by meta information provided


44
45
46
# File 'lib/findface/utility.rb', line 44

def list_faces_from_gallery_by_meta name, meta_string, pages = nil
  Findface.get_list "faces/gallery/#{name}/meta/#{Findface.encode_meta_string(meta_string)}", pages
end

Endpoint: api.findface.pro/v0/meta/gallery/:gallery_name/ (GET) | Usage: FindFace::Utility.list_meta_for_gallery

Output: Returns meta information of faces belongs to particular gallery


51
52
53
# File 'lib/findface/utility.rb', line 51

def list_meta_for_gallery name
  API::request(:get, "meta/gallery/#{name}/")
end

.verify(options) ⇒ Object

Endpoint: api.findface.pro/v0/verify/ (POST) | Usage: FindFace::Utility.verify

Output: Binary verification result of two images provided.


15
16
17
# File 'lib/findface/utility.rb', line 15

def verify options
  API::request(:post, 'verify', options)
end