BlobImageInfo¶
- class BlobImageInfo(name, offset_start, offset_end)[source]¶
Bases:
objectObject with image parameters that describes image in blob file.
- Usage Example:
BlobImageInfo( name="IMG_3861.jpeg", offset_start=0, offset_end=148388, )
Methods
Add file ID from Team Files to BlobImageInfo object to extend data imported from offsets file.
Dump BlobImageInfo objects to a pickle file in batches.
Create BlobImageInfo object from dictionary that is returned by Supervisely API.
from_image_infoLoad BlobImageInfo objects from a pickle file in batches of specified size.
Create dictionary from BlobImageInfo object that can be used for request to Supervisely API.
Attributes
offsets_dictnameoffset_startoffset_end- static dump_to_pickle(offsets, file_path)[source]¶
Dump BlobImageInfo objects to a pickle file in batches. To read the data back, use the
load_from_pickle_generatormethod.
-
static from_dict(offset_dict, return_team_file_id=
False)[source]¶ Create BlobImageInfo object from dictionary that is returned by Supervisely API.
- Parameters:
- Returns:
BlobImageInfo object.
- Return type:
-
static load_from_pickle_generator(file_path, batch_size=
10000)[source]¶ Load BlobImageInfo objects from a pickle file in batches of specified size. The file should contain a list of BlobImageInfo objects.
- Parameters:
- file_path : str¶
Path to the pickle file containing
BlobImageInfoobjects.- batch_size : int¶
Size of each batch. Default is 10000.
- Returns:
Generator yielding batches of BlobImageInfo objects.
- Return type:
Generator[List[
BlobImageInfo], None, None]
- add_team_file_id(team_file_id)[source]¶
Add file ID from Team Files to BlobImageInfo object to extend data imported from offsets file. This data is used to link offsets with blob file that is already uploaded to Supervisely storage.
-
to_dict(team_file_id=
None)[source]¶ Create dictionary from BlobImageInfo object that can be used for request to Supervisely API.