unitorch.models.segformer¤
SegformerProcessor¤
Bases: HfImageClassificationProcessor
Initializes the SegformerProcessor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vision_config_path
|
str
|
Path to the SegformerImageProcessor configuration file. |
required |
Source code in src/unitorch/models/segformer/processing.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
SegformerForSegmentation¤
Bases: GenericModel
Initializes the SegformerForSegmentation model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
str
|
Path to the Segformer configuration file. |
required |
Source code in src/unitorch/models/segformer/modeling.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
forward ¤
forward(pixel_values: Tensor)
Forward pass of the SegformerForSegmentation model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pixel_values
|
Tensor
|
Input image pixel values. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GenericOutputs |
Object containing upsampled segmentation logits. |
Source code in src/unitorch/models/segformer/modeling.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |