Module: DeepStack::Image

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

Overview

Support Image Enhance feature

Instance Method Summary collapse

Instance Method Details

#enhance_image(image) ⇒ Image?

Parameters:

  • image (Image)

    the raw image data or a File object of an image file

Returns:

  • (Image)

    the enhanced image object

  • (nil)

    if failed



16
17
18
19
20
21
22
# File 'lib/deep_stack/image.rb', line 16

def enhance_image(image)
  target = 'vision/enhance'
  result = api_post(target, image)
  return unless result&.dig('success') == true

  Base64.decode64(result['base64'])
end