Mask_rcnn: How to test multiple images?

Created on 13 Jan 2018  路  3Comments  路  Source: matterport/Mask_RCNN

Hello,

I have two separate directories in an "image" directory to test the network. Inside these two folders, there are 742 and 661 images sequentially. When I specify the batch size as 1 for testing, my code works without any issues. However, I want to accelerate the testing speed by specifying the batch size as 10.

In model.py file, the following assertion
assert len(images) == self.config.BATCH_SIZE, "len(images) must be equal to BATCH_SIZE"
is making my code to skip the last few images at the last iteration of testing. I have had a few attempts for solving the issue and I can share them if necessary. How can we do such a change that the code can do the following:
1) will create a list of 10 images, and then clear the list after evaluation.
2) will be able to reduce the batch size in the last iteration.

Thank you for creating and developing this repository again.

Most helpful comment

I am having the same issue. How do you modify the last batch_size?

All 3 comments

GPU_COUNT = 1
IMAGES_PER_GPU = 2

The batch_size was calculated by GPU_COUNT*IMAGES_PER_GPU

You may want to incread the IMAGES_PER_GPU to increase the Batch_size. You may want to make sure the last batch contains the same number of images as the BATCH_SIZE other wise the assertion you mentioned will fail.

I am having the same issue. How do you modify the last batch_size?

@canerozer @apyrros

Please check this PR #1082, it works for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

techjjun picture techjjun  路  4Comments

Mabinogiysk picture Mabinogiysk  路  3Comments

msson picture msson  路  4Comments

jameschartouni picture jameschartouni  路  4Comments

simone-codeluppi picture simone-codeluppi  路  3Comments