From 0e9a4d923bf7102491e2cc287d44d07e16f87a6d Mon Sep 17 00:00:00 2001 From: Almaz <79905215+almazgimaev@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:18:09 +0100 Subject: [PATCH] Upgrade SDK to v6.73.170. Support for hierarchical datasets (#8) --- config.json | 4 ++-- dev_requirements.txt | 2 +- docker/Dockerfile | 3 ++- src/main.py | 11 ++++++++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/config.json b/config.json index 10ec46f..8292ca2 100644 --- a/config.json +++ b/config.json @@ -4,7 +4,7 @@ "name": "Explore data with embeddings", "description": "Calculate and visualize embeddings", "entrypoint": "python -m uvicorn src.main:app --host 0.0.0.0 --port 8000", - "docker_image": "supervisely/embeddings_app:1.0.1", + "docker_image": "supervisely/embeddings_app:1.0.2", "port": 8000, "icon": "https://user-images.githubusercontent.com/115161827/211832834-eef9325d-9e00-4499-ae42-2e7ee3d97f1a.png", "icon_cover": true, @@ -26,7 +26,7 @@ "target": ["images_project", "images_dataset"], "context_category": "Metric Learning" }, - "instance_version": "6.9.22", + "instance_version": "6.11.10", "need_gpu": false, "gpu": "preferred", "community_agent": false diff --git a/dev_requirements.txt b/dev_requirements.txt index aef483f..9cf8c9f 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,4 +1,4 @@ -supervisely==6.72.134 +supervisely==6.72.170 transformers==4.33.2 timm==0.9.5 torch diff --git a/docker/Dockerfile b/docker/Dockerfile index 6452ab7..7239855 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -11,4 +11,5 @@ RUN pip3 install transformers==4.33.2 timm==0.9.5 scikit-learn==1.3.1 umap-learn # Download metaclip base model RUN python -c 'import transformers; transformers.AutoModel.from_pretrained("facebook/metaclip-b16-fullcc2.5b")' -LABEL python_sdk_version=6.73.90 +RUN pip3 install supervisely==6.73.170 +LABEL python_sdk_version=6.73.170 diff --git a/src/main.py b/src/main.py index 074532f..a23c01e 100644 --- a/src/main.py +++ b/src/main.py @@ -24,6 +24,7 @@ Field, Progress, SelectDataset, + SelectDatasetTree, NotificationBox, ) @@ -72,7 +73,7 @@ def update_globals(new_dataset_ids): ### Dataset selection -dataset_selector = SelectDataset(project_id=project_id, multiselect=True, select_all_datasets=True) +dataset_selector = SelectDatasetTree(project_id=project_id, multiselect=True, select_all_datasets=True) card_project_settings = Card(title="Dataset selection", content=dataset_selector) ### Model selection @@ -281,6 +282,14 @@ def update_table(): @btn_run.click def run(): global model_name, global_idxs_mapping, all_info_list # , project_meta, dataset_ids, project_id, workspace_id, team_id + + selected_datasets = set() + for dataset_id in dataset_selector.get_selected_ids(): + selected_datasets.add(dataset_id) + for ds in api.dataset.get_nested(project_id=project_id, dataset_id=dataset_id): + selected_datasets.add(ds.id) + update_globals(list(selected_datasets)) + info_run.description = "" card_embeddings_chart.hide() btn_mark.hide()