Use deep learning to:
- Recognize objects using a pre-trained model
- Perform transfer learning to discriminate between two classes using a pre-trained 1000 class network
Avi Nehemiah (2021). Deep Learning for Computer Vision Demo Code (https://www.mathworks.com/matlabcentral/fileexchange/57116-deep-learning-for-computer-vision-demo-code), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
how could I obtain a cat and dog images?
Hello
Greetings from Mexico, excellent webinar and thanks for sharing.
I have an error and I do not know how to solve it, could you help me by giving me an orientation?
The error is in the following lines:
featureLayer = 'fc7';
trainingFeatures = activations (convnet, trainingSet, featureLayer, ...
'MiniBatchSize', 32, 'OutputAs', 'columns');
And what it marks is the following:
"
Error using matlab.io.datastore.ImageDatastore / read (line 74)
Error using ReadFcn @ (filename) readAndPreprocessImage (filename) function handle for file
C: \ DeepLearning \ data \ Images \ Arterio_arterial \ CAA_1.png.
Undefined function 'readAndPreprocessImage' for input arguments of type 'char'.
Error in PetDetectionRecognitionScript> @ (filename) readAndPreprocessImage (filename)
Error in nnet.internal.cnn.ImageDatastoreMiniBatchDatastore / read (line 31)
[data, info] = self.imds.read ();
Error in nnet.internal.cnn.MiniBatchDatastoreDispatcher / getExampleInfoFromDatastore (line 312)
[data, info] = read (this.Datastore);
Error in nnet.internal.cnn.MiniBatchDatastoreDispatcher (line 118)
[exampleImage, exampleResponse, this.ResponseMetaData] = getExampleInfoFromDatastore (this);
Error in nnet.internal.cnn.DataDispatcherFactory.createDataDispatcher (line 89)
dispatcher = nnet.internal.cnn.MiniBatchDatastoreDispatcher (datasource, miniBatchSize, endOfEpoch, shuffleOption, precision);
Error in SeriesNetwork> iDataDispatcher (line 1152)
dispatcher = nnet.internal.cnn.DataDispatcherFactory.createDataDispatcher (...
Error in SeriesNetwork / activations (line 806)
dispatcher = iDataDispatcher (X, miniBatchSize, precision, ...
Error in PetDetectionRecognitionScript (line 77)
trainingFeatures = activations (convnet, trainingSet, featureLayer, ...
"
I have Matlab 2018b in Win 10 64 bit ......
Greetings and thanks in advance
Angel Lerma
@Kimuya Alex, It is the problem of matlab version. Install new version
I am Using R2015b Matlab version. I am getting the erroe: "Undefined function or variable 'helperImportMatConvNet". Is there a way to resolve this please? Or is the problem the Matlab Version i am using? Any assistance would be much appreciated pls.
how to find the accuracy for this algorithm
if my data set about lung images which net library i should use as a pre training ?? and i can't understand how - in may case - using only the first 2 layers within my data set
good , but can't
Hi, thanks for the demo.
I have a problem that how to get the 'cat.avi' and 'Hobbes.png'?
for images go to kaggel catvsdog competetion
code*
i am unable to run the cord.it shows error
Everything is ok unless when it runs to line 131. It showed that 'Struct contents reference from a non-struct array object.'. How should i sovle it? Thank you!
Hi, I met a problem when running this program. It showed that Undefined function or variable 'helperImportMatConvNet'.How should I solve it?
Hi
I have Matlab 2016 and Visual studio 2013. What else is required to run the above program? CUDA 7.5 is neccessary?
you need to create your own images in a directory
'C:\DeepLearning\data\PetImages'
So where are the petImages?
the code runs fine up to:
dataFolder = 'C:\DeepLearning\data\PetImages';
categories = {'Cat', 'Dog'};
imds = imageDatastore(fullfile(dataFolder, categories), 'LabelSource', 'foldernames');
Files not found!
Can they be downloaded???
Hi
I have a problem with the frame detection box. When i play the video of dog, the frame can not recognize all the body of dog and that just focus on head or eye or leg... so i have problem with precise recognizing. Can you help me to fix this problem?
Best regards
how could I obtain cat and dog image?
Anslem - the dataset we used was something we collected internally at MathWorks. Kaggle has a similar dataset with images of cats and dogs that you can try with the same code.
I have watched the webinar on Mathworks website, Shahank and avi both of you did a great job. The explanation was pellucid. I really enjoy working with the MATLAB because of its clear workflows and the apps which saves us a lot of time and energy. Thanks for making things simple.
Can I just check is the data set for the cats and dogs from ImageNet dataset or are they from your own dataset that you collected in an earlier Matlab webinar? Thanks Anselm Griffin