how can I do object detection with vgg16 by using rcnn??

1 回表示 (過去 30 日間)
jin soo kim
jin soo kim 2019 年 11 月 22 日
回答済み: Sourav Bairagya 2020 年 1 月 10 日
Hello, I have my custom image data of car and I labeled all my images.
And I want to train CNN by using rcnn. source code is 'rcnn = trainRCNNObjectDetector(gTruth, layers, options)
gTruth is my dataset and I want to use vgg16 for layers.
I can't modify inputlayers(imagesize) and number of nodes of last classification layer and number of classess.
how can I do object detection with vgg16 by using rcnn??

回答 (1 件)

Sourav Bairagya
Sourav Bairagya 2020 年 1 月 10 日
You can extract the desired number of layers from the pretrained net and define your choice of network. Here is an small example for extracting the desired layers.
net = vgg16;
lastFeatureLayerIdx = 32;
layers = net.Layers;
middlelayers = layers(2:lastFeatureLayerIdx);
Now, you can define your choice of input layer and final layer (i.e. classification layer) and then combine them with the middle layers to get the complete network.
layers = [
inputLayer
middleLayers
finalLayers
]
Now, you can leverage this link to get an idea how to perform object detection using R-CNN:

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by