Skip to content

Commit

Permalink
add launch from dataset (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
vorozhkog authored Nov 7, 2024
1 parent 21315f4 commit cb8287e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"headless": true,
"context_menu": {
"target": [
"images_project"
"images_project",
"images_dataset"
],
"context_root": "Download as"
},
Expand Down
1 change: 1 addition & 0 deletions src/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
team_id = sly.env.team_id()
workspace_id = sly.env.workspace_id()
project_id = sly.env.project_id()
dataset_id = sly.env.dataset_id(raise_not_found=False)

PASCAL_CONTOUR_THICKNESS = int(os.environ["modal.state.pascalContourThickness"])
TRAIN_VAL_SPLIT_COEF = float(os.environ["modal.state.trainSplitCoef"])
Expand Down
6 changes: 5 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def from_sly_to_pascal(api: sly.Api):
images_stats = []
classes_colors = {}

datasets = api.dataset.get_list(g.project_id, recursive=True)
if g.dataset_id is None:
datasets = api.dataset.get_list(g.project_id, recursive=True)
else:
datasets = [api.dataset.get_info_by_id(g.dataset_id)]

dataset_names = ["trainval", "val", "train"]
progress = sly.Progress(
"Preparing images for export", api.project.get_images_count(g.project_id), sly.logger
Expand Down

0 comments on commit cb8287e

Please sign in to comment.