diff --git a/.vscode/launch.json b/.vscode/launch.json index 6b39db4..191c8d0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,17 +1,17 @@ { - "version": "0.2.0", - "configurations": [ - { - "name": "Python: Current File", - "type": "python", - "request": "launch", - "program": "src/main.py", - "console": "integratedTerminal", - "justMyCode": false, - "env": { - "PYTHONPATH": "${workspaceFolder}:${PYTHONPATH}", - "LOG_LEVEL": "DEBUG", - } - } - ] -} \ No newline at end of file + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Current File", + "type": "debugpy", + "request": "launch", + "program": "src/main.py", + "console": "integratedTerminal", + "justMyCode": false, + "env": { + "PYTHONPATH": "${workspaceFolder}:${PYTHONPATH}", + "LOG_LEVEL": "DEBUG" + } + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 9d155ad..1e298de 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,23 +1,22 @@ { - "python.defaultInterpreterPath": ".venv/bin/python", - "files.exclude": { - "**/__pycache__": true, - ".venv": true, - }, - "black-formatter.args": [ - "--line-length", - "100" - ], - "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter", - }, - "editor.formatOnSave": true, - "editor.formatOnPaste": false, - "editor.formatOnType": true, - "[html]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, -} \ No newline at end of file + "python.defaultInterpreterPath": ".venv/bin/python", + "files.exclude": { + "**/__pycache__": true, + ".venv": true + }, + "black-formatter.args": ["--line-length", "100"], + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter" + }, + "editor.formatOnSave": true, + "editor.formatOnPaste": false, + "editor.formatOnType": true, + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.insertSpaces": false, + "editor.tabSize": 4 + } +} diff --git a/config.json b/config.json index affe2da..bb3fe29 100644 --- a/config.json +++ b/config.json @@ -1,24 +1,24 @@ { - "name": "Export videos project in Supervisely format", - "type": "app", - "categories": ["videos", "export"], - "description": "Export videos project and prepares downloadable tar archive", - "docker_image": "supervisely/import-export:6.73.158", - "instance_version": "6.10.0", - "main_script": "src/main.py", - "modal_template": "src/modal.html", - "modal_template_state": { - "items": "True" - }, - "task_location": "workspace_tasks", - "isolate": true, - "headless": true, - "icon": "https://user-images.githubusercontent.com/48913536/175979192-3b62a77c-15ac-4970-8767-e75c5864dd7d.png", - "icon_cover": true, - "icon_background": "#FFFFFF", - "context_menu": { - "target": ["videos_project", "videos_dataset"], - "context_root": "Download as" - }, - "poster": "https://user-images.githubusercontent.com/48245050/182545646-8af0b01f-d196-457f-a506-1cd2e0497f04.png" + "name": "Export videos project in Supervisely format", + "type": "app", + "categories": ["videos", "export"], + "description": "Export videos project and prepares downloadable tar archive", + "docker_image": "supervisely/import-export:6.73.259", + "instance_version": "6.12.12", + "main_script": "src/main.py", + "modal_template": "src/modal.html", + "modal_template_state": { + "items": "True" + }, + "task_location": "workspace_tasks", + "isolate": true, + "headless": true, + "icon": "https://user-images.githubusercontent.com/48913536/175979192-3b62a77c-15ac-4970-8767-e75c5864dd7d.png", + "icon_cover": true, + "icon_background": "#FFFFFF", + "context_menu": { + "target": ["videos_project", "videos_dataset"], + "context_root": "Download as" + }, + "poster": "https://user-images.githubusercontent.com/48245050/182545646-8af0b01f-d196-457f-a506-1cd2e0497f04.png" } diff --git a/dev_requirements.txt b/dev_requirements.txt index c5a5e0d..52e25ca 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,4 +1,4 @@ -supervisely==6.73.158 +supervisely==6.73.259 # formatter black diff --git a/local.env b/local.env index 4d05551..fa9b4c9 100644 --- a/local.env +++ b/local.env @@ -1,10 +1,10 @@ PYTHONUNBUFFERED=1 -TASK_ID=27623 +TASK_ID=69936 -context.teamId=8 -context.workspaceId=349 -modal.state.slyProjectId=15092 -modal.state.slyDatasetId=55239 +# context.teamId=8 +# context.workspaceId=349 +modal.state.slyProjectId=42112 +# modal.state.slyDatasetId=55239 modal.state.items=true diff --git a/src/main.py b/src/main.py index 8eecd0a..d9c77a0 100644 --- a/src/main.py +++ b/src/main.py @@ -1,10 +1,12 @@ import os import supervisely as sly +from supervisely.project.download import download_async_or_sync import globals as g import workflow as w + @g.my_app.callback("export-videos-project-in-supervisely-format") @sly.timeit def export_videos_project_in_supervisely_format(api: sly.Api, task_id, context, state, app_logger): @@ -24,7 +26,7 @@ def export_videos_project_in_supervisely_format(api: sly.Api, task_id, context, sly.team_files.RECOMMENDED_EXPORT_PATH, f"{g.RESULT_DIR_NAME}/{archive_name}" ) - sly.download_video_project( + download_async_or_sync( api=api, project_id=g.PROJECT_ID, dest_dir=result_dir,