akride.core package

Subpackages

Submodules

akride.core.constants module

class akride.core.constants.Constants[source]

Bases: object

BLOB_TABLE_COLUMNS = ['partition_start', 'partition_end', 'workflow_id', 'session_id', 'blob_id']
DATASET_FILES_COLUMNS = ['partition_start', 'partition_end', 'workflow_id', 'session_id', 'file_path']
DEBUGGING_ENABLED = False
DEFAULT_SAAS_ENDPOINT = 'https://app.akridata.ai'
FILE_TYPES = ['blobs', 'coreset', 'projections', 'sketch', 'thumbnail']
INGEST_FILES_COUNT_IN_ONE_PARTITION = 10000
INGEST_WF_TOKEN_SIZE = 1024
LOG_CONFIG_FILE_NAME = 'pylogconf.yaml'
PARTITIONED_TABLE_COLUMNS = ['partition_start', 'partition_end', 'workflow_id', 'session_id', 'file_path', 'file_id', 'partition_id']
PARTITION_SIZE = 300000000
PRIMARY_TABLE_COLUMNS = ['partition_start', 'partition_end', 'workflow_id', 'session_id', 'frame_idx_in_blob', 'blob_idx_in_partition', 'file_path', 'timestamp', 'file_id', 'frame_idx_in_file', 'file_name', 'total_frames_in_file']
PROCESS_WF_TOKEN_SIZE = 1500
SUMMARY_TABLE_COLUMNS = ['partition_start', 'partition_end', 'workflow_id', 'session_id', 'coreset', 'projections', 'sketch', 'thumbnail']
THUMBNAIL_AGGREGATOR_SDK_DETAILS = {'class_name': 'ThumbnailAggregator',  'cleanup_method': None,  'init_method': None,  'init_params': None,  'module': 'pyakri_de_filters.thumbnail.thumbnail_aggregator',  'run_method': 'run'}

akride.core.enums module

Copyright (C) 2024, Akridata, Inc - All Rights Reserved. Unauthorized copying of this file, via any medium is strictly prohibited

class akride.core.enums.BackgroundTaskType(value)[source]

Bases: Enum

Specifies the type of background task

DATASET_INGESTION = 'dataset_ingestion'
class akride.core.enums.CatalogTableType(value)[source]

Bases: Enum

TableType for create view

EXTERNAL = 'external'
INTERNAL = 'internal'
class akride.core.enums.ClusterAlgoType[source]

Bases: object

Cluster algorithms supported by DataExplorer

GMM = 'gmm'
HDBSCAN = 'hdbscan'
KMEANS = 'kmeans'
KSEGMENT = 'ksegment'
class akride.core.enums.DataType(value)[source]

Bases: Enum

Supported Data types

IMAGE = 'image/*'
VIDEO = 'video/*'
class akride.core.enums.DatastoreType(value)[source]

Bases: Enum

Supported datastore types

AZURE = 2
GCS = 3
LOCAL = 0
S3 = 1
class akride.core.enums.EmbedAlgoType[source]

Bases: object

Embedding algorithms supported by DataExplorer

GEOMETRIC_CLASS = 'geometric-class'
ISOMAP = 'isomap'
LLE = 'lle'
PCA = 'pca'
UMAP = 'umap'
class akride.core.enums.FeaturizerType(value)[source]

Bases: Enum

Type of featurizer to be used for ingestion FULL_IMAGE: Features generated on the full image PATCH: Features generated on a grid of cells over image. Supports patch search EXTERNAL: Features are generated externally and registered against dataset CLIP: OpenCLIP model trained on LAION dataset that generates features to allow text prompt based search.

CLIP = 3
EXTERNAL = 2
FULL_IMAGE = 0
PATCH = 1
class akride.core.enums.JobContext(value)[source]

Bases: Enum

Specifies the context that samples are requested under

CLUSTER_RETRIEVAL = 2
CONFUSION_MATRIX_CELL = 0
CORESET_SAMPLING = 3
class akride.core.enums.JobStatisticsContext(value)[source]

Bases: Enum

Specifies the type of statistics to be retrieved

CONFIDENCE_HISTOGRAM = 2
CONFUSION_MATRIX = 0
PRECISION_RECALL_CURVE = 1
class akride.core.enums.JobType(local_vars_configuration=None)[source]

Bases: JobType

Supported Job types

classmethod is_analyze_job(job_type) bool[source]

akride.core.exceptions module

Copyright (C) 2024, Akridata, Inc - All Rights Reserved. Unauthorized copying of this file, via any medium is strictly prohibited

exception akride.core.exceptions.BaseError(message: str)[source]

Bases: Exception

Base class for creating custom exception classes.

message

Information about the error that occurred.

Type:

str

class akride.core.exceptions.ErrorMessages[source]

Bases: object

Class that that holds all error messages used in the sdk

SDK_SERVER_ERR_01_NOT_REACHABLE = 'Server not reachable'
SDK_USER_ERR_01_INVALID_AUTH = 'Invalid Authentication Config'
exception akride.core.exceptions.InvalidAuthConfigError(message: str)[source]

Bases: UserError

Custom exception class defined to handle errors raised due to Invalid api-key

exception akride.core.exceptions.ServerError(message: str)[source]

Bases: BaseError

Custom exception class for handling errors that occur in server-related operations. This will capture all 5xx errors

exception akride.core.exceptions.ServerNotReachableError(message: str)[source]

Bases: BaseError

Error thrown when the client is unable to connect to the server

exception akride.core.exceptions.UserError(message: str)[source]

Bases: BaseError

Custom exception class for user-defined errors. This will capture all 4xx errors

akride.core.types module

Copyright (C) 2024, Akridata, Inc - All Rights Reserved. Unauthorized copying of this file, via any medium is strictly prohibited

class akride.core.types.AnalyzeJobParams(catalog_config: CatalogDetails, plot_featurizer: str = 'content', confidence_config: List[float] = [0, 0.2, 0.4, 0.6, 0.8, 1], iou_config: List[float] = [0.1, 0.3, 0.5, 0.7, 0.9, 1])[source]

Bases: object

catalog_config: CatalogDetails
confidence_config: List[float]
iou_config: List[float]
plot_featurizer: str
class akride.core.types.CatalogDetails(score_column: str | None = None, ground_truth_class_column: str | None = None, prediction_class_column: str | None = None, ground_truth_coordinates_column: str | None = None, prediction_coordinates_column: str | None = None, ground_truth_coordinates_class_column: str | None = None, prediction_coordinates_class_score_column: str | None = None)[source]

Bases: object

ground_truth_class_column: str
ground_truth_coordinates_class_column: str
ground_truth_coordinates_column: str
prediction_class_column: str
prediction_coordinates_class_score_column: str
prediction_coordinates_column: str
score_column: str
class akride.core.types.CatalogTable(table_name: str, table_type: CatalogTableType | None = None, pipeline_id: str | None = None, catalog_name: str | None = None, schema_name: str | None = None, alias_name: str | None = None, is_view: bool | None = False)[source]

Bases: object

class akride.core.types.ClientManager(am_client: ApiClient, dsp_client: ApiClient, background_task_manager: BackgroundTaskManager)[source]

Bases: object

Dataclass managing different APIClient required to connect with DataExplorer services

am_client: ApiClient
background_task_manager: BackgroundTaskManager
dsp_client: ApiClient
class akride.core.types.ClusterRetrievalSpec(**kwargs)[source]

Bases: JobOpSpec

Class representing a cluster retrieval specification.

class akride.core.types.Column(name: str, type: str)[source]

Bases: object

Type representing a Table Column

name: str
type: str
class akride.core.types.ConfusionMatrix(data, labels)[source]

Bases: JobStatistics

Class representing a confusion matrix.

to_dict() dict[source]

Method for converting this object to a dictionary.

Returns:

A dictionary representing this object.

Return type:

dict

class akride.core.types.ConfusionMatrixCellSpec(**kwargs)[source]

Bases: JobOpSpec

Class representing a confusion matrix cell specification.

class akride.core.types.CoresetSamplingSpec(**kwargs)[source]

Bases: JobOpSpec

Class representing a coreset sampling specification.

class akride.core.types.JobOpSpec(**kwargs)[source]

Bases: Dict

class akride.core.types.JobStatistics[source]

Bases: object

class akride.core.types.JoinCondition(left_column, right_column)[source]

Bases: object

class akride.core.types.PlotFeaturizer(local_vars_configuration=None)[source]

Bases: PlotFeaturizer

PlotFeaturizer for Analyze job

class akride.core.types.SampleInfoList(job_id: str = '', point_ids: List | None = None)[source]

Bases: object

Class representing a list of samples.

append_sample(sample: ResultsetResponseFrameItem)[source]
get_fullres_urls()[source]
get_local_paths()[source]
get_point_ids()[source]
get_thumbnail_urls()[source]
to_dict() dict[source]

Method for converting this object to a dictionary.

Returns:

A dictionary representing the this object.

Return type:

dict

class akride.core.types.SimilaritySearchSpec(**kwargs)[source]

Bases: JobOpSpec

Class representing a similarity search specification.

Module contents