fix sampler registration
Summary: Samplers that operate on the same attribute (e.g. `pred_densepose`) and have different destination attributes (e.g. `gt_densepose` and `gt_masks`) were replacing each other. This fixes the issue.
@@ -35,6 +35,7 @@ class PredictionToGroundTruthSampler:
self._samplers = {}
self.register_sampler("pred_boxes", "gt_boxes", None)
self.register_sampler("pred_classes", "gt_classes", None)
+ # delete scores
self.register_sampler("scores")
def __call__(self, model_output: ModelOutput) -> SampledData:
@@ -77,4 +78,6 @@ class PredictionToGroundTruthSampler:
gt_attr (Optional[str]): field to store the sampled value to, if not None
func (Optional[Callable: Any -> Any]): sampler function
"""
- self._samplers[prediction_attr] = _Sampler(src=prediction_attr, dst=gt_attr, func=func)
+ self._samplers[(prediction_attr, gt_attr)] = _Sampler(
+ src=prediction_attr, dst=gt_attr, func=func
+ )
