Download project

iPython Project Created 4 days ago Free
How to download project (images + annotations)
Free Signup

Download project

How to download Project (images + annotations) from Supervisely to local folder


  • Existing Project in Supervisely


  • Supervisely format Project in local folder


Edit the following settings for your own case

In [1]:
import supervisely_lib as sly
import os
In [2]:
team_name = "jupyter_tutorials"
workspace_name = "First Workspace"
project_name = "tutorial_project"
save_directory = './tutorial_project'

# Obtain server address and your api_token from environment variables
# Edit those values if you run this notebook on your own PC
address = os.environ['SERVER_ADDRESS']
token = os.environ['API_TOKEN']
In [3]:
# Initialize API object
api = sly.Api(address, token)

Verify input values

Test that context (team / workspace / project) exists

In [4]:
# get IDs of team, workspace and project by names

team =
if team is None:
    raise RuntimeError("Team {!r} not found".format(team_name))

workspace = api.workspace.get_info_by_name(, workspace_name)
if workspace is None:
    raise RuntimeError("Workspace {!r} not found".format(workspace_name))
project = api.project.get_info_by_name(, project_name)
if project is None:
    raise RuntimeError("Project {!r} not found".format(project_name))
print("Team: id={}, name={}".format(,
print("Workspace: id={}, name={}".format(,
print("Project: id={}, name={}".format(,
Out [4]:
Team: id=30, name=jupyter_tutorials
Workspace: id=71, name=First Workspace
Project: id=864, name=tutorial_project

Create local Project and download remote images

In [5]:
# create Project object for writing data in supervisely format  
project_fs = sly.Project(save_directory, sly.OpenMode.CREATE)
In [6]:
# download meta of remote project and save it to directory 
meta_json = api.project.get_meta(
meta = sly.ProjectMeta.from_json(meta_json)
In [7]:
# iterate over remote datasets and images, download image and corresponding annotation, save item (img+ann pair) to directory 
for dataset in api.dataset.get_list(
    dataset_fs = project_fs.create_dataset(
    for img_info in api.image.get_list(
        ann_info =
        ann = sly.Annotation.from_json(ann_info.annotation, meta)
        img = api.image.download_np(
        dataset_fs.add_item_np(, img, img_info.ext, ann)
In [8]:
print("Project {!r} has been successfully downloaded".format(project_name))
print("Total number of images: ", project_fs.total_items)
Out [8]:
Project 'tutorial_project' has been successfully downloaded
Total number of images:  5
In [9]:
# create tar archive in order to download project as file from jupyter lab
sly.fs.archive_directory('tutorial_project', tar_path='tutorial_project.tar')

# remove project folder if need

More Info

First released
4 days ago
Last updated
3 hours ago