Module: DeepStack::Detection

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

Overview

APIs related to object detection

Instance Method Summary collapse

Instance Method Details

#detect_objects(image, **options) ⇒ Array

Perform object detection

Parameters:

  • image (Object)

    raw image data or a File object of an image file

  • options (Hash)

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

Returns:

  • (Array)

    a list of predictions, or nil on error



14
15
16
17
# File 'lib/deep_stack/detection.rb', line 14

def detect_objects(image, **options)
  target = 'vision/detection'
  api_post(target, image, **options)&.dig('predictions')
end