DashAI.back.models.ViTTransformer

class ViTTransformer(model=None, **kwargs)[source]

Pre-trained Vision Transformer (ViT) for image classification.

Vision Transformer (ViT) is a transformer that is targeted at vision processing tasks such as image recognition.[1]

References

[1] https://en.wikipedia.org/wiki/Vision_transformer [2] https://huggingface.co/docs/transformers/model_doc/vit

__init__(model=None, **kwargs)[source]

Initialize the transformer.

This process includes the instantiation of the pre-trained model and the associated feature extractor.

Methods

__init__([model])

Initialize the transformer.

fit(x_train, y_train)

Fine-tune the pre-trained model.

get_schema()

Generates the component related Json Schema.

load(filename)

Restores an instance of a model.

predict(x_pred)

Make a prediction with the fine-tuned model.

preprocess_images(x[, y])

Preprocess images for model input.

save([filename])

Store an instance of a model.

validate_and_transform(raw_data)

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Attributes

COMPATIBLE_COMPONENTS

TYPE