ImageInfo

class ImageInfo(id, name, link, hash, mime, ext, size, width, height, labels_count, dataset_id, created_at, updated_at, meta, path_original, full_storage_url, tags, created_by, related_data_id=None, download_id=None, offset_start=None, offset_end=None, ai_search_meta=None, embeddings_updated_at=None, project_id=None, description=None, parent_id=None)[source]

Bases: NamedTuple

NamedTuple with image information from Supervisely.

Usage Example:
ImageInfo(
    id=770915,
    name="IMG_3861.jpeg",
    link=None,
    hash="ZdpMD+ZMJx0R8BgsCzJcqM7qP4M8f1AEtoYc87xZmyQ=",
    mime="image/jpeg",
    ext="jpeg",
    size=148388,
    width=1067,
    height=800,
    labels_count=4,
    dataset_id=2532,
    created_at="2021-03-02T10:04:33.973Z",
    updated_at="2021-03-02T10:04:33.973Z",
    meta={},
    path_original="/h5un6l2bnaz1vj8a9qgms4-public/images/original/7/h/Vo/...jpg",
    full_storage_url="http://app.supervisely.com/h5un6l2bnaz1vj8a9qgms4-public/images/original/7/h/Vo/...jpg",
    tags=[],
    created_by="admin",
    related_data_id=None,
    download_id=None,
    offset_start=None,
    offset_end=None,
)

Create new instance of ImageInfo(id, name, link, hash, mime, ext, size, width, height, labels_count, dataset_id, created_at, updated_at, meta, path_original, full_storage_url, tags, created_by, related_data_id, download_id, offset_start, offset_end, ai_search_meta, embeddings_updated_at, project_id, description, parent_id)

Methods

count

Return number of occurrences of value.

index

Return first index of value.

Attributes

ai_search_meta

dict: Image meta that could have the confidence level of the image in Enntities Collection of type AI Search.

created_at

str: Image creation time.

created_by

str: ID of a user who created the image.

dataset_id

int: Dataset ID in Supervisely.

description

str: Image description.

download_id

str: Unique ID of the image that links it to the corresponding blob file in Supervisely storage uses for downloading source blob file.

embeddings_updated_at

str: Timestamp of the last update of the embeddings for the image.

ext

str: Image file extension.

full_storage_url

str: Full storage URL to image.

hash

str: Image hash obtained by base64(sha256(file_content)).

height

int: Image height.

id

int: Image ID in Supervisely.

labels_count

int: Number of Label in the Image.

link

str: Use link as ID for images that are expected to be stored at remote server.

meta

dict: Custom additional image info that contain image technical and/or user-generated data.

mime

str: Image MIME type.

name

str: Image filename.

offset_end

int: Bytes offset of the blob file that points to the end of the image data.

offset_start

int: Bytes offset of the blob file that points to the start of the image data.

parent_id

int: Parent image ID for overlay relationship.

path_original

str: Relative storage URL to image.

preview_url

Get Image preview URL.

project_id

int: Project ID in Supervisely.

related_data_id

int: ID of the blob file in Supervisely storage related to the image.

size

int: Image size (in bytes).

tags

str: Image Tag list.

updated_at

str: Time of last image update.

width

int: Image width.

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

ai_search_meta

dict: Image meta that could have the confidence level of the image in Enntities Collection of type AI Search.

created_at

str: Image creation time. e.g. “2019-02-22T14:59:53.381Z”.

created_by

str: ID of a user who created the image.

dataset_id

int: Dataset ID in Supervisely.

description

str: Image description.

download_id

str: Unique ID of the image that links it to the corresponding blob file in Supervisely storage uses for downloading source blob file.

embeddings_updated_at

str: Timestamp of the last update of the embeddings for the image. This field is used to track when the embeddings were last updated. It is set to None if the embeddings have never been computed for the image. Format: “YYYY-MM-DDTHH:MM:SS.sssZ”

ext

str: Image file extension.

full_storage_url

str: Full storage URL to image. e.g. “http://app.supervisely.com/h5un6l2bnaz1vj8a9qgms4-public/images/original/7/h/Vo/…jpg”.

hash

str: Image hash obtained by base64(sha256(file_content)). Use hash for files that are expected to be stored at Supervisely or your deployed agent.

height

int: Image height.

id

int: Image ID in Supervisely.

labels_count

int: Number of Label in the Image.

str: Use link as ID for images that are expected to be stored at remote server. e.g. “http://your-server/image1.jpg”.

meta

dict: Custom additional image info that contain image technical and/or user-generated data. To set custom sort parameter for image, you can do the follwoing: 1. With the uploading use add_custom_sort context manager to set the key name of meta object that will be used for custom sorting. 2. Before uploading add value to meta dict with method update_custom_sort 3. Before uploading add key-value pair with key customSort to meta dict, image info file or meta file. 4. After uploading set_custom_sort method to set custom sort value for image. e.g. {‘my-key’:’a’, ‘my-key: “b”, “customSort”: “c”}.

mime

str: Image MIME type.

name

str: Image filename.

offset_end

int: Bytes offset of the blob file that points to the end of the image data.

offset_start

int: Bytes offset of the blob file that points to the start of the image data.

parent_id

int: Parent image ID for overlay relationship.

path_original

str: Relative storage URL to image. e.g. “/h5un6l2bnaz1vj8a9qgms4-public/images/original/7/h/Vo/…jpg”.

property preview_url

Get Image preview URL.

Returns:

Image preview URL.

Return type:

str

project_id

int: Project ID in Supervisely.

related_data_id

int: ID of the blob file in Supervisely storage related to the image.

size

int: Image size (in bytes).

tags

str: Image Tag list. e.g. “[{‘entityId’: 2836466, ‘tagId’: 345022, ‘id’: 2224609, ‘labelerLogin’: ‘admin’, ‘createdAt’: ‘2021-03-05T14:15:39.923Z’, ‘updatedAt’: ‘2021-03-05T14:15:39.923Z’}, {…}]”.

updated_at

str: Time of last image update. e.g. “2019-02-22T14:59:53.381Z”.

width

int: Image width.