MCPcopy Create free account

hub / github.com/roboflow/supervision / functions

Functions1,714 in github.com/roboflow/supervision

Functiontest_box_iou_batch
( boxes_true: np.ndarray, boxes_detection: np.ndarray, overlap_metric: str | OverlapMetric, ex
tests/detection/utils/test_iou_and_nms.py:1093
Functiontest_box_iou_batch_symmetric_large
( num_true: int, num_det: int, overlap_metric: OverlapMetric, )
tests/detection/utils/test_iou_and_nms.py:1134
Functiontest_box_non_max_suppression
( predictions: np.ndarray, iou_threshold: float, expected_result: np.ndarray | None, exception
tests/detection/utils/test_iou_and_nms.py:269
Functiontest_build_class_index_mapping
( source_classes: list[str], target_classes: list[str], expected_result: dict[int, int] | None,
tests/dataset/test_utils.py:163
Functiontest_build_coco_class_index_mapping
( coco_categories: list[dict], target_classes: list[str], expected_result: dict[int, int], exc
tests/dataset/formats/test_coco.py:824
Functiontest_byte_tracker
( detections: list[sv.Detections], expected_results: sv.Detections, )
tests/tracker/test_byte_tracker.py:32
Functiontest_byte_tracker_does_not_skip_external_ids_for_short_lived_tracks
()
tests/tracker/test_byte_tracker.py:41
Functiontest_calculate_masks_centroids
( masks: np.ndarray, expected_result: np.ndarray, exception: Exception, )
tests/detection/utils/test_masks.py:361
Functiontest_calculate_region_of_interest_limits
( vector: Vector, expected_result: tuple[Vector, Vector] | None, exception: Exception, )
tests/detection/test_line_counter.py:68
Methodtest_centroids_compact_matches_dense
Centroid coordinates must be numerically identical for dense and compact.
tests/detection/test_compact_mask.py:596
Methodtest_centroids_empty_mask
All-zero masks should return centroid (0, 0) — same as dense.
tests/detection/test_compact_mask.py:612
Methodtest_centroids_empty_mask_with_tight_bbox
All-zero tight crops must still return centroid (0, 0).
tests/detection/test_compact_mask.py:623
Methodtest_centroids_zero_masks_returns_empty
Empty CompactMask (0 objects) must return shape (0, 2).
tests/detection/test_compact_mask.py:635
Methodtest_chunking_matches_single_pass
A tiny memory_limit forces chunking yet returns the same matrix.
tests/detection/utils/test_iou_and_nms.py:1643
Methodtest_class_name_after_merge
After merging datasets, class_name must match remapped class_id.
tests/dataset/test_core.py:237
Methodtest_class_name_from_yolo
Integration test: from_yolo should produce class_name data.
tests/dataset/test_core.py:269
Methodtest_class_name_populated_on_init
Basic case: class_name data field is set from classes and class_id.
tests/dataset/test_core.py:198
Methodtest_class_name_with_empty_annotations
Empty Detections should not raise an error.
tests/dataset/test_core.py:217
Methodtest_class_name_with_empty_classes
When classes is empty, class_name should not be populated.
tests/dataset/test_core.py:228
Functiontest_classes_to_coco_categories_and_back_to_classes
( classes: list[str], exception: Exception )
tests/dataset/formats/test_coco.py:188
Functiontest_classes_to_coco_categories_ids_start_at_one
COCO categories[].id must be 1-indexed (COCO spec / CVAT requirement).
tests/dataset/formats/test_coco.py:1553
Functiontest_clip_boxes
( xyxy: np.ndarray, resolution_wh: tuple[int, int], expected_result: np.ndarray, )
tests/detection/utils/test_boxes.py:52
Functiontest_coco_annotations_to_detections
( image_annotations: list[dict], resolution_wh: tuple[int, int], with_masks: bool, use_iscrowd
tests/dataset/formats/test_coco.py:760
Functiontest_coco_categories_to_classes
( coco_categories: list[dict], expected_result: list[str], exception: Exception )
tests/dataset/formats/test_coco.py:172
Functiontest_coco_iscrowd_mask_exports_as_rle
Multi-segment mask exports segmentation as RLE dict (iscrowd inferred as 1).
tests/dataset/formats/test_coco.py:2086
Functiontest_coco_polygon_segmentation_survives_roundtrip
COCO polygon segmentation survives the load/export sequence. 1. Write source COCO JSON with polygon segmentation. 2. Load it through Detectio
tests/dataset/formats/test_coco.py:2007
Functiontest_coco_raw_segmentation_preserved_when_masks_not_decoded
When masks are NOT decoded (with_masks=False), raw polygon data stored in data['segmentation'] is used as a lossless fallback so as_coco() still e
tests/dataset/formats/test_coco.py:2060
Functiontest_coco_round_trip_multi_class_single_image
Single image with two detections of different classes round-trips losslessly.
tests/dataset/formats/test_coco.py:1905
Functiontest_coco_round_trip_preserves_class_ids_and_writes_one_indexed_categories
as_coco -> from_coco is lossless for internal class_ids while the on-disk COCO category ids are 1-indexed (regression for #1181).
tests/dataset/formats/test_coco.py:1578
Functiontest_color_as_bgra
( color: Color, expected_result: tuple[int, int, int, int] | None, exception: Exception, )
tests/draw/test_color.py:282
Functiontest_color_as_hex
Verify that Color.as_hex correctly converts Color objects to hex strings. Scenario: Converting a `Color` object back to a hex string. Ex
tests/draw/test_color.py:91
Functiontest_color_as_rgba
( color: Color, expected_result: tuple[int, int, int, int] | None, exception: Exception, )
tests/draw/test_color.py:264
Functiontest_color_from_bgr_tuple
( color_tuple: tuple[int, int, int], expected_result: Color | None, exception: Exception, )
tests/draw/test_color.py:182
Functiontest_color_from_bgra_tuple
( color_tuple: tuple[int, int, int, int], expected_result: Color | None, exception: Exception, )
tests/draw/test_color.py:246
Functiontest_color_from_hex
Verify that Color.from_hex correctly parses various hex string formats. Scenario: Creating a `Color` object from various hex string formats
tests/draw/test_color.py:58
Functiontest_color_from_rgb_tuple
( color_tuple: tuple[int, int, int], expected_result: Color | None, exception: Exception, )
tests/draw/test_color.py:139
Functiontest_color_from_rgba_tuple
( color_tuple: tuple[int, int, int, int], expected_result: Color | None, exception: Exception, )
tests/draw/test_color.py:214
Functiontest_color_hash
(color_a: Color, color_b: Color, expect_equal_hash: bool)
tests/draw/test_color.py:315
Functiontest_color_repr
(color: Color, expected_repr: str)
tests/draw/test_color.py:302
Methodtest_compact_and_dense_pipelines_give_same_masks
compact_masks=True and False must produce pixel-identical final masks.
tests/detection/test_inference_slicer_compact.py:74
Methodtest_compact_mask_drops_pixels_outside_bbox
CompactMask is lossy: True pixels outside xyxy bbox are silently dropped. This test documents that compact and dense paths diverge when a mas
tests/annotators/test_core.py:434
Methodtest_compact_mask_mixed_input_gives_same_result
CompactMask + dense mixed dispatch must match dense + dense.
tests/detection/utils/test_iou_and_nms.py:1719
Methodtest_compact_masks_false_keeps_dense
Default (compact_masks=False) keeps dense ndarray masks.
tests/detection/test_inference_slicer_compact.py:60
Methodtest_compact_masks_flag_converts_dense_to_compact
Masks returned from callback are CompactMask after _run_callback.
tests/detection/test_inference_slicer_compact.py:45
Methodtest_compact_matches_dense
(self)
tests/detection/test_compact_mask_integration.py:140
Methodtest_compact_vs_dense
(self)
tests/detection/test_compact_mask_integration.py:120
Functiontest_complex_integration_scenario
Test integration scenario with multiple images and varying performance.
tests/metrics/test_mean_average_recall.py:378
Methodtest_compute_average_precision
Verify that Average Precision is correctly calculated from PR curve points. Scenario: Computing Average Precision (AP) from PR curve
tests/metrics/test_detection.py:621
Methodtest_confidence_ranking
Test that F1 score respects confidence ranking
tests/metrics/test_f1_score.py:266
Methodtest_confidence_ranking
Test that higher confidence predictions are preferred for matching
tests/metrics/test_recall.py:157
Methodtest_confidence_ranking
Test that predictions are ranked by confidence
tests/metrics/test_precision.py:237
Methodtest_confusion_matrix
( self, predictions, targets, classes, conf_threshold, iou_thr
tests/metrics/test_detection.py:1097
Methodtest_confusion_matrix_from_tensors_obb
Direct from_tensors OBB end-to-end coverage with pre-built tensors.
tests/metrics/test_detection.py:1445
Methodtest_confusion_matrix_masks_rejection
MetricTarget.MASKS raises ValueError at every public entry point.
tests/metrics/test_detection.py:1475
Methodtest_confusion_matrix_metric_target_persistence_from_detections
metric_target field reflects the value passed to from_detections.
tests/metrics/test_detection.py:1531
Methodtest_confusion_matrix_metric_target_persistence_from_tensors
metric_target field reflects the value passed to from_tensors.
tests/metrics/test_detection.py:1546
Methodtest_confusion_matrix_multiclass_obb
Multi-class OBB: TP for exact match, FP+FN for rotation mismatch.
tests/metrics/test_detection.py:1480
Methodtest_confusion_matrix_obb
Verify OBB support in ConfusionMatrix. Test scenarios: 1. Perfect OBB overlap (Rotation Match) 2. Rotation Sensitivit
tests/metrics/test_detection.py:1250
Methodtest_confusion_matrix_obb_regression_1760
Regression for #1760: thin OBBs with same AABB must not match. Two thin bars (100 px long, 10 px wide) at 45° and -45° share an identical
tests/metrics/test_detection.py:1333
Methodtest_confusion_matrix_on_yolo_dataset
Test confusion matrix calculation on a YOLO-format dataset. This test verifies that the confusion matrix fix (considering both IoU A
tests/metrics/test_detection.py:1120
Methodtest_constructor_accepts_and_warns_on_deprecated_confidence_kwarg
Deprecated confidence= warns and maps value to keypoint_confidence.
tests/key_points/test_core.py:1002
Methodtest_constructor_confidence_none_does_not_warn
Explicit confidence=None is silently ignored — no warning emitted.
tests/key_points/test_core.py:1053
Methodtest_constructor_data_none_defaults_to_empty_dict
Explicit data=None normalizes to empty dict, not None.
tests/key_points/test_core.py:1065
Methodtest_constructor_normal_keypoint_confidence_path
Normal keypoint_confidence= path works and emits no deprecation warning.
tests/key_points/test_core.py:1039
Methodtest_constructor_raises_on_invalid_params
Invalid constructor parameters raise ValueError.
tests/key_points/test_annotators.py:290
Methodtest_constructor_rejects_both_confidence_and_keypoint_confidence
ValueError raised regardless of kwarg order when both are passed.
tests/key_points/test_core.py:1028
Functiontest_contains_holes
( mask: npt.NDArray[np.bool_], expected_result: bool, exception: Exception )
tests/detection/utils/test_masks.py:418
Methodtest_contains_holes_compact_roundtrip
contains_holes must agree after CompactMask encode→decode.
tests/detection/test_compact_mask.py:680
Functiontest_contains_multiple_segments
( mask: npt.NDArray[np.bool_], connectivity: int, expected_result: bool, exception: Exception,
tests/detection/utils/test_masks.py:495
Methodtest_contains_multiple_segments_compact_roundtrip
contains_multiple_segments must agree after CompactMask encode→decode.
tests/detection/test_compact_mask.py:734
Functiontest_create_batches
(sequence, batch_size, expected)
tests/utils/test_iterables.py:21
Functiontest_crop_image
(image, xyxy, expected_size)
tests/utils/test_image.py:169
Functiontest_csv_sink
( detections: sv.Detections, custom_data: dict[str, Any] | None, second_detections: sv.Detections,
tests/detection/test_csv.py:293
Functiontest_csv_sink_manual
( detections: sv.Detections, custom_data: dict[str, Any], second_detections: sv.Detections, se
tests/detection/test_csv.py:501
Functiontest_csv_sink_slice_value
(value: Any, i: int, n: int, expected: Any)
tests/detection/test_csv.py:540
Methodtest_custom_name
Logger is created with provided name.
tests/utils/test_logger.py:16
Functiontest_cv2_to_pillow
( empty_cv2_image: np.ndarray, empty_pillow_image: Image.Image )
tests/utils/test_conversion.py:86
Functiontest_dataset_as_yolo_obb_output_token_count
Token count in saved YOLO line reflects the is_obb flag at export time.
tests/dataset/formats/test_yolo.py:649
Functiontest_dataset_as_yolo_obb_round_trip_corner_accuracy
OBB round-trip via `from_yolo` -> `as_yolo` must preserve the 4 corners.
tests/dataset/formats/test_yolo.py:681
Functiontest_dataset_as_yolo_obb_round_trip_with_background_image
OBB round-trip with a label-less image must not raise ValueError.
tests/dataset/formats/test_yolo.py:721
Functiontest_dataset_merge
Verify that multiple DetectionDataset objects can be successfully merged. Ensures that multiple `DetectionDataset` objects can be merged int
tests/dataset/test_core.py:178
Functiontest_dataset_split_integration
Test mAR with a roboflow-format dataset loaded from disk. Uses a synthetic YOLO-format dataset loaded via DetectionDataset.from_yolo() t
tests/metrics/test_mean_average_recall.py:508
Methodtest_default_level_is_info
Logger defaults to INFO level when LOG_LEVEL env var is not set.
tests/utils/test_logger.py:21
Methodtest_default_name
Logger is created with default name.
tests/utils/test_logger.py:11
Methodtest_degenerate_boxes_score_zero
Degenerate boxes (zero-area collapsed or collinear) always score 0. Note: self-comparison of a zero-area box returns 0.0, not 1.0 — this
tests/detection/utils/test_iou_and_nms.py:1325
Methodtest_degenerate_oriented_box_has_zero_area
An OBB whose four corners coincide has zero area — the shoelace formula must not produce NaN or a negative value.
tests/detection/test_core.py:1837
Functiontest_delta_decode
_delta_decode undoes COCO delta: counts[i] += counts[i-2] for i > 2.
tests/detection/utils/test_converters.py:713
Functiontest_delta_encode
_delta_encode applies COCO delta: d[i] = counts[i] - counts[i-2] for i > 2.
tests/detection/utils/test_converters.py:729
Functiontest_delta_round_trip
_delta_decode(_delta_encode(counts)) == counts for any count list.
tests/detection/utils/test_converters.py:743
Functiontest_denormalize_boxes
( xyxy: np.ndarray, resolution_wh: tuple[int, int], normalization_factor: float, expected_resu
tests/detection/utils/test_boxes.py:222
Methodtest_dense_parity_roundtrip
Resized CompactMask matches OpenCV-resized dense masks within 1px.
tests/detection/test_compact_mask.py:1203
Methodtest_detection_exceeds_limit_warns_and_completes
detection > memory_limit emits UserWarning; result shape is still correct.
tests/detection/utils/test_iou_and_nms.py:1733
Functiontest_detections_bool_mask_types_do_not_warn
(mask_dtype)
tests/detection/test_core.py:143
Methodtest_detections_compact_mask_validation_mismatch
(self)
tests/detection/test_compact_mask_integration.py:55
Methodtest_detections_construction_with_compact_mask
(self)
tests/detection/test_compact_mask_integration.py:49
Functiontest_detections_from_xml_obj
( xml_string, classes, resolution_wh, force_masks, expected_result, exception )
tests/dataset/formats/test_pascal_voc.py:222
Functiontest_detections_from_xml_obj_mixed_polygon_and_bbox_masks_aligned
( force_masks: bool, )
tests/dataset/formats/test_pascal_voc.py:232
Functiontest_detections_non_bool_mask_warns_with_migration_path
()
tests/detection/test_core.py:155
Functiontest_detections_to_coco_annotations
( detections: Detections, image_id: int, annotation_id: int, expected_result: list[dict],
tests/dataset/formats/test_coco.py:952
Functiontest_detections_to_coco_annotations_category_id_is_one_indexed
Internal class_id k must serialize to COCO category_id k + 1.
tests/dataset/formats/test_coco.py:1562
← previousnext →1,101–1,200 of 1,714, ranked by callers