VariableImageSize
Bases: ModelImageSize
A container for variable image size in neural networks.
With a VariableImageSize, all image sizes that are a multiple of width and height are valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
int
|
the width of the image |
required |
height
|
int
|
the height of the image |
required |
channel
|
int
|
the channel of the image |
required |
Raises:
| Type | Description |
|---|---|
OutOfBoundsError:
|
if width or height are below 1 |
ValueError
|
if an invalid channel is given |
Methods:
| Name | Description |
|---|---|
from_image |
Create a |
from_image_size |
Create a |
Attributes:
| Name | Type | Description |
|---|---|---|
channel |
int
|
Get the channel of this |
height |
int
|
Get the height of this |
width |
int
|
Get the width of this |
Source code in src/safeds/ml/nn/typing/_model_image_size.py
channel
¶
Get the channel of this ImageSize in pixels.
Returns:
| Name | Type | Description |
|---|---|---|
channel |
int
|
The channel of this |
height
¶
Get the height of this ImageSize in pixels.
Returns:
| Name | Type | Description |
|---|---|---|
height |
int
|
The height of this |
width
¶
Get the width of this ImageSize in pixels.
Returns:
| Name | Type | Description |
|---|---|---|
width |
int
|
The width of this |
from_image
¶
Create a ModelImageSize of a given image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Image
|
the given image for the |
required |
Returns:
| Name | Type | Description |
|---|---|---|
image_size |
Self
|
the calculated |
Source code in src/safeds/ml/nn/typing/_model_image_size.py
from_image_size
¶
Create a ModelImageSize of a given image size.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_size
|
ModelImageSize
|
the given image size for the |
required |
Returns:
| Name | Type | Description |
|---|---|---|
image_size |
Self
|
the new |