vit_classification
VitClassification
¶
Bases: ClassificationBaseOnnxRoboflowInferenceModel
VitClassification handles classification inference for Vision Transformer (ViT) models using ONNX.
Inherits
ClassificationBaseOnnxRoboflowInferenceModel: Base class for ONNX Roboflow Inference. ClassificationMixin: Mixin class providing classification-specific methods.
Attributes:
Name | Type | Description |
---|---|---|
multiclass |
bool
|
A flag that specifies if the model should handle multiclass classification. |
Source code in inference/models/vit/vit_classification.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
weights_file: str
property
¶
Determines the weights file to be used based on the availability of AWS keys.
If AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set, it returns the path to 'weights.onnx'. Otherwise, it returns the path to 'best.onnx'.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Path to the weights file. |
__init__(*args, **kwargs)
¶
Initializes the VitClassification instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args
|
Variable length argument list. |
()
|
|
**kwargs
|
Arbitrary keyword arguments. |
{}
|
Source code in inference/models/vit/vit_classification.py
19 20 21 22 23 24 25 26 27 |
|