unitorch.cli.models.beit¤
BeitProcessor¤
Tip
core/process/beit
is the section for configuration of BeitProcessor.
Bases: BeitProcessor
Class for processing images using the Beit model.
Initialize BeitProcessor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vision_config_path |
str
|
The path to the vision configuration file. |
required |
Source code in src/unitorch/cli/models/beit/processing.py
26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
from_core_configure
classmethod
¤
from_core_configure(config, **kwargs)
Create an instance of BeitProcessor from a core configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
The core configuration. |
required | |
**kwargs |
Additional keyword arguments. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
BeitProcessor |
An instance of BeitProcessor. |
Source code in src/unitorch/cli/models/beit/processing.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
BeitForImageClassification¤
Tip
core/model/classification/beit
is the section for configuration of BeitForImageClassification.
Bases: BeitForImageClassification
Class for image classification using the Beit model.
Initialize BeitForImageClassification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_path |
str
|
The path to the model configuration file. |
required |
num_classes |
int
|
The number of output classes. Defaults to 1. |
1
|
Source code in src/unitorch/cli/models/beit/modeling.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
forward ¤
forward(pixel_values: Tensor)
Forward pass of the BeitForImageClassification model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pixel_values |
Tensor
|
The input pixel values. |
required |
Returns:
Name | Type | Description |
---|---|---|
ClassificationOutputs |
The model outputs. |
Source code in src/unitorch/cli/models/beit/modeling.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
from_core_configure
classmethod
¤
from_core_configure(config, **kwargs)
Create an instance of BeitForImageClassification from a core configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
The core configuration. |
required | |
**kwargs |
Additional keyword arguments. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
BeitForImageClassification |
An instance of BeitForImageClassification. |
Source code in src/unitorch/cli/models/beit/modeling.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|