VisualAI
- class datarobot.models.visualai.Image(image_id, project_id, height=0, width=0)
An image stored in a project’s dataset.
- Attributes:
- idstr
Image ID for this image.
- image_typestr
Image media type. Accessing this may require a server request and an associated delay in returning.
- image_bytesbytes
Raw bytes of this image. Accessing this may require a server request and an associated delay in returning.
- heightint
Height of the image in pixels.
- widthint
Width of the image in pixels.
- class datarobot.models.visualai.SampleImage(project_id, image_id, height, width, target_value=None)
A sample image in a project’s dataset.
If
Project.stage
isdatarobot.enums.PROJECT_STAGE.EDA2
then thetarget_*
attributes of this class will have values, otherwise the values will all be None.- Attributes:
- imageImage
Image object.
- target_valueTargetValue
Value associated with the
feature_name
.- project_idstr
Id of the project that contains the images.
- classmethod list(project_id, feature_name, target_value=None, target_bin_start=None, target_bin_end=None, offset=None, limit=None)
Get sample images from a project.
- Parameters:
- project_idstr
Project that contains the images.
- feature_namestr
Name of feature column that contains images.
- target_valueTargetValue
For classification projects - target value to filter images. Please note that you can only use this parameter when the project has finished the EDA2 stage.
- target_bin_startOptional[Union[int, float]]
For regression projects - only images corresponding to the target values above (inclusive) this value will be returned. Must be specified together with target_bin_end. Please note that you can only use this parameter when the project has finished the EDA2 stage.
- target_bin_endOptional[Union[int, float]]
For regression projects - only images corresponding to the target values below (exclusive) this value will be returned. Must be specified together with target_bin_start. Please note that you can only use this parameter when the project has finished the EDA2 stage.
- offsetOptional[int]
Number of images to be skipped.
- limitOptional[int]
Number of images to be returned.
- Return type:
List
[SampleImage
]
- class datarobot.models.visualai.DuplicateImage(image_id, row_count, project_id)
An image that was duplicated in the project dataset.
- Attributes:
- imageImage
Image object.
- countint
Number of times the image was duplicated.
- classmethod list(project_id, feature_name, offset=None, limit=None)
Get all duplicate images in a project.
- Parameters:
- project_idstr
Project that contains the images.
- feature_namestr
Name of feature column that contains images.
- offsetOptional[int]
Number of images to be skipped.
- limitOptional[int]
Number of images to be returned.
- Return type:
List
[DuplicateImage
]
- class datarobot.models.visualai.ImageEmbedding(feature_name, position_x, position_y, image_id, project_id, model_id, actual_target_value=None, target_values=None, target_bins=None)
Vector representation of an image in an embedding space.
A vector in an embedding space will allow linear computations to be carried out between images: for example computing the Euclidean distance of the images.
- Attributes:
- imageImage
Image object used to create this map.
- feature_namestr
Name of the feature column this embedding is associated with.
- position_xint
X coordinate of the image in the embedding space.
- position_yint
Y coordinate of the image in the embedding space.
- actual_target_valueobject
Actual target value of the dataset row.
- target_valuesOptional[List[str]]
For classification projects, a list of target values of this project.
- target_binsOptional[List[Dict[str, float]]]
For regression projects, a list of target bins of this project.
- project_idstr
Id of the project this Image Embedding belongs to.
- model_idstr
Id of the model this Image Embedding belongs to.
- classmethod compute(project_id, model_id)
Start the computation of image embeddings for the model.
- Parameters:
- project_idstr
Project to start creation in.
- model_idstr
Project’s model to start creation in.
- Returns:
- str
URL to check for image embeddings progress.
- Raises:
- datarobot.errors.ClientError
Server rejected creation due to client error. Most likely cause is bad
project_id
ormodel_id
.
- Return type:
str
- classmethod models(project_id)
For a given project_id, list all model_id - feature_name pairs with available Image Embeddings.
- Parameters:
- project_idstr
Id of the project to list model_id - feature_name pairs with available Image Embeddings for.
- Returns:
- list( tuple(model_id, feature_name) )
List of model and feature name pairs.
- Return type:
List
[Tuple
[str
,str
]]
- classmethod list(project_id, model_id, feature_name)
Return a list of ImageEmbedding objects.
- Parameters:
- project_id: str
Id of the project the model belongs to.
- model_id: str
Id of the model to list Image Embeddings for.
- feature_name: str
Name of feature column to list Image Embeddings for.
- Return type:
List
[ImageEmbedding
]
- class datarobot.models.visualai.ImageActivationMap(feature_name, activation_values, image_width, image_height, image_id, overlay_image_id, project_id, model_id, actual_target_value=None, predicted_target_value=None, target_values=None, target_bins=None)
Mark areas of image with weight of impact on training.
This is a technique to display how various areas of the region were used in training, and their effect on predictions. Larger values in
activation_values
indicates a larger impact.- Attributes:
- imageImage
Image object used to create this map.
- overlay_imageImage
Image object containing the original image overlaid by the activation heatmap.
- feature_namestr
Name of the feature column that contains the value this map is based on.
- activation_valuesList[List[int]]
A row-column matrix that contains the activation strengths for image regions. Values are integers in the range [0, 255].
- actual_target_valueTargetValue
Actual target value of the dataset row.
- predicted_target_valueTargetValue
Predicted target value of the dataset row that contains this image.
- target_valuesOptional[List[str]]
For classification projects a list of target values of this project.
- target_binsOptional[List[Dict[str, float]]]
For regression projects a list of target bins.
- project_idstr
Id of the project this Activation Map belongs to.
- model_idstr
Id of the model this Activation Map belongs to.
- classmethod compute(project_id, model_id)
Start the computation of activation maps for the given model.
- Parameters:
- project_idstr
Project to start creation in.
- model_idstr
Project’s model to start creation in.
- Returns:
- str
URL to check for image embeddings progress.
- Raises:
- datarobot.errors.ClientError
Server rejected creation due to client error. Most likely cause is bad
project_id
ormodel_id
.
- Return type:
str
- classmethod models(project_id)
For a given project_id, list all model_id - feature_name pairs with available Image Activation Maps.
- Parameters:
- project_idstr
Id of the project to list model_id - feature_name pairs with available Image Activation Maps for.
- Returns:
- list( tuple(model_id, feature_name) )
List of model and feature name pairs.
- Return type:
List
[Tuple
[str
,str
]]
- classmethod list(project_id, model_id, feature_name, offset=None, limit=None)
Return a list of ImageActivationMap objects.
- Parameters:
- project_idstr
Project that contains the images.
- model_idstr
Model that contains the images.
- feature_namestr
Name of feature column that contains images.
- offsetOptional[int]
Number of images to be skipped.
- limitOptional[int]
Number of images to be returned.
- Return type:
List
[ImageActivationMap
]
- class datarobot.models.visualai.ImageAugmentationOptions(id, name, project_id, min_transformation_probability, current_transformation_probability, max_transformation_probability, min_number_of_new_images, current_number_of_new_images, max_number_of_new_images, transformations=None)
A List of all supported Image Augmentation Transformations for a project. Includes additional information about minimum, maximum, and default values for a transformation.
- Attributes:
- name: string
The name of the augmentation list
- project_id: string
The project containing the image data to be augmented
- min_transformation_probability: float
The minimum allowed value for transformation probability.
- current_transformation_probability: float
Default setting for probability that each transformation will be applied to an image.
- max_transformation_probability: float
The maximum allowed value for transformation probability.
- min_number_of_new_images: int
The minimum allowed number of new rows to add for each existing row
- current_number_of_new_images: int
The default number of new rows to add for each existing row
- max_number_of_new_images: int
The maximum allowed number of new rows to add for each existing row
- transformations: list[dict]
List of transformations to possibly apply to each image
- classmethod get(project_id)
Returns a list of all supported transformations for the given project
- Parameters:
project_id (
str
) – sting The id of the project for which to return the list of supported transformations.- Return type:
- Returns:
- ImageAugmentationOptions
A list containing all the supported transformations for the project.
- class datarobot.models.visualai.ImageAugmentationList(id, name, project_id, feature_name=None, in_use=False, initial_list=False, transformation_probability=0.0, number_of_new_images=1, transformations=None, samples_id=None)
A List of Image Augmentation Transformations
- Attributes:
- name: string
The name of the augmentation list
- project_id: string
The project containing the image data to be augmented
- feature_name: string (optional)
name of the feature that the augmentation list is associated with
- in_use: boolean
Whether this is the list that will passed in to every blueprint during blueprint generation before autopilot
- initial_list: boolean
True if this is the list to be used during training to produce augmentations
- transformation_probability: float
Probability that each transformation will be applied to an image. Value should be between 0.01 - 1.0.
- number_of_new_images: int
Number of new rows to add for each existing row
- transformations: array
List of transformations to possibly apply to each image
- samples_id: str
Id of last image augmentation sample generated for image augmentation list.
- classmethod create(name, project_id, feature_name=None, initial_list=False, transformation_probability=0.0, number_of_new_images=1, transformations=None, samples_id=None)
create a new image augmentation list
- Return type:
- classmethod list(project_id, feature_name=None)
List Image Augmentation Lists present in a project.
- Parameters:
- project_idstr
Project Id to retrieve augmentation lists for.
- feature_nameOptional[str]
If passed, the response will only include Image Augmentation Lists active for the provided feature name.
- Returns:
- list[ImageAugmentationList]
- Return type:
List
[ImageAugmentationList
]
- update(name=None, feature_name=None, initial_list=None, transformation_probability=None, number_of_new_images=None, transformations=None)
Update one or multiple attributes of the Image Augmentation List in the DataRobot backend as well on this object.
- Parameters:
- nameOptional[str]
New name of the feature list.
- feature_nameOptional[str]
The new feature name for which the Image Augmentation List is effective.
- initial_listOptional[bool]
New flag that indicates whether this list will be used during Autopilot to perform image augmentation.
- transformation_probabilityOptional[float]
New probability that each enabled transformation will be applied to an image. This does not apply to Horizontal or Vertical Flip, which are always set to 50%.
- number_of_new_imagesOptional[int]
New number of new rows to add for each existing row, updating the existing augmentation list.
- transformationsOptional[list]
New list of Transformations to possibly apply to each image.
- Returns:
- ImageAugmentationList
Reference to self. The passed values will be updated in place.
- Return type:
- retrieve_samples()
Lists already computed image augmentation sample for image augmentation list. Returns samples only if they have been already computed. It does not initialize computation.
- Returns:
- List of class ImageAugmentationSample
- Return type:
List
[ImageAugmentationSample
]
- compute_samples(max_wait=600)
Initializes computation and retrieves list of image augmentation samples for image augmentation list. If samples exited prior to this call method, this will compute fresh samples and return latest version of samples.
- Returns:
- List of class ImageAugmentationSample
- Return type:
List
[ImageAugmentationSample
]
- class datarobot.models.visualai.ImageAugmentationSample(image_id, project_id, height, width, original_image_id=None, sample_id=None)
A preview of the type of images that augmentations will create during training.
- Attributes:
- sample_idObjectId
The id of the augmentation sample, used to group related images together
- image_idObjectId
A reference to the Image which can be used to retrieve the image binary
- project_idObjectId
A reference to the project containing the image
- original_image_idObjectId
A reference to the original image that generated this image in the case of an augmented image. If this is None it signifies this is an original image
- heightint
Image height in pixels
- widthint
Image width in pixels
- classmethod list(auglist_id=None)
Return a list of ImageAugmentationSample objects.
- Parameters:
- auglist_id: str
ID for augmentation list to retrieve samples for
- Returns:
- List of class ImageAugmentationSample
- Return type:
List
[ImageAugmentationSample
]