Project Download¶
-
download_fast(api, project_id, dest_dir, dataset_ids=
None, log_progress=True, progress_cb=None, semaphore=None, **kwargs)[source]¶ Download project in a fast mode. Items are downloaded asynchronously. If an error occurs, the method will fallback to synchronous download. Automatically detects project type.
- Parameters:
- api¶
Supervisely API address and token.
- project_id : int¶
Supervisely downloadable project ID.
- dest_dir : str¶
Destination directory.
- dataset_ids : List[int], optional¶
Filter datasets by IDs.
- log_progress : bool¶
Show uploading progress bar.
- progress_cb : tqdm or callable, optional¶
Function for tracking download progress.
- semaphore : asyncio.Semaphore, optional¶
Semaphore to limit the number of concurrent downloads of items.
- only_image_tags : bool, optional
Download project with only images tags (without objects tags).
- save_image_info : bool, optional
Download images infos or not.
- save_images : bool, optional
Download images or not.
- save_image_meta : bool, optional
Download images metadata in JSON format or not.
- images_ids : List[int], optional
Filter images by IDs.
- resume_download : bool, optional
Resume download enables to download only missing files avoiding erase of existing files.
- switch_size : int, optional
Size threshold that determines how an item will be downloaded. Items larger than this size will be downloaded as single files, while smaller items will be downloaded as a batch. Useful for projects with different item sizes and when you exactly know which size will perform better with batch download.
- batch_size : int, optional
Number of items to download in a single batch.
- download_blob_files : bool, optional
Download project with Blob files in native format. If False - download project like a regular project in classic Supervisely format.
- project_info :
ProjectInfo, optional Project info object. To avoid additional API requests.
- skip_create_readme : bool, optional
Skip creating README.md file. Default is False.
- Returns:
None
- Return type:
NoneType
- Usage Example:
import os from dotenv import load_dotenv import supervisely as sly # Load secrets and create API object from .env file (recommended) # Learn more here: https://developer.supervisely.com/getting-started/basics-of-authentication if sly.is_development(): load_dotenv(os.path.expanduser("~/supervisely.env")) api = sly.Api.from_env() project_id = 8888 save_directory = "/path/to/save/projects" sly.download_fast(api, project_id, save_directory)