Module: DeepStack::Scene

Included in:
DeepStack
Defined in:
lib/deep_stack/scene.rb

Overview

Scene Recognition

Instance Method Summary collapse

Instance Method Details

#identify_scene(image, **options) ⇒ Hash?

Call the scene recognition API to classify an image into one of the supported scenes.

Parameters:

  • image (Object)

    binary data or a File object

  • options (Hash)

    additional fields for DeepStack, e.g. min_confidence: 0.5

Returns:

  • (Hash)

    if successful, DeepStack result hash {‘label’ => ‘scene’, ‘confidence’ => 2.2}

  • (nil)

    if error



16
17
18
19
# File 'lib/deep_stack/scene.rb', line 16

def identify_scene(image, **options)
  target = 'vision/scene'
  api_post(target, image, **options)
end