Problem with segment anything model

64 views (last 30 days)
Anthony
Anthony on 21 Nov 2024 at 16:24
Answered: Jaimin about 18 hours ago
Hi,
I would like to use the segment anything model that was released on 2024a and 2024b versions of matlab.
I have checked that all the necessary toolboxes (Image processing, Deep learning and Computer vision) were installed but I still have a problem when trying to run it (either through the segmentAnythingModel command; or through imsegsam; or through the image segmenter app).
The following error saying that the computer vision toolbox is missing appear:
Error using images.internal.sam.configureAndLoadSAM
Using Segment Anything Model is missing the following dependencies:
* Computer Vision Toolbox™
Install missing toolboxes:
* Computer Vision Toolbox™
Error in segmentAnythingModel (line 70)
data = images.internal.sam.configureAndLoadSAM();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I don't know what to do as the toolbox is clearly installed and up to date.
Thank you,
Anthony
  2 Comments
Jacob Mathew
Jacob Mathew on 21 Nov 2024 at 18:08
Edited: Jacob Mathew on 21 Nov 2024 at 18:08
Hey Anthony,
You can list the Add Ons installed in your MATLAB Installation using the following command:
matlab.addons.installedAddons
Could you share the output of the command in its entirety?
Anthony
Anthony on 22 Nov 2024 at 12:25
Hi Jacob,
Sure here is the list of addons:
Name Version Enabled Identifier
___________________________________________________________ ________ _______ ______________________________________
"Filter Design HDL Coder" "24.2" true "FH"
"Industrial Communication Toolbox" "24.2" true "OT"
"Simscape Driveline" "24.2" true "LD"
"Symbolic Math Toolbox" "24.2" true "SM"
"Vehicle Network Toolbox" "24.2" true "VN"
"MATLAB Coder" "24.2" true "ME"
"Wavelet Toolbox" "24.2" true "WA"
"MATLAB Report Generator" "24.2" true "MR"
"Simulink Control Design" "24.2" true "SD"
"Text Analytics Toolbox" "24.2" true "TA"
"Model Predictive Control Toolbox" "24.2" true "MP"
"Simscape" "24.2" true "SS"
"Aerospace Blockset" "24.2" true "AE"
"Fixed-Point Designer" "24.2" true "PO"
"Datafeed Toolbox" "24.2" true "DF"
"DSP System Toolbox" "24.2" true "DS"
"Stateflow" "24.2" true "SF"
"Simulink Real-Time" "24.2" true "XP"
"Robust Control Toolbox" "24.2" true "RC"
"Simulink Desktop Real-Time" "24.2" true "WT"
"MATLAB Compiler" "24.2" true "CO"
"Bioinformatics Toolbox" "24.2" true "BI"
"Control System Toolbox" "24.2" true "CT"
"HDL Verifier" "24.2" true "ES"
"Curve Fitting Toolbox" "24.2" true "CF"
"Spreadsheet Link" "24.2" true "EL"
"RF Toolbox" "24.2" true "RF"
"Embedded Coder" "24.2" true "EC"
"Computer Vision Toolbox" "24.2" true "VP"
"Aerospace Toolbox" "24.2" true "AT"
"System Identification Toolbox" "24.2" true "ID"
"Simulink Coverage" "24.2" true "CV"
"Financial Instruments Toolbox" "24.2" true "IT"
"SimBiology" "24.2" true "SB"
"Audio Toolbox" "24.2" true "AU"
"Optimization Toolbox" "24.2" true "OP"
"Partial Differential Equation Toolbox" "24.2" true "PD"
"Instrument Control Toolbox" "24.2" true "IC"
"Simscape Fluids" "24.2" true "SH"
"Simulink Design Optimization" "24.2" true "SO"
"Simulink" "24.2" true "SL"
"Simulink 3D Animation" "24.2" true "VR"
"Global Optimization Toolbox" "24.2" true "GD"
"Data Acquisition Toolbox" "24.2" true "DA"
"Fuzzy Logic Toolbox" "24.2" true "FL"
"Parallel Computing Toolbox" "24.2" true "DM"
"Simulink Coder" "24.2" true "RT"
"Econometrics Toolbox" "24.2" true "ET"
"Deep Learning Toolbox" "24.2" true "NN"
"Simulink Check" "24.2" true "VV"
"Database Toolbox" "24.2" true "DB"
"Financial Toolbox" "24.2" true "FI"
"Communications Toolbox" "24.2" true "CM"
"Image Processing Toolbox" "24.2" true "IP"
"Image Acquisition Toolbox" "24.2" true "IA"
"Simscape Multibody" "24.2" true "MS"
"Requirements Toolbox" "24.2" true "RQ"
"Statistics and Machine Learning Toolbox" "24.2" true "ST"
"Mapping Toolbox" "24.2" true "MG"
"Model-Based Calibration Toolbox" "24.2" true "MB"
"Simscape Electrical" "24.2" true "PS"
"Simulink Design Verifier" "24.2" true "DV"
"MATLAB Compiler SDK" "24.2" true "MJ"
"Signal Processing Toolbox" "24.2" true "SG"
"Image Despeckle Filtering Toolbox" "1.0" true "10c1c234-9cd3-4c8d-b636-4198647538eb"
"Image Processing Toolbox Model for Segment Anything Model" "24.2.0" true "SAM"
As far as I can see it all looks activated...
Anthony

Sign in to comment.

Answers (1)

Jaimin
Jaimin about 18 hours ago
It looks like you are facing a problem where MATLAB is not detecting the installed Computer Vision Toolbox, even though it's up to date. Here are some steps you can take to troubleshoot and resolve the issue:
Verify Installation: Double-check that the Computer Vision Toolbox is installed by typing the ver command in the MATLAB Command Window.
Check Licensing: Ensure your MATLAB license includes the Computer Vision Toolbox by verifying your licenses with command “license('test', 'Computer_Vision_Toolbox')”.
Update MATLAB Path: Sometimes, the MATLAB path might not be set correctly.
Reset it by executing:
restoredefaultpath;
rehash toolboxcache;
savepath;
Then restart MATLAB and try running your code again.
Reinstall the Toolbox: If the above steps don't resolve the issue, consider reinstalling the Computer Vision Toolbox:
  • Go to the "Add-Ons" menu in MATLAB.
  • Select "Manage Add-Ons."
  • Uninstall the Computer Vision Toolbox and then reinstall it.
For more detailed guidance, please refer to the MathWorks Documentation.
If the issue continues, please reach out to MathWorks Technical Support for further assistance:
I hope this will be helpful.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!