An abstract base class for object mask caches.
Bases: glimpse.experiment.om_wkmeans.BaseMaskCache
A cache for object masks.
Compute the foreground ratio for each prototype.
The foreground ratio is the number of foreground pixels in the receptive field, divided by the total number of pixels in the receptive field. If the image has no foreground object, its foreground ratio is defined to be zero.
Parameters: | masks – Mapping from image path to mask path. This will usually be a :class:MaskCache. |
---|---|
Returns: | Foreground ratio for each imprinted prototype in experiment. |
Return type: | 1-d array of float |
Learn patch models by object-mask weighted k-Means clustering.
Weights are given by the overlap between the image patch and the image’s foreground object.
Parameters: |
|
---|---|
Returns: | Learned patches. |
Return type: | array of float |