Skip to content

Commit f22cf21

Browse files
Merge pull request #1172 from computational-cell-analytics/dev
Make activation in UNETR flexble
2 parents 65badb2 + 5a859e1 commit f22cf21

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

micro_sam/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.7.2"
1+
__version__ = "1.7.3"

micro_sam/instance_segmentation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ def get_unetr(
744744
device: Optional[Union[str, torch.device]] = None,
745745
out_channels: int = 3,
746746
flexible_load_checkpoint: bool = False,
747+
final_activation: Optional[str] = "Sigmoid",
747748
) -> torch.nn.Module:
748749
"""Get UNETR model for automatic instance segmentation.
749750
@@ -755,6 +756,7 @@ def get_unetr(
755756
out_channels: The number of output channels. By default, set to '3'.
756757
flexible_load_checkpoint: Whether to allow reinitialization of parameters
757758
which could not be found in the provided decoder state. By default, set to 'False'.
759+
final_activation: The activation applied to the network output. By default uses a Sigmoid activation.
758760
759761
Returns:
760762
The UNETR model.
@@ -777,7 +779,7 @@ def get_unetr(
777779
encoder=image_encoder,
778780
out_channels=out_channels,
779781
use_sam_stats=True,
780-
final_activation="Sigmoid",
782+
final_activation=final_activation,
781783
use_skip_connection=False,
782784
resize_input=True,
783785
use_conv_transpose=use_conv_transpose,

0 commit comments

Comments
 (0)