Clear Filters
Clear Filters

Object Detection with Saved Network

2 views (last 30 days)
Ferhat Kangal
Ferhat Kangal on 21 Apr 2023
Commented: Walter Roberson on 23 Apr 2023
Hello! I have trained couple networks such as ResNet50 and GoogLeNet with my own dataset. I want to use my saved network for object detection. Is there any way to use my saved network for object detection?
  4 Comments
Walter Roberson
Walter Roberson on 23 Apr 2023
If your requirement does not involve generating an executable, then you do not have any problems provided that you have the appropriate Toolbox and Support Package installed in MATLAB.
If your requirement involves generating an executable that needs to be able to train a neural network inside the executable, then you will not be able to do that using the Mathworks toolboxes: Mathworks restricts the training facilities so that they cannot be deployed to an executable.
If your requirement involves generating an executable that needs to be able to use a previously-trained network to predict() or classify(), then the discussion I linked to describes the workflow: load() the network and use it to predict() or classify(), and getting the load() to work often involves using #%function pragmas.
Walter Roberson
Walter Roberson on 23 Apr 2023
L = predict(net, Images);
class_is_present_in_image = L > 0.95; %95% certainty
detected_classes = {};
for mask = class_is_present_in_image
detected_classes{end+1} = classNames(mask);
end
The end result should be a cell array, one entry per image present in Images, in which the entry contains the class names of all classes present in the image to (in this case) 95% certainty.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!