Skip to content

Commit 58af092

Browse files
authored
Merge pull request #22 from supervisely-ecosystem/workflow
Add Workflow and upgrade SDK to v6.73.158
2 parents 645aa8e + b4885c7 commit 58af092

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"data operations"
1010
],
1111
"description": "Creates images project from video project",
12-
"docker_image": "supervisely/data-operations:6.73.70",
13-
"min_instance_version": "6.8.54",
12+
"docker_image": "supervisely/data-operations:6.73.158",
13+
"min_instance_version": "6.10.0",
1414
"main_script": "src/main.py",
1515
"modal_template": "src/modal.html",
1616
"modal_template_state": {

dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
supervisely==6.73.70
1+
supervisely==6.73.158

src/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
import functions as f
88

99
import globals as g
10+
import workflow as w
1011

1112

1213
def turn_into_images_project(api: sly.Api):
1314
res_project_name = f"{g.project.name}(images)"
15+
w.workflow_input(api, g.project.id)
1416
dst_project = api.project.create(
1517
g.workspace_id,
1618
res_project_name,
@@ -158,7 +160,7 @@ def turn_into_images_project(api: sly.Api):
158160
sly.logger.info(
159161
f"video {video_info.name} converted in {time() - general_time} seconds"
160162
)
161-
163+
w.workflow_output(api, dst_project.id)
162164

163165
if __name__ == "__main__":
164166
turn_into_images_project(g.api)

src/workflow.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This module contains the functions that are used to configure the input and output of the workflow for the current app.
2+
3+
import supervisely as sly
4+
5+
6+
def workflow_input(api: sly.Api, project_id: int):
7+
api.app.workflow.add_input_project(int(project_id))
8+
sly.logger.debug(f"Workflow: Input project - {project_id}")
9+
10+
11+
def workflow_output(api: sly.Api, project_id: int):
12+
api.app.workflow.add_output_project(project_id)
13+
sly.logger.debug(f"Workflow: Output project - {project_id}")

0 commit comments

Comments
 (0)