pixano.core.image
Image(uri, bytes=None, preview_bytes=None, uri_prefix=None)
Bases: PixanoType
, BaseModel
Image type using URI or bytes
Attributes:
Name | Type | Description |
---|---|---|
uri |
str
|
Image URI |
bytes |
bytes
|
Image bytes |
preview_bytes |
bytes
|
Image preview bytes |
uri_prefix |
str
|
URI prefix for relative URIs |
Attributes:
Name | Type | Description |
---|---|---|
uri |
str
|
Image URI |
bytes |
bytes
|
Image bytes. Defaults to None. |
preview_bytes |
bytes
|
Image preview bytes. Defaults to None. |
uri_prefix |
str
|
URI prefix for relative URIs. Defaults to None. |
Source code in pixano/core/image.py
complete_uri: str
property
file_name: str
property
height: int
property
path: Path
property
preview_url: str
property
url: str
property
width: int
property
as_cv2()
as_pillow()
display(preview=False)
Display image
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preview
|
bool
|
True to display image preview instead of full image. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
Image
|
Image as IPython Display |
Source code in pixano/core/image.py
get_bytes()
Get image bytes from attribute or from reading file from URI
Returns:
Type | Description |
---|---|
bytes
|
Image bytes |
Source code in pixano/core/image.py
open()
to_struct()
staticmethod
Return Image type as PyArrow Struct
Returns:
Type | Description |
---|---|
StructType
|
Custom type corresponding PyArrow Struct |