-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
headless app for guide in Supervisely developer portal (#1)
* readme done * headless Co-authored-by: Maxim Kolomeychenko <maxim@supervise.ly>
- Loading branch information
1 parent
7769a94
commit c6e0400
Showing
14 changed files
with
108 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/secret_debug.env | ||
.venv | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: Current File", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal", | ||
"justMyCode": true, | ||
"env": { | ||
"PYTHONPATH": "${workspaceFolder}:${PYTHONPATH}" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"python.defaultInterpreterPath": ".venv/bin/python", | ||
"files.exclude": { | ||
"**/__pycache__": true, | ||
".venv": true | ||
}, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnType": true, | ||
"[html]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"python.formatting.provider": "black", | ||
"debug.inlineValues": "off", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,20 @@ | ||
# hello-world-app | ||
Supervisely hello world app - use it as a template for your custom appliation or for debug purposes | ||
|
||
<div align="center" markdown> | ||
<img src="https://user-images.githubusercontent.com/12828725/182181033-d0d1a690-8388-472e-8862-e0cacbd4f082.png"/> | ||
|
||
# Hello World App | ||
|
||
<p align="center"> | ||
<a href="#Overview">Overview</a> • | ||
<a href="#How-to-use">How To Use</a> | ||
</p> | ||
|
||
</div> | ||
|
||
# Overview | ||
|
||
Explain here what your app does. | ||
|
||
# How to use | ||
|
||
Step by step guide with examples and demos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
{ | ||
"name": "Hello World App", | ||
"name": "Hello World!", | ||
"type": "app", | ||
"categories": [ | ||
"development" | ||
], | ||
"description": "Working demo, use it as a template for your custom apps", | ||
"docker_image": "supervisely/base-py-sdk:6.35.0", | ||
"main_script": "src/my_main_script.py", | ||
"modal_template": "src/modal.html", | ||
"modal_template_state": { | ||
"length": 5 | ||
}, | ||
"gui_template": "src/gui.html", | ||
"task_location": "application_sessions", | ||
"isolate": true, | ||
"icon": "https://img.icons8.com/fluent/96/000000/source-code.png", | ||
"categories": ["development"], | ||
"description": "Demonstrates how to turn your python script into Supervisely App", | ||
"docker_image": "supervisely/base-py-sdk:6.50.0", | ||
"main_script": "src/main.py", | ||
"task_location": "workspace_tasks", | ||
"icon": "https://user-images.githubusercontent.com/12828725/182186256-5ee663ad-25c7-4a62-9af1-fbfdca715b57.png", | ||
"icon_background": "#FFFFFF" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# learn more in documentation | ||
# Official python docs: https://docs.python.org/3/library/venv.html | ||
# Superviely developer portal: https://developer.supervise.ly/getting-started/installation#venv | ||
|
||
if [ -d "venv" ]; then | ||
echo "VENV already exists, will be removed" | ||
rm -rf .venv | ||
fi | ||
|
||
echo "VENV will be created" && \ | ||
python3 -m venv .venv && \ | ||
source .venv/bin/activate && \ | ||
|
||
echo "Install requirements..." && \ | ||
pip3 install -r requirements.txt && \ | ||
echo "Requirements have been successfully installed" && \ | ||
deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
context.userLogin="max" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
supervisely==6.50.0 | ||
|
||
# used to print cool text to stdout | ||
art==5.7 | ||
|
||
# my favorite code formatter | ||
black==22.6.0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
import supervisely as sly | ||
from dotenv import load_dotenv | ||
from art import tprint | ||
|
||
load_dotenv("local.env") | ||
|
||
|
||
def main(): | ||
name = os.environ["context.userLogin"] | ||
print("Hello World!") | ||
print("This app is run by user:") | ||
tprint(name) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.