TensorflowLite::Image::Common
Constructors
new(client : Client, labels : Array(String) | Nil = nil, scaling_mode : Scale = DEFAULT_SCALE_MODE, input_format : Format | Nil = nil, output_format : Format | Nil = nil)
SourceInstance methods
detection_adjustments(image : Canvas, scale_mode : Scale = @scaling_mode)
this will calculate the adjustments required to the detections for overlaying on the original image (or a scaled image in the same aspect ratio)
detection_adjustments(image_width : Int32, image_height : Int32, scale_mode : Scale = @scaling_mode)
this will calculate the adjustments required to the detections for overlaying on the original image (or a scaled image in the same aspect ratio)
run(canvas : Canvas, scale_mode : Scale = @scaling_mode, resize_method : StumpyResize::InterpolationMethod = :bilinear)
scales the image before invoking the tflite model
scaling_mode
the scaling mode to use when preparing images for analysis
- Use fit if you would like the whole image to be processed, however letter boxing means the image is smaller which may effect detections
- Use cover if you would like to crop the image, only the middle of the image will be used for detection unless the aspect ratio matches the model input
scaling_mode=(scaling_mode : Scale)
the scaling mode to use when preparing images for analysis
- Use fit if you would like the whole image to be processed, however letter boxing means the image is smaller which may effect detections
- Use cover if you would like to crop the image, only the middle of the image will be used for detection unless the aspect ratio matches the model input