Skip to content

Commit

Permalink
Upgrade SDK to v6.73.170. Support for hierarchical datasets (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
almazgimaev authored Dec 3, 2024
1 parent 4bcbbc1 commit 0e9a4d9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
supervisely==6.72.134
supervisely==6.72.170
transformers==4.33.2
timm==0.9.5
torch
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 10 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Field,
Progress,
SelectDataset,
SelectDatasetTree,
NotificationBox,
)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 0e9a4d9

Please sign in to comment.