ms#
Functions#
|
|
|
|
|
|
|
Calculates Cohen's h, Power, and P-value for a one-sided (right-tailed) Binomial Test. |
|
|
|
|
|
Standard IoU calculation with safe checks. |
|
|
|
Performs Hungarian Matching and filters by IoU threshold. |
|
Convert a torchvision-style detection output (boxes/labels tensors) into |
|
Convert YOLO normalized bounding boxes to absolute pixel coordinates and compute their areas. |
Module Contents#
- ms.kill_count_img(miss_s, ghost_s)#
- ms.kill_rate_obj(match_s, miss_s, ghost_s)#
- ms.un_ms_calcu(match_metrics, miss_metrics, ghost_metrics)#
- ms.check_kill_binomial_test(success, n, p_null, alpha=0.05)#
Calculates Cohen’s h, Power, and P-value for a one-sided (right-tailed) Binomial Test.
Parameters:#
- nint
Sample size (e.g., 10)
- successint
Number of observed successes (e.g., 3)
- p_nullfloat
The null hypothesis proportion/noise level (e.g., 0.05)
- alphafloat, optional
Significance level, default is 0.05
Returns:#
- dict
A dictionary containing the calculated statistics.
- ms.iskill_img(miss_s, ghost_s)#
- ms.calcu_mean(results, cols_to_mean)#
- ms.compute_iou(boxA, boxB)#
Standard IoU calculation with safe checks.
- ms.spatial_aware(rate, metric, penalty)#
- ms.identify_matches_misses_ghosts(orig_objs, mut_objs, iou_threshold=0.5)#
Performs Hungarian Matching and filters by IoU threshold.
- ms.convert_detection_output(pred, default_score=1.0)#
Convert a torchvision-style detection output (boxes/labels tensors) into the
{"label_i": {"box", "label", "score", "logit"}}format expected byidentify_matches_misses_ghosts().
- ms.yolo_to_absolute(yolo_labels, img_w=1280, img_h=736)#
Convert YOLO normalized bounding boxes to absolute pixel coordinates and compute their areas.
- Parameters:
yolo_labels (list of lists) – Each element is [label, x_center, y_center, width, height], where coordinates are normalized between 0 and 1.
img_w (int) – Image width in pixels.
img_h (int) – Image height in pixels.
- Returns:
- {
‘boxes’: torch.Tensor of shape [N, 4] with absolute coordinates [xmin, ymin, xmax, ymax], ‘labels’: torch.Tensor of shape [N] with class IDs, ‘areas’: torch.Tensor of shape [N] with the area of each bounding box in pixels.
}
- Return type:
dict