broadinstitute / keras-rcnn

Keras package for region-based convolutional neural networks (RCNNs)
Other
555 stars 222 forks source link

cropped target_mask in DictionaryIterator #184

Closed harrd-tessella closed 6 years ago

harrd-tessella commented 6 years ago

Hi,

When you extract the portion of the target_mask here that's inside the bounding box: https://github.com/broadinstitute/keras-rcnn/blob/master/keras_rcnn/preprocessing/_object_detection.py#L232

You're getting the slice from minimum_r to one less than maximum_r (and same for the column): target_mask = target_mask[ minimum_r : maximum_r, minimum_c : maximum_c ]

Did you mean to do this?: target_mask = target_mask[ minimum_r : maximum_r+1, minimum_c : maximum_c+1 ]

Of course, it depends on how you define the bounding box. Maybe you want min-1:max instead. -Robert

0x00b1 commented 6 years ago

Hi, Robert. Good question.

My preference is what you’ve proposed (incrementing maximum_r and maximum_c inside the generator). What do you think? Would be interested in submitting a PR?

0x00b1 commented 6 years ago

@harrd-tessella fixed! https://github.com/broadinstitute/keras-rcnn/commit/ea9bb08269940b09668571bb9e17070037525812