Skip to content

Commit d28edb3

Browse files
committed
fix: minor bug fixes
1 parent 94efc3b commit d28edb3

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

cellseg_models_pytorch/inference/_base_inferer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def __init__(
3636
n_images: int = None,
3737
type_post_proc: Callable = None,
3838
sem_post_proc: Callable = None,
39+
verbose: bool = False,
3940
**kwargs,
4041
) -> None:
4142
"""Inference for an image folder.
@@ -150,8 +151,9 @@ def __init__(
150151
except BaseException as e:
151152
raise RuntimeError(f"Error when loading checkpoint: {e}")
152153

153-
print(f"Loading weights: {checkpoint_path} for inference.")
154-
print(msg)
154+
if verbose:
155+
print(f"Loading weights: {checkpoint_path} for inference.")
156+
print(msg)
155157

156158
assert device in ("cuda", "cpu", "mps")
157159
if device == "cpu":

cellseg_models_pytorch/models/cellvit/cellvit.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ def cellvit_sam_base(
309309
Parameters
310310
----------
311311
enc_name : str
312-
Name of the encoder. One of: "sam_vit_b", "sam_vit_l", "sam_vit_h",
312+
Name of the encoder. One of: "samvit_base_patch16", "samvit_base_patch16_224",
313+
"samvit_huge_patch16", "samvit_large_patch16"
313314
type_classes : int
314315
Number of type classes.
315316
inst_classes : int, default=2
@@ -350,7 +351,8 @@ def cellvit_sam_plus(
350351
Parameters
351352
----------
352353
enc_name : str
353-
Name of the encoder. One of: "sam_vit_b", "sam_vit_l", "sam_vit_h",
354+
Name of the encoder. One of: "samvit_base_patch16", "samvit_base_patch16_224",
355+
"samvit_huge_patch16", "samvit_large_patch16"
354356
type_classes : int
355357
Number of type-branch classes.
356358
sem_classes : int
@@ -388,7 +390,8 @@ def cellvit_sam_small(enc_name: str, type_classes: int, **kwargs) -> nn.Module:
388390
Parameters
389391
----------
390392
enc_name : str
391-
Name of the encoder. One of: "sam_vit_b", "sam_vit_l", "sam_vit_h",
393+
Name of the encoder. One of: "samvit_base_patch16", "samvit_base_patch16_224",
394+
"samvit_huge_patch16", "samvit_large_patch16"
392395
type_classes : int
393396
Number of type-branch classes.
394397
**kwargs:
@@ -423,7 +426,8 @@ def cellvit_sam_small_plus(
423426
Parameters
424427
----------
425428
enc_name : str
426-
Name of the encoder. One of: "sam_vit_b", "sam_vit_l", "sam_vit_h",
429+
Name of the encoder. One of: "samvit_base_patch16", "samvit_base_patch16_224",
430+
"samvit_huge_patch16", "samvit_large_patch16"
427431
type_classes : int
428432
Number of type-branch classes.
429433
sem_classes : int

0 commit comments

Comments
 (0)