Tasks#
aitlas.tasks.evaluate module#
aitlas.tasks.extract_features module#
aitlas.tasks.predict module#
- class ImageFolderDataset(data_dir, labels, transforms, batch_size)[source]#
Bases:
BaseDataset
- class PredictTask(model, config)[source]#
Bases:
BaseTask
- Parameters:
model (BaseModel) –
- schema#
alias of
PredictTaskSchema
aitlas.tasks.prepare module#
aitlas.tasks.schemas module#
- class BaseTaskShema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
Schema
Schema for configuring a base task.
- Parameters:
log (bool, optional) – Flag indicating whether to turn on logging. Default is True.
id (str, optional) – Run name/ID for the task. Default is None.
only (types.StrSequenceOrSet | None) –
exclude (types.StrSequenceOrSet) –
many (bool) –
context (dict | None) –
load_only (types.StrSequenceOrSet) –
dump_only (types.StrSequenceOrSet) –
partial (bool | types.StrSequenceOrSet) –
unknown (str | None) –
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class SplitSetObjectSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
Schema
Schema for configuring a split dataset object.
- Parameters:
ratio (int) – Ratio of the dataset to include in the split. This is required.
file (str) – File containing the indices for the split. This is required.
only (types.StrSequenceOrSet | None) –
exclude (types.StrSequenceOrSet) –
many (bool) –
context (dict | None) –
load_only (types.StrSequenceOrSet) –
dump_only (types.StrSequenceOrSet) –
partial (bool | types.StrSequenceOrSet) –
unknown (str | None) –
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class SplitObjectSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
Schema
- Parameters:
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class SplitTaskSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
BaseTaskShema
Schema for configuring a split task.
- Parameters:
data_dir (str) – Path to the dataset on disk. This is required.
csv_file (str, optional) – CSV file on disk containing dataset information. Default is None.
split (SplitObjectSchema, optional) – Configuration on how to split the dataset. Default is None.
only (types.StrSequenceOrSet | None) –
exclude (types.StrSequenceOrSet) –
many (bool) –
context (dict | None) –
load_only (types.StrSequenceOrSet) –
dump_only (types.StrSequenceOrSet) –
partial (bool | types.StrSequenceOrSet) –
unknown (str | None) –
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class TrainTaskSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
BaseTaskShema
Schema for configuring a training task.
- Parameters:
dataset_config (ObjectConfig) – Train dataset type and configuration. This is required.
epochs (int) – Number of epochs used in training. This is required.
model_directory (str) – Directory of the model output. This is required.
save_epochs (int, optional) – Number of training steps between model checkpoints. Default is 100.
iterations_log (int, optional) – After how many mini-batches do we want to show something in the log. Default is 200.
resume_model (str, optional) – File path to the model to be resumed. Default is None.
only (types.StrSequenceOrSet | None) –
exclude (types.StrSequenceOrSet) –
many (bool) –
context (dict | None) –
load_only (types.StrSequenceOrSet) –
dump_only (types.StrSequenceOrSet) –
partial (bool | types.StrSequenceOrSet) –
unknown (str | None) –
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class TrainAndEvaluateTaskSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
BaseTaskShema
Schema for configuring a task that involves training and evaluation.
- Parameters:
epochs (int) – Number of epochs used in training. This is required.
model_directory (str) – Directory of the model output. This is required.
save_epochs (int, optional) – Number of training steps between model checkpoints. Default is 100.
iterations_log (int, optional) – After how many mini-batches do we want to show something in the log. Default is 200.
resume_model (str, optional) – File path to the model to be resumed. Default is None.
train_dataset_config (ObjectConfig) – Train dataset type and configuration. This is required.
val_dataset_config (ObjectConfig) – Validation dataset type and configuration. This is required.
only (types.StrSequenceOrSet | None) –
exclude (types.StrSequenceOrSet) –
many (bool) –
context (dict | None) –
load_only (types.StrSequenceOrSet) –
dump_only (types.StrSequenceOrSet) –
partial (bool | types.StrSequenceOrSet) –
unknown (str | None) –
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class ParameterSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
Schema
- Parameters:
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class OptimizeTaskSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
BaseTaskShema
Schema for configuring an optimization task.
- Parameters:
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class EvaluateTaskSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
BaseTaskShema
Schema for configuring an evaluation task.
- Parameters:
dataset_config (ObjectConfig) – Dataset type and configuration. This is required.
model_path (str) – Path to the model. This is required.
metrics (List[str], optional) – Metric classes you want to calculate. Default is an empty list.
visualizations (List[str], optional) – Visualization classes you want to show. Default is an empty list.
only (types.StrSequenceOrSet | None) –
exclude (types.StrSequenceOrSet) –
many (bool) –
context (dict | None) –
load_only (types.StrSequenceOrSet) –
dump_only (types.StrSequenceOrSet) –
partial (bool | types.StrSequenceOrSet) –
unknown (str | None) –
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class PredictTaskSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
BaseTaskShema
Schema for configuring a prediction task.
- Parameters:
data_dir (str) – Directory with the image to perform prediction on. This is required.
model_path (str) – Path to the model. This is required.
output_dir (str, optional) – Folder path where the plot images with predictions will be stored. Default is ‘/predictions’.
output_file (str, optional) – CSV file path where the predictions will be stored. Default is ‘predictions.csv’.
dataset_config (ObjectConfig, optional) – Dataset type and configuration. Default is None.
batch_size (int, optional) – Batch size. Default is 64.
labels (List[str], optional) – Labels needed to tag the predictions. Default is None.
transforms (List[str], optional) – Classes to run transformations. Default is a list of common torchvision transformations.
output_format (str, optional) – Whether to output the predictions to CSV or plots. Default is ‘plot’. Must be one of [‘plot’, ‘csv’, ‘image’].
only (types.StrSequenceOrSet | None) –
exclude (types.StrSequenceOrSet) –
many (bool) –
context (dict | None) –
load_only (types.StrSequenceOrSet) –
dump_only (types.StrSequenceOrSet) –
partial (bool | types.StrSequenceOrSet) –
unknown (str | None) –
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class PrepareTaskSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
BaseTaskShema
- Parameters:
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class ExtractFeaturesTaskSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
BaseTaskShema
Schema for configuring a task to extract features from images.
- Parameters:
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class VisualizeSplitSetObjectSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
Schema
- Parameters:
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class VisualizeSplitObjectSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
Schema
- Parameters:
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
- class VisualizeTaskSchema(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]#
Bases:
BaseTaskShema
- Parameters:
- opts: SchemaOpts = <marshmallow.schema.SchemaOpts object>#
aitlas.tasks.split module#
- class BaseSplitTask(model, config)[source]#
Bases:
BaseTask
Base task meant to split dataset
- Parameters:
model (BaseModel) –
- schema#
alias of
SplitTaskSchema
- is_multilabel = False#
- extensions = ['.jpg', '.jpeg', '.png', '.ppm', '.bmp', '.pgm', '.tif', '.tiff', '.webp']#
- class RandomSplitTask(model, config)[source]#
Bases:
BaseSplitTask
Randomly split a folder containing images
- Parameters:
model (BaseModel) –
aitlas.tasks.train module#
- class TrainTask(model, config)[source]#
Bases:
BaseTask
- Parameters:
model (BaseModel) –
- schema#
alias of
TrainTaskSchema
aitlas.tasks.unsupervised_pre_training module#
Note
Not implemented yet in the stable version