crowdkit.aggregation.image_segmentation.segmentation_majority_vote.SegmentationMajorityVote
| Source code
SegmentationMajorityVote( self, on_missing_skill: str = 'error', default_skill: Optional[float] = None)
Segmentation Majority Vote - chooses a pixel if more than half of workers voted.
This method implements a straightforward approach to the image segmentations aggregation:
it assumes that if pixel is not inside in the worker's segmentation, this vote counts
as 0, otherwise, as 1. Next, the SegmentationEM
aggregates these categorical values
for each pixel by the Majority Vote.
The method also supports weighted majority voting if skills
were provided to fit
method.
Doris Jung-Lin Lee. 2018. Quality Evaluation Methods for Crowdsourced Image Segmentation https://ilpubs.stanford.edu:8090/1161/1/main.pdf
Parameters | Type | Description |
---|---|---|
default_skill | Optional[float] | A default skill value for missing skills. |
segmentations_ | Series | Tasks' segmentations. A pandas.Series indexed by |
on_missing_skill | str | How to handle assignments done by workers with unknown skill. Possible values:
|
Examples:
import numpy as npimport pandas as pdfrom crowdkit.aggregation import SegmentationMajorityVotedf = pd.DataFrame( [ ['t1', 'p1', np.array([[1, 0], [1, 1]])], ['t1', 'p2', np.array([[0, 1], [1, 1]])], ['t1', 'p3', np.array([[0, 1], [1, 1]])] ], columns=['task', 'worker', 'segmentation'])result = SegmentationMajorityVote().fit_predict(df)
Method | Description |
---|---|
fit | Fit the model. |
fit_predict | Fit the model and return the aggregated segmentations. |