From 6073ddde650a105967da5dc3e745c7edfa44dd0b Mon Sep 17 00:00:00 2001 From: unfinity Date: Mon, 1 Jul 2024 15:06:39 +0000 Subject: [PATCH] improved descriptions --- .vscode/launch.json | 1 - src/main.py | 10 +++++----- src/run_utils.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index afd8f95..2fa601e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -14,7 +14,6 @@ "8000", "--ws", "websockets", - "--reload" ], "jinja": true, "justMyCode": false, diff --git a/src/main.py b/src/main.py index 27a0693..288bebb 100644 --- a/src/main.py +++ b/src/main.py @@ -135,7 +135,7 @@ def update_globals(new_dataset_ids): input_expand_wh_f = Field( input_expand_wh, "Expand crops (px)", - "Expand rectangles of the cropped objects by a few pixels on both XY sides. Use it to give the model a little context on the boundary of objects.", + "Expand bounding boxes by the given number of pixels on all sides (both X and Y axes). This helps provide the model with some context around the boundaries of the objects.", ) content = Container([select_instance_mode_f, input_expand_wh_f]) card_preprocessing_settings = Card(title="Preprocessing settings", content=content, collapsable=True) @@ -344,7 +344,7 @@ def run(): api.file.download(team_id, "/" + save_paths["projections"], save_paths["projections"]) projections = torch.load(save_paths["projections"]) else: - info_run.description += "calculating projections...
" + info_run.description += "Calculating projections...
" print("calculating projections...") if len(embeddings) <= 1: info_run.description += f"the count of embeddings (n={len(embeddings)}) must be > 1
" @@ -353,7 +353,7 @@ def run(): projections = run_utils.calculate_projections(embeddings, all_info_list, projection_method, metric=metric) except RuntimeError: info_run.description += ( - f"the count of embeddings is {len(embeddings)}, it is too small to project with UMAP, trying PCA...
" + f"the count of embeddings is {len(embeddings)}, not enough to use UMAP. Trying PCA instead...
" ) projection_method = "PCA" projections = run_utils.calculate_projections(embeddings, all_info_list, projection_method, metric=metric) @@ -368,7 +368,7 @@ def run(): url = sly.utils.abs_url(f"files/{file_id}") else: url = f"/files/{file_id}" - info_run.description += f"all was saved to team_files: {save_paths['embeddings']}
" + info_run.description += f"Embeddings were saved to Team Files: {save_paths['embeddings']}
" # 6. Show chart obj_classes = list(set(all_info["object_cls"])) @@ -379,7 +379,7 @@ def run(): chart.set_series(series, send_changes=True) card_embeddings_chart.show() update_table() - info_run.description += "done!
" + info_run.description += "Done!
" def get_or_create_tag_meta(project_id, tag_meta): diff --git a/src/run_utils.py b/src/run_utils.py index 86d7500..5da34d9 100644 --- a/src/run_utils.py +++ b/src/run_utils.py @@ -38,7 +38,7 @@ def calculate_projections(embeddings, all_info_list, projection_method, metric=" raise ValueError(f"unexpexted projection_method {projection_method}") except Exception as e: print(e) - raise RuntimeError(f"count of embeddings = {len(embeddings)}, it may too small to project") + raise RuntimeError(f"count of embeddings = {len(embeddings)}, not enough to calculate projections.") return projections