Visual AI
- class datarobot.models.visualai.images.Image
An image stored in a project’s dataset.
- Variables:
id (
str
) – Image ID for this image.image_type (
str
) – Image media type. Accessing this may require a server request and an associated delay in returning.image_bytes (
bytes
) – Raw bytes of this image. Accessing this may require a server request and an associated delay in returning.height (
int
) – Height of the image in pixels.width (
int
) – Width of the image in pixels.
- class datarobot.models.visualai.images.SampleImage
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.- Variables:
image (
Image
) – Image object.target_value (
TargetValue
) – Value associated with thefeature_name
.project_id (
str
) – 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_id (
str
) – Project that contains the images.feature_name (
str
) – Name of feature column that contains images.target_value (
TargetValue
) – 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_start (
Optional[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_end (
Optional[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.offset (
Optional[int]
) – Number of images to be skipped.limit (
Optional[int]
) – Number of images to be returned.
- Return type:
List
[SampleImage
]
- class datarobot.models.visualai.images.DuplicateImage
An image that was duplicated in the project dataset.
- Variables:
image (
Image
) – Image object.count (
int
) – 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_id (
str
) – Project that contains the images.feature_name (
str
) – Name of feature column that contains images.offset (
Optional[int]
) – Number of images to be skipped.limit (
Optional[int]
) – Number of images to be returned.
- Return type:
List
[DuplicateImage
]
- class datarobot.models.visualai.insights.ImageEmbedding
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.
- Variables:
image (
Image
) – Image object used to create this map.feature_name (
str
) – Name of the feature column this embedding is associated with.position_x (
int
) – X coordinate of the image in the embedding space.position_y (
int
) – Y coordinate of the image in the embedding space.actual_target_value (
object
) – Actual target value of the dataset row.target_values (
Optional[List[str]]
) – For classification projects, a list of target values of this project.target_bins (
Optional[List[Dict[str
,float]]]
) – For regression projects, a list of target bins of this project.project_id (
str
) – Id of the project this Image Embedding belongs to.model_id (
str
) – 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_id (
str
) – Project to start creation in.model_id (
str
) – Project’s model to start creation in.
- Returns:
URL to check for image embeddings progress.
- Return type:
str
- Raises:
datarobot.errors.ClientError – Server rejected creation due to client error. Most likely cause is bad
project_id
ormodel_id
.
- classmethod models(project_id)
For a given project_id, list all model_id - feature_name pairs with available Image Embeddings.
- Parameters:
project_id (
str
) – Id of the project to list model_id - feature_name pairs with available Image Embeddings for.- Returns:
List of model and feature name pairs.
- Return type:
list( tuple(model_id
,feature_name) )
- 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.insights.ImageActivationMap
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.- Variables:
image (
Image
) – Image object used to create this map.overlay_image (
Image
) – Image object containing the original image overlaid by the activation heatmap.feature_name (
str
) – Name of the feature column that contains the value this map is based on.activation_values (
List[List[int]]
) – A row-column matrix that contains the activation strengths for image regions. Values are integers in the range [0, 255].actual_target_value (
TargetValue
) – Actual target value of the dataset row.predicted_target_value (
TargetValue
) – Predicted target value of the dataset row that contains this image.target_values (
Optional[List[str]]
) – For classification projects a list of target values of this project.target_bins (
Optional[List[Dict[str
,float]]]
) – For regression projects a list of target bins.project_id (
str
) – Id of the project this Activation Map belongs to.model_id (
str
) – 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_id (
str
) – Project to start creation in.model_id (
str
) – Project’s model to start creation in.
- Returns:
URL to check for image embeddings progress.
- Return type:
str
- Raises:
datarobot.errors.ClientError – Server rejected creation due to client error. Most likely cause is bad
project_id
ormodel_id
.
- classmethod models(project_id)
For a given project_id, list all model_id - feature_name pairs with available Image Activation Maps.
- Parameters:
project_id (
str
) – Id of the project to list model_id - feature_name pairs with available Image Activation Maps for.- Returns:
List of model and feature name pairs.
- Return type:
list( tuple(model_id
,feature_name) )
- classmethod list(project_id, model_id, feature_name, offset=None, limit=None)
Return a list of ImageActivationMap objects.
- Parameters:
project_id (
str
) – Project that contains the images.model_id (
str
) – Model that contains the images.feature_name (
str
) – Name of feature column that contains images.offset (
Optional[int]
) – Number of images to be skipped.limit (
Optional[int]
) – Number of images to be returned.
- Return type:
List
[ImageActivationMap
]
- class datarobot.models.visualai.augmentation.ImageAugmentationOptions
A List of all supported Image Augmentation Transformations for a project. Includes additional information about minimum, maximum, and default values for a transformation.
- Variables:
name (
str
) – The name of the augmentation listproject_id (
str
) – The project containing the image data to be augmentedmin_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 rowcurrent_number_of_new_images (
int
) – The default number of new rows to add for each existing rowmax_number_of_new_images (
int
) – The maximum allowed number of new rows to add for each existing rowtransformations (
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.augmentation.ImageAugmentationList
A List of Image Augmentation Transformations
- Variables:
name (
str
) – The name of the augmentation listproject_id (
str
) – The project containing the image data to be augmentedfeature_name (
Optional[str]
) – name of the feature that the augmentation list is associated within_use (
bool
) – Whether this is the list that will passed in to every blueprint during blueprint generation before autopilotinitial_list (
bool
) – True if this is the list to be used during training to produce augmentationstransformation_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 rowtransformations (
List[Dict]
) – List of transformations to possibly apply to each imagesamples_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_id (
str
) – Project Id to retrieve augmentation lists for.feature_name (
Optional[str]
) – If passed, the response will only include Image Augmentation Lists active for the provided feature name.
- 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:
name (
Optional[str]
) – New name of the feature list.feature_name (
Optional[str]
) – The new feature name for which the Image Augmentation List is effective.initial_list (
Optional[bool]
) – New flag that indicates whether this list will be used during Autopilot to perform image augmentation.transformation_probability (
Optional[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_images (
Optional[int]
) – New number of new rows to add for each existing row, updating the existing augmentation list.transformations (
Optional[list]
) – New list of Transformations to possibly apply to each image.
- Returns:
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.
- Return type:
List
ofclass 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.
- Return type:
List
ofclass ImageAugmentationSample
- class datarobot.models.visualai.augmentation.ImageAugmentationSample
A preview of the type of images that augmentations will create during training.
- Variables:
sample_id (
ObjectId
) – The id of the augmentation sample, used to group related images togetherimage_id (
ObjectId
) – A reference to the Image which can be used to retrieve the image binaryproject_id (
ObjectId
) – A reference to the project containing the imageoriginal_image_id (
ObjectId
) – 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 imageheight (
int
) – Image height in pixelswidth (
int
) – 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- Return type:
List
ofclass ImageAugmentationSample