githubEdit

Iterate over a local project

In this article, we will learn how to iterate through a project in Supervisely formatarrow-up-right, which is stored locally on your machine. It is one of the most frequent operations in Superviely Apps and python automation scripts. You will see how easy it is to get all the necessary information from the project, as well as how quickly you can visualize the contents of the project even without internet access.

circle-info

Everything you need to reproduce this tutorial is on GitHubarrow-up-right: source code, Visual Studio code configuration, and a shell script for creating venv.

In this guide we will go through the following steps:

**** Step 1. Get a demo projectarrow-up-right with labeled lemons and kiwis.

**** Step 2. Download the demo project to your local machine in Supervisely format using Export to Supervisely formatarrow-up-right app in Supervisely Ecosystem.

**** Step 3. Run python scriptarrow-up-right.

1. Demo project

If you don't have any projects in Supervisely format on your local machine, go to the ecosystem and add the demo project πŸ‹ Lemons annotated to your current workspace.

Add demo project "Lemons annotated" to your workjspace

2. Download project in Supervisely format

Go to the ecosystem and launch the app Export to Supervisely formatarrow-up-right. Select the demo project, you created in the previous step (or use any existing project in Supervisely), and download the result archive to your local machine.

Run Export to Supervisely format app
Download the result archive

Extract the archive to any folder and check that it has the following structure:

The project root directory contains the meta.json file with the project meta information and directories for each dataset. Each dataset directory contains two subdirectories: img with images and ann with annotations in Supervisely format.

3. Python script

To start debugging you need to:

  1. Set the correct path to the downloaded and extracted project on your local machine in the script main.pyarrow-up-right

Source code:

Output

The script above produces the following output:

As a result of running the script there also will be created a directory results, which will contain the images with drawn annotations.

Result images with drawn annotations

Last updated

Was this helpful?