Skip to content

Commit

Permalink
use vit_b_lm by default
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsmechtel committed Dec 14, 2024
1 parent ffba37a commit b785639
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bioimageio_colab/register_sam_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def test_model_function(**kwargs: dict):


if __name__ == "__main__":
model_name = "vit_b"
model_name = "vit_b_lm"
cache_dir = "./model_cache"
embedding = compute_image_embedding(
cache_dir=cache_dir,
Expand All @@ -261,7 +261,7 @@ def test_model_function(**kwargs: dict):
)
mask = compute_mask(
cache_dir=cache_dir,
model_name="vit_b",
model_name="vit_b_lm",
embedding=embedding,
image_size=(1024, 1024),
point_coords=np.array([[10, 10]]),
Expand Down
2 changes: 1 addition & 1 deletion bioimageio_colab/sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,6 @@ def segment_image(


if __name__ == "__main__":
sam_predictor = load_model_from_ckpt("vit_b", "./model_cache")
sam_predictor = load_model_from_ckpt("vit_b_lm", "./model_cache")
sam_predictor = compute_embedding(sam_predictor, np.random.rand(1024, 1024))
masks = segment_image(sam_predictor, [[10, 10]], [1])
2 changes: 1 addition & 1 deletion plugins/bioimageio-colab-annotator.imjoy.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
this.imageLayer = null; // Layer displaying the image
this.annotationLayer = null; // Layer displaying the annotations
this.edgeColor = "magenta"; // Default edge color for annotations
this.modelName = "vit_b"; // Model name for the embeddings
this.modelName = "vit_b_lm"; // Model name for the embeddings
}

async setup() {
Expand Down
4 changes: 2 additions & 2 deletions test/test_model_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SERVER_URL = "https://hypha.aicell.io"
WORKSPACE_NAME = "bioimageio-colab"
SERVICE_ID = "microsam"
MODEL_NAME = "vit_b"
MODEL_NAME = "vit_b_lm"


def test_service_functions():
Expand Down Expand Up @@ -77,5 +77,5 @@ def test_service_python_api():
# assert len(polygon_features) == 1 # Only one point given

# Test service test run
result = segment_svc.test_model(model_name="vit_b")
result = segment_svc.test_model(model_name="vit_b_lm")
assert result == {"status": "ok"}
2 changes: 1 addition & 1 deletion test/test_sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def test_sam():
sam_predictor = load_model_from_ckpt(model_name="vit_b", cache_dir="./model_cache/")
sam_predictor = load_model_from_ckpt(model_name="vit_b_lm", cache_dir="./model_cache/")
assert os.path.exists("./model_cache/sam_vit_b_01ec64.pth")
image, _ = get_random_image(
image_folder="./bioimageio_colab/",
Expand Down

0 comments on commit b785639

Please sign in to comment.