broadinstitute / keras-rcnn

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

ImageSegmentationGenerator #3

Open 0x00b1 opened 7 years ago

0x00b1 commented 7 years ago

keras-rcnn should include an ImageSegmentationGenerator class like Keras’s ImageDataGenerator.

0x00b1 commented 7 years ago

The ImageSegmentationGenerator should be an easier task.

The dictionary should look similar to the existing ObjectDetectionGenerator dictionary except each box includes a mask key that has the mask pathname, e.g.

{
    "boxes": [
        {
            "x_minimum": 0,
            "y_minimum": 0,
            "x_maximum": 0,
            "y_maximum": 0,
            "description: "foo",
            "mask: "mask.png"
        }
    ],
    "c": 224,
    "channels": 3
    "pathname": "image.png",
    "r": 224
}

It should yield masks (in addition to an image, bounding boxes, and labels), e.g.

generator = ImageSegementationGenerator()

generator = generator.flow(training)

image, (boxes, labels, masks) = generator.next()