Part 1 — Hello world! [From your Python script to Supervisely APP]
In this part, we will show you how you can turn any Python code into a Supervisely application
Table of contents
Step 1 — Python code
Let's start with a simple python code.
src/main.py
worlds = ['Westeros', 'Azeroth', 'Middle Earth', 'Narnia']
for world in worlds:
print(f'Hello {world}!')
Step 2 — Configuration file
Config file. We. Need. It.
To add a Python application to Supervisely, let's create a configuration file for it. An example of a config file:
config.json
Pay attention to important fields:
docker_image — SDK version you were using, it doesn't matter in this app
main_script — path from repository root to main.py (entry point)
Step 3 — Repository setup
In this step, we create a repository and add our code to it.
1. Generate new personal token
Open GitHub → Settings → Developer settings → Personal access tokens
Click Generate new token
Select "repo" access scope and click "Generate token" button.
Save generated token — you will need it later.
2. Create GitHub repository
Let's create a new GitHub repository that we will use to deploy a new Supervisely application. Create a new private GitHub repository:
3. Push app to repository
Make sure you have collected all the required files:
Then just push files to git:
Step 4 — Add app to Supervisely
We've almost reached the finish line!
It remains to add the application to the Ecosystem.
1. Go to the Private Apps section
2. Add your application
Pay attention:
In the Github repository URL field, specify the link to the directory containing the application's config.json
In the GitHub personal access token field, paste your token that you saved in step 1
add private app credentials Step 5 — Results
Hello World!