ImageConfig: Config object for handling images

ImageConfigR Documentation

Config object for handling images

Description

Config object for handling images

Config object for handling images

Super class

sagemaker.common::ExplainabilityConfig -> ImageConfig

Public fields

image_config

Image config

Methods

Public methods

Inherited methods

Method new()

Initializes all configuration parameters needed for SHAP CV explainability

Usage
ImageConfig$new(
  model_type,
  num_segments = NULL,
  feature_extraction_method = NULL,
  segment_compactness = NULL,
  max_objects = NULL,
  iou_threshold = NULL,
  context = NULL
)
Arguments
model_type

(str): Specifies the type of CV model. Options: (IMAGE_CLASSIFICATION | OBJECT_DETECTION).

num_segments

(None or int): Clarify uses SKLearn's SLIC method for image segmentation to generate features/superpixels. num_segments specifies approximate number of segments to be generated. Default is None. SLIC will default to 100 segments.

feature_extraction_method

(NULL or str): method used for extracting features from the image.ex. "segmentation". Default is segmentation.

segment_compactness

(NULL or float): Balances color proximity and space proximity. Higher values give more weight to space proximity, making superpixel shapes more square/cubic. We recommend exploring possible values on a log scale, e.g., 0.01, 0.1, 1, 10, 100, before refining around a chosen value.

max_objects

(NULL or int): maximum number of objects displayed. Object detection algorithm may detect more than max_objects number of objects in a single image. The top max_objects number of objects according to confidence score will be displayed.

iou_threshold

(NULL or float): minimum intersection over union for the object bounding box to consider its confidence score for computing SHAP values [0.0, 1.0]. This parameter is used for the object detection case.

context

(NULL or float): refers to the portion of the image outside of the bounding box. Scale is [0.0, 1.0]. If set to 1.0, whole image is considered, if set to 0.0 only the image inside bounding box is considered.


Method get_image_config()

Returns the image config part of an analysis config dictionary.

Usage
ImageConfig$get_image_config()

Method clone()

The objects of this class are cloneable with this method.

Usage
ImageConfig$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


DyfanJones/sagemaker-r-common documentation built on June 14, 2022, 10:31 p.m.