Using a pretrained Neural Network.
Show older comments
Hello! I was going to use a pretrained network to detect objects but I am not having any luck, This is the code I am trying to use:
%load detector
net = googlenet;
% Read a test image.
I = imread(imagename);
% Run the detector.
[bboxes,scores,labels] = detect(net,I);
% Annotate detections in the image.
I = insertObjectAnnotation(I,'rectangle',bboxes,cellstr(labels));
figure
imshow(I)
I feel like this should be easy. When I searched for the answer I found how to train it.
Thanks for your help!
1 Comment
Laura Hann
on 19 Feb 2019
What error are you getting?
This example seems to be what you're looking for:
If it's not working you problably don't have the toolbox installed.
[label,scores] = classify(net,I);
figure
imshow(I)
title(string(label) + ", " + num2str(100*scores(classNames == label),3) + "%");
Answers (0)
Categories
Find more on Object Detection in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!