Skip to content

Commit

Permalink
Refactor workflow to remove duplicate project_infos
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenAnpu committed Aug 27, 2024
1 parent fa0e22a commit 307c9a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,16 @@ def workflow_output(
layer.sly_project_info for layer in job_layers
]
project_infos.extend(job_project_infos)
project_infos = list(set(project_infos))
# --------------------------------------- Remove Duplicates -------------------------------------- #
unique_project_infos = {project_info.id: project_info for project_info in project_infos}
project_infos = list(unique_project_infos.values())
# ------------------------------------- Remove Duplicates End ------------------------------------ #
job_infos: Optional[List[LabelingJobInfo]] = [
job for layer in job_layers for job in layer.created_labeling_jobs
]
except Exception as e:
sly.logger.debug(
f"Workflow: Provided data is not valid. Failed to add output to the workflow: {repr(e)}"
f"Workflow: Provided data for output is not valid or processed with errors: {repr(e)}"
)

try:
Expand Down

0 comments on commit 307c9a2

Please sign in to comment.