Repository navigation
feat: add LiteMobileUnet5ch and model selection through env - #79
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a second 2.5D segmentation network based on architecture suggested by nnUnet plans with mobile blocks and makes it the default. The existing 3-channel MobileNetV3 U-Net stays available, and which model runs is chosen with an environment variable.
Summary
MobilenetV3Unet3ChLiteMobileUNet5Ch, 5-channel U-Net with a MobileNet-style encoder, modelled after nnUnet plans based on the dataset. Seven encoder stages of plain inverted residuals (blocks mobilenetv3 uses) go down to 1/64 resolution, and the decoder uses depthwise-separable blocks. Each slice is stacked with two pairs of neighbours, at ±9 and ±27 slices (SliceContext25D5Channel, edges clamped). Z-score normalisation runs on the volume before that stacking, so all five channels share one set of statistics.Selecting a model
Model can now be configured through the environmental variables:
TOOTH_MODELpicks lite_mobile_unet_5ch (default) or mobilenetv3_unet_3ch.TOOTH_MODEL_PATHstill points at an ONNX file and overrides the above.