Clear Filters
Clear Filters

Question about MATLAB Mask RCNN code from github.

3 views (last 30 days)
Hello, I am trying to test the code, 'Mask RCNN with MATLAB' on the external website, ''.
I have a question on the function, [rpnTrainingSamples.m] , 41~50 line.
The code is :
% Sub-sample negative samples to avoid using too much memory.
numPos = sum(positiveIndex);
negIdx = find(negativeIndex);
numNeg = numel(negIdx);
nidx = params.RandomSelector.randperm(numNeg, min(numNeg, 5000));
% Pack data as int32 to save memory.
regionProposals = int32([regionProposals(positiveIndex, :); regionProposals(nidx, :)]);
anchorIDs = {int32([anchorIDs(positiveIndex) anchorIDs(nidx)])};
anchorIndices = {int32([anchorIndices(positiveIndex,:); anchorIndices(nidx,:)])};
The above packed data will be used for training samples of RPN.
However, for the negative samples of regionProposals (and anchorIDs, etc..), those with indices 'nidx' are packed.
As I know of, the variable 'nidx' is just a randomly shuffled numbers in the range of [1, numNeg].
So, I am afraid that 'regionProposals(nidx, :)' may not represent the negative samples but all the samples (positive, negative, ignored).
Is it right?
Thank you!

Answers (1)

Prabhan Purwar
Prabhan Purwar on 6 Aug 2021
Thanks for reporting the issue. As a workaround kindly consider replacing nidx with numNeg(nidx) in the above code. I have bought the issue to the notice of our developer and will try to fix it in future releases.

Community Treasure Hunt

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

Start Hunting!