MATLAB Answers

why my YOLO v2 detector produces no results?

조회 수: 28(최근 30일)
Filippo profumo
Filippo profumo 11 Aug 2019
답변: Song Decn 14 Mar 2020
i use a YOLO v2 detector to detect cells in images like this one (i used this specific one to train the detector) of two different types to train the detector.
i give the detector the boxes as in figure.
boxes.jpg
i use the following lines to train the detector:
T=table(names2',roi1',roi2');
%names2' contains the image file path
%roi1' and roi2' are the matrices M*4 with the [x,y,width,height] of %boxes containing the cells
numClasses=width(T)-1;
anchorBoxes = [
40 40
60 60
80 80
100 100
];
baseNetwork = resnet50;
featureLayer = 'activation_40_relu';
imageSize = [1080 1920 3];
options = trainingOptions('sgdm', ...
'MiniBatchSize', 16, ....
'InitialLearnRate',1e-3, ...
'MaxEpochs',10,...
'CheckpointPath', tempdir, ...
'Shuffle','every-epoch');
lgraph = yolov2Layers(imageSize,numClasses,anchorBoxes,baseNetwork,featureLayer);
[detector,info] = trainYOLOv2ObjectDetector(T,lgraph,options)
----------------------------------------------------------------------------------------------------------------
i get the following outputs:
Training on single CPU.
|========================================================================================|
| Epoch | Iteration | Time Elapsed | Mini-batch | Mini-batch | Base Learning |
| | | (hh:mm:ss) | RMSE | Loss | Rate |
|========================================================================================|
| 1 | 1 | 00:00:43 | 3.32 | 11.0 | 0.0010 |
| 10 | 10 | 00:07:02 | 1.16 | 1.4 | 0.0010 |
|========================================================================================|
detector =
yolov2ObjectDetector with properties:
ModelName: 'Var2'
Network: [1×1 DAGNetwork]
ClassNames: {'Var2' 'Var3'}
AnchorBoxes: [4×2 double]
TrainingImageSize: [1080 1920]
info =
struct with fields:
TrainingLoss: [11.0190 5.5807 4.0740 3.1020 2.1962 1.3285 1.3990 1.5349 1.6414 1.3550]
TrainingRMSE: [3.3195 2.3623 2.0184 1.7613 1.4820 1.1526 1.1828 1.2389 1.2812 1.1641]
BaseLearnRate: [0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010 0.0010]
a =
yolov2ObjectDetector with properties:
ModelName: 'Var2'
Network: [1×1 DAGNetwork]
ClassNames: {'Var2' 'Var3'}
AnchorBoxes: [4×2 double]
TrainingImageSize: [1080 1920]
----------------------------------------------------------------------------------------------------------------
when i use the detector to a similar image i get no results. The [bboxes, scores] matrix is empty.
what is my error?

  댓글 수: 0

댓글을 달려면 로그인하십시오.

답변(2개)

Srivardhan Gadila
Srivardhan Gadila 14 Aug 2019
편집: Srivardhan Gadila 14 Aug 2019
The bboxes from [bboxes,scores] = detect(detector,img); would be empty when no object is detected by your network. You may also refer to trainyolov2objectdetector.

  댓글 수: 2

cui
cui 14 Aug 2019
Excuse me,@SriVardhan Gadila , I did it according to the official tutorial,but how can I solve this problem?
Filippo profumo
Filippo profumo 19 Aug 2019
ok @SriVardhan Gadila but i give the dectector an image with many cells so i have trained incorrectly the network for having no results?

댓글을 달려면 로그인하십시오.


Song Decn
Song Decn 14 Mar 2020
I have the same issue, after training with my labeled data, detector gives no bounding boxes. What is the general solution steps for this?

  댓글 수: 0

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by