From 392677031e96f48df1fa4f08d34bbb8794d6dd83 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:21:58 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md | 2 +- vista3d/README.md | 2 +- vista3d/data/README.md | 2 +- vista3d/scripts/debugger.py | 10 +++++++--- vista3d/scripts/train.py | 12 ++++++------ .../scripts/validation/build_vista3d_eval_only.py | 1 - vista3d/vista3d/modeling/vista3d.py | 1 - 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 35ad825..33fec7a 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,4 @@ limitations under the License. --> # MONAI VISTA Repository -This is the repository for VISTA3D and VISTA2D For the older VISTA2.5d code, please checkout the vista2.5d branch \ No newline at end of file +This is the repository for VISTA3D and VISTA2D For the older VISTA2.5d code, please checkout the vista2.5d branch diff --git a/vista3d/README.md b/vista3d/README.md index 9ce85fd..1ac5bc9 100644 --- a/vista3d/README.md +++ b/vista3d/README.md @@ -128,7 +128,7 @@ Ask and answer questions on [MONAI VISTA's GitHub discussions tab](https://githu ## License -The codebase is under Apache 2.0 Licence. The model weight is under special NVIDIA license. +The codebase is under Apache 2.0 Licence. The model weight is under special NVIDIA license. ## Reference diff --git a/vista3d/data/README.md b/vista3d/data/README.md index 3fbdde0..03354c3 100644 --- a/vista3d/data/README.md +++ b/vista3d/data/README.md @@ -81,7 +81,7 @@ The output of this step is multiple JSON files, each file corresponds to one dataset. ##### 2. Add label_dict.json and label_mapping.json -Add new class indexes to `label_dict.json` and the local to global mapping to `label_mapping.json`. +Add new class indexes to `label_dict.json` and the local to global mapping to `label_mapping.json`. ## SupverVoxel Generation 1. Download the segment anything repo and download the ViT-H weights diff --git a/vista3d/scripts/debugger.py b/vista3d/scripts/debugger.py index c924862..b2568f4 100644 --- a/vista3d/scripts/debugger.py +++ b/vista3d/scripts/debugger.py @@ -123,8 +123,12 @@ def on_button_click(event, ax=ax): print("-- segmenting ---") self.generate_mask() print("-- done ---") - print("-- Note: Point only prompts will only do 128 cubic segmentation, a cropping artefact will be observed. ---") - print("-- Note: Point without class will be treated as supported class, which has worse zero-shot ability. Try class > 132 to perform better zeroshot. ---") + print( + "-- Note: Point only prompts will only do 128 cubic segmentation, a cropping artefact will be observed. ---" + ) + print( + "-- Note: Point without class will be treated as supported class, which has worse zero-shot ability. Try class > 132 to perform better zeroshot. ---" + ) print("-- Note: CTRL + Right Click will be adding negative points. ---") print( "-- Note: Click points on different foreground class will cause segmentation conflicts. Clear first. ---" @@ -132,7 +136,7 @@ def on_button_click(event, ax=ax): print( "-- Note: Click points not matching class prompts will also cause confusion. ---" ) - + self.update_slice(ax) # self.point_start = len(self.clicked_points) diff --git a/vista3d/scripts/train.py b/vista3d/scripts/train.py index e7c4ef5..e9beb8e 100644 --- a/vista3d/scripts/train.py +++ b/vista3d/scripts/train.py @@ -27,6 +27,12 @@ import torch import torch.distributed as dist import yaml +from data.datasets import ( + compute_dataset_weights, + get_class_names, + get_datalist_with_dataset_name, + get_datalist_with_dataset_name_and_transform, +) from monai import transforms from monai.apps.auto3dseg.auto_runner import logger from monai.apps.utils import DEFAULT_FMT @@ -41,12 +47,6 @@ from torch.utils.tensorboard import SummaryWriter from tqdm import tqdm -from data.datasets import ( - compute_dataset_weights, - get_class_names, - get_datalist_with_dataset_name, - get_datalist_with_dataset_name_and_transform, -) from vista3d import vista_model_registry from .sliding_window import sliding_window_inference diff --git a/vista3d/scripts/validation/build_vista3d_eval_only.py b/vista3d/scripts/validation/build_vista3d_eval_only.py index 4385886..b5e016a 100644 --- a/vista3d/scripts/validation/build_vista3d_eval_only.py +++ b/vista3d/scripts/validation/build_vista3d_eval_only.py @@ -16,7 +16,6 @@ import numpy as np import torch from monai.metrics import compute_dice - from vista3d.modeling import ( VISTA3D2, Class_Mapping_Classify, diff --git a/vista3d/vista3d/modeling/vista3d.py b/vista3d/vista3d/modeling/vista3d.py index 8352ba9..a67b660 100644 --- a/vista3d/vista3d/modeling/vista3d.py +++ b/vista3d/vista3d/modeling/vista3d.py @@ -16,7 +16,6 @@ import torch import torch.nn as nn from monai.utils import optional_import - from scripts.utils.trans_utils import convert_points_to_disc from scripts.utils.trans_utils import get_largest_connected_component_mask as lcc from scripts.utils.workflow_utils import sample_points_patch_val