unitorch.cli.models¤
Image¤
Processor for image-related operations.
Initializes a new instance of the ImageProcessor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_type |
Optional[str]
|
The type of the image. Defaults to None. |
None
|
image_size |
tuple
|
The size of the image. Defaults to (256, 256). |
(256, 256)
|
http_url |
Optional[str]
|
The URL for fetching images. Defaults to None. |
None
|
Source code in src/unitorch/cli/models/image_utils.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
from_core_configure
classmethod
¤
from_core_configure(config, **kwargs)
Creates a new instance of the ImageProcessor using the configuration from the core.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
The configuration object. |
required | |
**kwargs |
Additional keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
An instance of the ImageProcessor. |
Source code in src/unitorch/cli/models/image_utils.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
Labels¤
Processor for label-related operations.
Initializes a new instance of the LabelProcessor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_classes |
Optional[int]
|
The number of classes. Defaults to None. |
None
|
sep |
Optional[str]
|
The separator used for splitting text. Defaults to ",". |
','
|
max_seq_length |
Optional[int]
|
The maximum sequence length. Defaults to 128. |
128
|
map_dict |
Optional[Dict]
|
A dictionary for mapping labels. Defaults to an empty dictionary. |
dict()
|
Source code in src/unitorch/cli/models/label_utils.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
from_core_configure
classmethod
¤
from_core_configure(config, **kwargs)
Creates a new instance of the LabelProcessor using the configuration from the core.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
The configuration object. |
required | |
**kwargs |
Additional keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
An instance of the LabelProcessor. |
Source code in src/unitorch/cli/models/label_utils.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|