Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/roboflow/supervision
/ functions
Functions
1,714 in github.com/roboflow/supervision
⨍
Functions
1,714
◇
Types & classes
220
↳
Endpoints
53
Function
test_get_data_item
( data: dict[str, Any], index: Any, expected_result: dict[str, Any] | None, exception: Excepti
tests/detection/utils/test_internal.py:850
Function
test_get_image_resolution_wh
(image, expected)
tests/utils/test_image.py:193
Function
test_get_instance_variables
( input_instance: Any, include_properties: bool, expected: set[str], exception: Exception, )
tests/utils/test_internal.py:189
Function
test_get_polygon_center
Verify that get_polygon_center correctly calculates the centroid of a polygon. Scenario: Calculating the center point (centroid) of various
tests/geometry/test_utils.py:50
Function
test_get_video_frames_generator
Verify that get_video_frames_generator yields frames with correct shapes. Scenario: Iterating over video frames using a generator. Expec
tests/utils/test_video.py:188
Function
test_get_video_frames_generator_with_start_end
Verify that get_video_frames_generator respects start and end frame indices. Scenario: Iterating over a specific range of video frames using
tests/utils/test_video.py:310
Function
test_get_video_frames_generator_with_stride
Verify that get_video_frames_generator correctly handles the stride parameter. Scenario: Iterating over video frames with specified stride (
tests/utils/test_video.py:203
Function
test_getitem
Ensures that `Detections.__getitem__` (indexing/slicing) works correctly for various input types. This is a core feature that allows users to
tests/detection/test_core.py:299
Function
test_group_coco_annotations_by_image_id
( coco_annotations: list[dict], expected_result: dict, exception: Exception )
tests/dataset/formats/test_coco.py:248
Function
test_group_overlapping_boxes
( predictions: np.ndarray, iou_threshold: float, expected_result: list[list[int]], exception:
tests/detection/utils/test_iou_and_nms.py:163
Method
test_groups_overlapping_oriented_boxes
Two near-identical OBBs should be merged into one group; an X-pattern pair should produce two separate groups.
tests/detection/utils/test_iou_and_nms.py:1562
Method
test_half_overlap_matches_analytic_value
Two unit-height 2x2 squares offset by 1 share half their area: IoU=1/3.
tests/detection/utils/test_iou_and_nms.py:1238
Method
test_handles_batched_oriented_boxes
Multiple OBBs in one `Detections` each get their own correct area. Guards against the shoelace reduction collapsing across boxes instead
tests/detection/test_core.py:1845
Function
test_hex_color_support_across_annotators
( factory, expected_colors: dict[str, tuple[int, int, int]] )
tests/annotators/test_core.py:104
Function
test_hex_to_rgba_invalid
(hex_color: str)
tests/annotators/test_utils.py:202
Function
test_hex_to_rgba_valid
( hex_color: str, expected_rgba: tuple[int, int, int, int] )
tests/annotators/test_utils.py:195
Method
test_idempotent_no_duplicate_handlers
Calling _get_logger twice with the same name does not add extra handlers.
tests/utils/test_logger.py:75
Method
test_identical_disjoint_and_empty
Identical/all-True → 1.0; all-False/disjoint → 0.0; empty keeps shape.
tests/detection/utils/test_iou_and_nms.py:1677
Method
test_identical_masks_give_one
IoU of a mask with itself must be 1.0.
tests/detection/test_compact_mask_iou.py:81
Method
test_identity_4x4
Identity resize (same dimensions) preserves the decoded mask.
tests/detection/test_compact_mask.py:1239
Method
test_identity_preserves_rle
Resize to same shape returns identical RLE, offsets, and crop shapes.
tests/detection/test_compact_mask.py:1119
Function
test_image
Create a simple blank test image fixture
tests/annotators/test_core.py:44
Function
test_image_assets_list
Test that ImageAssets.list() returns all image filenames.
tests/assets/test_list.py:27
Function
test_image_assets_values
Test that ImageAssets enum members have correct attributes.
tests/assets/test_list.py:43
Function
test_image_name_to_annotation_name
( image_name: str, expected_result: str | None, exception: Exception )
tests/dataset/formats/test_yolo.py:229
Function
test_images_to_cv2_when_empty_input_provided
()
tests/utils/test_conversion.py:111
Function
test_images_to_cv2_when_mixed_input_provided
( empty_pillow_image: Image.Image, empty_cv2_image: np.ndarray, )
tests/utils/test_conversion.py:154
Function
test_images_to_cv2_when_only_cv2_images_provided
( empty_cv2_image: np.ndarray, )
tests/utils/test_conversion.py:119
Function
test_images_to_cv2_when_only_pillow_images_provided
( empty_pillow_image: Image.Image, empty_cv2_image: np.ndarray, )
tests/utils/test_conversion.py:136
Method
test_individual_mask_access
cm[i] must equal masks[i] for every index.
tests/detection/test_compact_mask.py:830
Function
test_inference_slicer_keeps_crossed_obb_detections
Regression for issue #1679: the SAHI workflow with OBB detections dropped valid detections at the merge step because `with_nms`/`with_nmm` his
tests/detection/tools/test_inference_slicer.py:453
Method
test_initialization_custom
Test that F1Score can be initialized with custom parameters
tests/metrics/test_f1_score.py:47
Method
test_initialization_custom
Test that Recall can be initialized with custom parameters
tests/metrics/test_recall.py:47
Method
test_initialization_custom
Test that Precision can be initialized with custom parameters
tests/metrics/test_precision.py:47
Method
test_initialization_default
Test that F1Score can be initialized with default parameters
tests/metrics/test_f1_score.py:39
Method
test_initialization_default
Test that Recall can be initialized with default parameters
tests/metrics/test_recall.py:39
Method
test_initialization_default
Test that Precision can be initialized with default parameters
tests/metrics/test_precision.py:39
Method
test_inner_pair_with_compact
(self)
tests/detection/test_compact_mask_integration.py:194
Method
test_int_returns_2d_dense
(self)
tests/detection/test_compact_mask.py:178
Method
test_int_wraps_to_compact_mask
(self)
tests/detection/test_compact_mask_integration.py:71
Method
test_invalid_asset
Test download_assets with invalid asset name.
tests/assets/test_downloader.py:105
Method
test_invalid_asset_when_file_exists
Test download_assets with invalid asset name that already exists.
tests/assets/test_downloader.py:116
Method
test_invalid_dimensions_raises
Resize with non-positive dimensions raises ValueError.
tests/detection/test_compact_mask.py:1154
Method
test_invalid_kernel_size_raises
BlurAnnotator must reject kernel_size < 1 at construction time.
tests/annotators/test_core.py:723
Method
test_invalid_ndim_raises
2D and 4D inputs must raise ValueError before reaching shape[1:] check.
tests/detection/utils/test_iou_and_nms.py:1667
Method
test_invalid_pixel_size_raises
PixelateAnnotator must reject pixel_size < 1 at construction time.
tests/annotators/test_core.py:792
Method
test_invalid_shape_raises_value_error
Inputs with wrong shape raise ValueError before any computation.
tests/detection/utils/test_iou_and_nms.py:1367
Method
test_ios_metric
IOS = intersection / min(area_a, area_b) must match dense reference.
tests/detection/test_compact_mask_iou.py:144
Function
test_is_compressed_rle
is_compressed_rle returns True for str/bytes, False otherwise.
tests/detection/utils/test_converters.py:625
Function
test_is_empty
Verify is_empty() returns True iff the Detections object has zero detections.
tests/detection/test_core.py:941
Method
test_is_invariant_to_canvas_transforms
IoU is invariant under uniform scaling and translation. Both are affine maps, so exact polygon IoU matches the small-coordinate basel
tests/detection/utils/test_iou_and_nms.py:1203
Function
test_is_valid_hex
(hex_color: str, expected_result: bool)
tests/annotators/test_utils.py:247
Method
test_iter_yields_2d_dense
(self)
tests/detection/test_compact_mask_integration.py:102
Method
test_join_true_true_junction_no_zero_run
_rle_join_cols merges True/True boundary; no zero-length False run inserted. When column A ends True and column B starts True (leading False
tests/detection/test_compact_mask.py:1040
Function
test_json_default_raises_for_unserializable_type
_json_default raises TypeError for non-numpy objects.
tests/detection/test_json.py:439
Function
test_json_sink
( detections: sv.Detections, custom_data: dict[str, Any] | None, second_detections: sv.Detections,
tests/detection/test_json.py:377
Function
test_json_sink_serializes_nested_numpy_array_custom_data
NumPy array nested inside a custom_data dict value serializes as a JSON array.
tests/detection/test_json.py:425
Function
test_json_sink_serializes_numpy_scalar_custom_data
NumPy scalar in custom_data serializes as a JSON number or boolean.
tests/detection/test_json.py:408
Method
test_keeps_single_prediction
A single OBB prediction is always kept, regardless of threshold.
tests/detection/utils/test_iou_and_nms.py:1456
Method
test_keeps_x_pattern
X-pattern: two thin rectangles crossing at +/-45° share an AABB but barely overlap as OBBs. AABB-NMS would suppress one; OBB-NMS must keep
tests/detection/utils/test_iou_and_nms.py:1381
Function
test_key_points_as_detections
Test the as_detections method for KeyPoints objects.
tests/key_points/test_core.py:691
Function
test_key_points_as_detections_confidence_over_selected_indices
Confidence mean uses only the selected keypoint columns, not all.
tests/key_points/test_core.py:749
Function
test_key_points_as_detections_empty
Test the as_detections method for empty KeyPoints objects.
tests/key_points/test_core.py:702
Function
test_key_points_as_detections_ignores_missing_keypoints
A [0, 0] keypoint is treated as missing and excluded from the box.
tests/key_points/test_core.py:709
Function
test_key_points_as_detections_mixed_valid_invalid_batch
Batch with one all-zero skeleton: invalid skeleton gets box zeroed.
tests/key_points/test_core.py:763
Function
test_key_points_as_detections_selected_keypoint_indices
Only the selected keypoints contribute to the bounding box.
tests/key_points/test_core.py:736
Function
test_key_points_as_detections_uses_detection_confidence
detection_confidence is preferred over the keypoint-confidence mean.
tests/key_points/test_core.py:722
Function
test_key_points_as_detections_with_data
Test the as_detections method preserves data.
tests/key_points/test_core.py:778
Function
test_key_points_empty
Test the creation and behavior of an empty KeyPoints object.
tests/key_points/test_core.py:629
Function
test_key_points_equality
Test the equality comparison for KeyPoints objects.
tests/key_points/test_core.py:861
Function
test_key_points_equality_with_data
Test the equality comparison for KeyPoints objects with data.
tests/key_points/test_core.py:867
Function
test_key_points_getitem
(key_points, index, expected_result, exception)
tests/key_points/test_core.py:371
Function
test_key_points_getitem_detection_level
Detection-level filtering mirrors Detections API patterns.
tests/key_points/test_core.py:508
Function
test_key_points_is_empty
Test the is_empty method for KeyPoints objects.
tests/key_points/test_core.py:637
Function
test_key_points_iteration
Test the iteration over KeyPoints objects.
tests/key_points/test_core.py:791
Function
test_key_points_iteration_no_confidence
Test the iteration over KeyPoints objects without confidence.
tests/key_points/test_core.py:809
Function
test_key_points_setitem
Test the __setitem__ method for KeyPoints objects.
tests/key_points/test_core.py:650
Method
test_keypoints_init_covers_all_dataclass_fields
Custom __init__ must assign every dataclass field — guards against drift.
tests/key_points/test_core.py:1072
Method
test_large_scale_ratio
1x1 source resized to large shape fills entirely True or False.
tests/detection/test_compact_mask.py:1477
Method
test_len
(self)
tests/detection/test_compact_mask.py:251
Method
test_length_mismatch_raises
Mismatched predictions and oriented_boxes must fail loudly, not silently misalign rows.
tests/detection/utils/test_iou_and_nms.py:1433
Function
test_letterbox_image_for_grayscale_opencv_image
()
tests/utils/test_image.py:75
Function
test_letterbox_image_for_opencv_image
()
tests/utils/test_image.py:51
Function
test_letterbox_image_for_pillow_image
()
tests/utils/test_image.py:110
Function
test_letterbox_image_for_rgba_opencv_image
RGBA input: padded alpha=0, interior alpha preserved, input array not mutated.
tests/utils/test_image.py:92
Function
test_line_zone_annotator_multiclass_supports_none_class_id
()
tests/detection/test_line_counter.py:884
Function
test_line_zone_long_horizon_disappearing_detections
( vector: Vector, xyxy_sequence: list[list[list[float] | None]], anchors: list[Position], mini
tests/detection/test_line_counter.py:769
Function
test_line_zone_multiple_detections
( vector: Vector, xyxy_sequence: list[list[list[float]]], anchors: list[Position], expected_cr
tests/detection/test_line_counter.py:481
Function
test_line_zone_one_detection
( vector: Vector, xyxy_sequence: list[list[float]], triggering_anchors: list[Position], expect
tests/detection/test_line_counter.py:403
Function
test_line_zone_one_detection_default_anchors
( vector: Vector, xyxy_sequence: list[list[float]], expected_crossed_in: list[bool], expected_
tests/detection/test_line_counter.py:236
Function
test_line_zone_one_detection_long_horizon
( vector: Vector, xyxy_sequence: list[list[float]], triggering_anchors: list[Position], minimu
tests/detection/test_line_counter.py:596
Function
test_line_zone_tracker_id_reuse_with_different_classes
( xyxy_sequence: list[list[list[float]]], tracker_id_sequence: list[list[int]], class_id_sequence:
tests/detection/test_line_counter.py:863
Function
test_list_files_with_extensions_normalization
Extension matching normalizes leading dots, case, and multi-part extensions.
tests/utils/test_file.py:94
Method
test_list_index
Integer list indexing must match dense fancy indexing.
tests/detection/test_compact_mask.py:900
Method
test_list_inputs
Test F1 score with list inputs
tests/metrics/test_f1_score.py:278
Method
test_list_inputs
Test recall with list inputs
tests/metrics/test_recall.py:177
Method
test_list_inputs
Test precision with list inputs
tests/metrics/test_precision.py:246
Method
test_list_returns_compact_mask
(self)
tests/detection/test_compact_mask.py:190
Function
test_load_coco_annotations_accepts_valid_nested_file_name
Accept a legitimate nested file_name inside images/ without raising.
tests/dataset/formats/test_coco.py:1365
Function
test_load_coco_annotations_force_masks_handles_missing_segmentation
( tmp_path, )
tests/dataset/formats/test_coco.py:1387
← previous
next →
1,301–1,400 of 1,714, ranked by callers