-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Error message in the console:
SAM2 Large experienced an error: Currently EfficientViTSAMJ only supports 1-channel (grayscale) or 3-channel (RGB, BGR, ...) 2D images.The image dimensions order should be 'xyc', first dimension width, second height and third channels.
java.lang.IllegalArgumentException: Currently EfficientViTSAMJ only supports 1-channel (grayscale) or 3-channel (RGB, BGR, ...) 2D images.The image dimensions order should be 'xyc', first dimension width, second height and third channels.
at ai.nets.samj.models.Sam2.checkImageIsFine(Sam2.java:375)
at ai.nets.samj.models.Sam2.setImageOfInterest(Sam2.java:278)
at ai.nets.samj.models.AbstractSamJ.setImage(AbstractSamJ.java:297)
at ai.nets.samj.communication.model.SAM2Large.setImage(SAM2Large.java:128)
at ai.nets.samj.gui.ModelSelection.loadModel(ModelSelection.java:75)
at ai.nets.samj.gui.MainGUI.lambda$loadModel$15(MainGUI.java:248)
at java.base/java.lang.Thread.run(Unknown Source)
To reproduce:
- File > Open Samples > Neuron (5 channels)
- SAMJ Annotator > SAM2 Large model > Go!
Suggested fix is two-fold:
- Change the language not to hardcode the name
EfficientViTSAMJwhich is confusing when the model is not EfficientViTSAM. - Rather than dumping the stack trace to the console, display an error dialog box using
IJ.error("SAMJ Annotator", errorMessage);. Dump the stack trace using the SciJavaLogService'sdebugmethod, so that it only pops up the console while running in debug mode.
Metadata
Metadata
Assignees
Labels
No labels