BBoxStrategy Class
ml_debugger.data_filter.config.bbox_strategy.BBoxStrategy
Bases: BaseModel
BBox-level aggregation strategy for image-level error scoring.
属性:
| 名前 | タイプ | デスクリプション |
|---|---|---|
target_column |
str
|
Error column to aggregate. One of 'error_proba' (default), 'det_error_proba', 'cls_error_proba'. |
top_n |
Optional[int]
|
Number of top-error bboxes per image. None (default) means no top-N restriction. |
bbox_filter |
Optional[Union[FilterConfig, Dict[str, Any]]]
|
Filter conditions for bbox selection. None (default) means no threshold filtering. If both bbox_filter and top_n are set, threshold -> top_n の順で適用。 |
aggregation |
str
|
How to aggregate per-bbox values to image-level. 'mean' (default) or 'median'. |
weight_column |
Optional[str]
|
Optional weight column (e.g. 'pred_size'). - None: unweighted aggregation - set: weighted_mean / weighted_median に分岐 |
sort |
str
|
Sort order for image-level results. 'desc' (default) or 'asc'. |
img_error_threshold |
Optional[float]
|
Image-level error threshold for real-time filter flags. None (default) means filter flags are all None (no filtering). If set (0.0-1.0), aggregated error_proba >= threshold → True, else False. |
Example
Top 3 bboxes by det_error_proba, aggregated with max
strategy = BBoxStrategy( ... target_column="det_error_proba", ... top_n=3, ... aggregation="mean", ... )
Threshold + top_n + weighted aggregation by bbox size
strategy = BBoxStrategy( ... bbox_filter={"conditions": [{"error_proba": ">=0.3"}]}, ... top_n=3, ... aggregation="median", ... weight_column="pred_size", ... )
validate_dict(data)
classmethod
Validate dict and return result with guide message.