Class: FaceCrop::Detector::Base

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

Overview

Base

Direct Known Subclasses

FaceCom, OpenCV

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Base

initialize



16
17
18
# File 'lib/face_crop.rb', line 16

def initialize(options)
  @options = options
end

Instance Method Details

#detect(file) ⇒ Object

detect



22
23
24
25
26
27
28
29
30
# File 'lib/face_crop.rb', line 22

def detect(file)
  key = "#{self.class}#{file}"
  regions = FaceCrop::Detector::Cache[key] 
  return regions unless regions.nil?

  regions = detect_faces(file)
  FaceCrop::Detector::Cache[key] = regions        
  regions
end