Skip to content

Commit

Permalink
Add Workflow and upgrade SDK to v6.73.156
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenAnpu committed Aug 14, 2024
1 parent 1424e21 commit 3e9de2d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
13 changes: 4 additions & 9 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
"name": "Export as masks",
"type": "app",
"version": "2.0.0",
"categories": [
"images",
"export"
],
"categories": ["images", "export"],
"description": "For semantic and instance segmentation tasks",
"docker_image": "supervisely/import-export:6.73.145",
"docker_image": "supervisely/import-export:6.73.156",
"instance_version": "6.10.0",
"main_script": "src/main.py",
"modal_template": "src/modal.html",
Expand All @@ -22,10 +19,8 @@
"icon_background": "#FFFFFF",
"headless": true,
"context_menu": {
"target": [
"images_project"
],
"target": ["images_project"],
"context_root": "Download as"
},
"poster": "https://user-images.githubusercontent.com/106374579/186664538-21e06509-7372-44db-9f0e-512be05cad91.png"
}
}
1 change: 1 addition & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
supervisely==6.73.156
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

18 changes: 9 additions & 9 deletions src/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ def workflow_output(api: sly.Api, file: Union[int, sly.api.file_api.FileInfo]):
try:
if isinstance(file, int):
file = api.file.get_info_by_id(file)
meta = {"customRelationSettings": {
"icon": {
"icon": "zmdi-archive",
"color": "#33c94c",
"backgroundColor": "#d9f7e4"
},
"title": f"<h4>{file.name}</h4>",
"mainLink": {"url": f"/files/{file.id}/true/?teamId={file.team_id}", "title": "Download"}
}}
relation_settings = sly.WorkflowSettings(
title=file.name,
icon="archive",
icon_color="#33c94c",
icon_bg_color="#d9f7e4",
url=f"/files/{file.id}/true/?teamId={file.team_id}",
url_title="Download",
)
meta = sly.WorkflowMeta(relation_settings=relation_settings)
api.app.workflow.add_output_file(file, meta=meta)
sly.logger.debug(f"Workflow: Output file - {file}")
except Exception as e:
Expand Down

0 comments on commit 3e9de2d

Please sign in to comment.