wrong classification caffe google net model in matlab

1 visualización (últimos 30 días)
nitin kandpal
nitin kandpal el 6 de Oct. de 2019
Comentada: Piyush Dubey el 10 de Oct. de 2019
Hi all,
I trained a google net model for two claases in Nvidia DIGITS which is working well in in DIGITS6.0 with 99.7 accuracy in test set.
Same model imported in matlab not able to classify properly. I am thinking it has to do something with mean image or binary.proto file.
I am not getting any error just wrong classification and i am sure my network is woking properly in DIGITS6.0 and python.
below is the matlab code
protofile = 'deploy.prototxt';
datafile = 'snapshot_iter_2295.caffemodel';
net = importCaffeNetwork(protofile,datafile);
inputSize = net.Layers(1).InputSize;
% image path
img = 'Test/Normal/0.JPEG';
im1 = imread(img);
im2 = rgb2gray(im1);
im = imresize(im2,inputSize(1:2)) ;
[label,score] = classify(net,im); % Classify the picture
Thanks
Nitin
  1 comentario
Piyush Dubey
Piyush Dubey el 10 de Oct. de 2019
Hi Nitin,
When you obtain 'im2' by using 'rgb2gray' function, the image size changes from [224 224 3] to [224 224]. When you try to classify it, you should get an error saying 'Incorrect input size. The input images must have a size of [224 224 3].'. Can you try classifying after removing the following line from your code:
im2 = rgb2gray(im1);
And changing the line where you resize the image im2 to the following:
im = imresize(im1, inputSize(1:2));
Also, see if the following link can help:

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by