BlobImageInfo¶
- class BlobImageInfo[source]¶
Bases:
objectObject with image parameters that describes image in blob file.
- 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_info- rtype
Load 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_dict- rtype
- 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.
- 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.- Parameters
- offsets : Generator[List[BlobImageInfo]] or List[BlobImageInfo]
Generator yielding batches of BlobImageInfo objects or a list of BlobImageInfo objects.
- file_path : str
Path to the pickle file.
-
static from_dict(offset_dict, return_team_file_id=
False)[source]¶ Create BlobImageInfo object from dictionary that is returned by Supervisely API.
- Parameters
- offset_dict : Dict
Dictionary with image offsets.
- return_team_file_id : bool
If True, return team file ID. Default is False to make size of the object smaller for pickling.
- 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
- Returns
Generator yielding batches of BlobImageInfo objects.
- Return type
Generator[List[BlobImageInfo], None, None]