Skip to content

Commit

Permalink
Merge pull request #13 from supervisely-ecosystem/download-async
Browse files Browse the repository at this point in the history
Improved Project Downloading
  • Loading branch information
GoldenAnpu authored Dec 21, 2024
2 parents f50dd5b + 96ca3eb commit 9b09916
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 67 deletions.
32 changes: 16 additions & 16 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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",
}
}
]
}
"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"
}
}
]
}
43 changes: 21 additions & 22 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"
},
}
"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
}
}
44 changes: 22 additions & 22 deletions config.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
supervisely==6.73.158
supervisely==6.73.259

# formatter
black
Expand Down
10 changes: 5 additions & 5 deletions local.env
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 3 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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,
Expand Down

0 comments on commit 9b09916

Please sign in to comment.