MCPcopy Create free account

hub / github.com/roboflow/supervision / functions

Functions1,714 in github.com/roboflow/supervision

Methodtest_parity_seed
(self, seed: int)
tests/detection/test_compact_mask.py:925
Functiontest_parse_polygon_points
( polygon_element, expected_result: list[list], exception, )
tests/dataset/formats/test_pascal_voc.py:131
Methodtest_partial_overlap
Partially overlapping masks: IoU should match the analytic value.
tests/detection/test_compact_mask_iou.py:125
Methodtest_perfect_match
Test F1 score with perfect matching predictions and targets
tests/metrics/test_f1_score.py:72
Methodtest_perfect_match
Test recall with perfect matching predictions and targets
tests/metrics/test_recall.py:72
Methodtest_perfect_match
Test precision with perfect matching predictions and targets
tests/metrics/test_precision.py:72
Methodtest_perfect_non_square_oriented_boxes_get_full_map
Smoke test: MeanAveragePrecision accepts non-square OBB inputs without error. NOTE: MeanAveragePrecision uses the COCO evaluator path
tests/metrics/test_mean_average_precision.py:38
Functiontest_perfect_non_square_oriented_boxes_score_as_perfect
Perfect non-square OBB predictions score 1.0 for metrics that use OBB IoU.
tests/metrics/test_oriented_bounding_box_metrics.py:36
Functiontest_pillow_to_cv2
( empty_cv2_image: np.ndarray, empty_pillow_image: Image.Image )
tests/utils/test_conversion.py:99
Methodtest_polygon_annotator
(self)
tests/detection/test_compact_mask_integration.py:256
Functiontest_polygon_zone_annotator
( scene: np.ndarray, polygon_zone_annotator: sv.PolygonZoneAnnotator, expected_results: np.ndarray
tests/detection/test_polygon_zone_annotator.py:54
Functiontest_polygons_to_masks_multiple_polygons_shape
Regression test for #1746: _polygons_to_masks must return shape (N, H, W). The original PR rewrite processed only a single polygon and always ret
tests/dataset/formats/test_yolo.py:412
Methodtest_precision_recall_imbalance
Test F1 score with different precision and recall scenarios
tests/metrics/test_f1_score.py:222
Methodtest_prime_sized_crops
Prime-sized crops with non-integer scale ratios match cv2 exactly.
tests/detection/test_compact_mask.py:1449
Functiontest_private_validation_paths_do_not_warn
()
tests/test_validate_deprecations.py:102
Functiontest_process_roboflow_result
( roboflow_result: dict, expected_result: tuple[ np.ndarray, np.ndarray, np.ndarray, np.ndarra
tests/detection/utils/test_internal.py:454
Functiontest_process_video_custom_params
Verify that process_video works correctly with custom performance parameters. Scenario: Processing video with custom prefetch and buffer par
tests/utils/test_video.py:123
Functiontest_process_video_exception_handling
Verify that process_video correctly propagates exceptions from the callback. Scenario: Processing a video where the callback raises an excep
tests/utils/test_video.py:29
Functiontest_process_video_exception_with_small_buffer
Verify that process_video handles exceptions correctly even with small buffers. Scenario: Processing a video with minimal buffering where an
tests/utils/test_video.py:73
Functiontest_process_video_max_frames
Verify that process_video respects the max_frames parameter. Scenario: Processing only a limited number of frames using `max_frames`. Ex
tests/utils/test_video.py:97
Functiontest_process_video_no_audio_by_default
Verify that process_video does not call _mux_audio when preserve_audio=False. Scenario: Default process_video call without setting preserve_
tests/utils/test_video.py:238
Functiontest_process_video_preserve_audio_calls_mux
Verify that process_video calls _mux_audio when preserve_audio=True. Scenario: Processing a video with preserve_audio=True and ffmpeg availa
tests/utils/test_video.py:216
Functiontest_process_video_success
Verify successful video processing with a pass-through callback. Scenario: Successfully processing a video with a simple pass-through callba
tests/utils/test_video.py:52
Methodtest_raises_on_malformed_obb_coordinates_shape
ValueError when OBB data shape is wrong for area computation.
tests/detection/test_core.py:1865
Methodtest_raises_on_non_positive_epsilon_step
Non-positive epsilon_step must raise ValueError.
tests/detection/utils/test_polygons.py:167
Methodtest_raises_on_out_of_range_percentage
Percentage outside [0, 1) must raise ValueError.
tests/detection/utils/test_polygons.py:154
Functiontest_read_txt_file
( file_name: str, skip_empty: bool, expected_result: list[str] | None, exception: Exception, )
tests/utils/test_file.py:62
Methodtest_rejects_unsupported_overlap_metric
An overlap metric other than IOU or IOS raises ValueError.
tests/detection/utils/test_iou_and_nms.py:1295
Methodtest_repack_already_tight
repack() is a no-op when bboxes are already tight.
tests/detection/test_compact_mask.py:573
Methodtest_repack_empty_collection
repack() on an empty CompactMask returns another empty CompactMask.
tests/detection/test_compact_mask.py:561
Methodtest_repack_preserves_all_false_mask
repack() normalises an all-False mask to a 1x1 crop.
tests/detection/test_compact_mask.py:547
Methodtest_repack_tightens_loose_bbox
repack() shrinks the crop to the minimal True-pixel rectangle.
tests/detection/test_compact_mask.py:526
Methodtest_reset
Test that reset() clears all stored data
tests/metrics/test_f1_score.py:56
Methodtest_reset
Test that reset() clears all stored data
tests/metrics/test_recall.py:56
Methodtest_reset
Test that reset() clears all stored data
tests/metrics/test_precision.py:56
Methodtest_resize_dispatch_uses_cv2_for_dense
_resize_crop falls back to cv2 for dense masks (above _L3_DENSITY_THRESHOLD). Checkerboard yields ~1 run per pixel, far above the 0.25 thresh
tests/detection/test_compact_mask.py:1510
Methodtest_resize_dispatch_uses_l3_for_sparse
resize() dispatches to _rle_resize for sparse masks.
tests/detection/test_compact_mask.py:1496
Functiontest_resize_image_for_opencv_image
()
tests/utils/test_image.py:13
Functiontest_resize_image_for_pillow_image
()
tests/utils/test_image.py:31
Functiontest_resolve_color_idx
( detections: Detections, detection_idx: int, color_lookup: ColorLookup | np.ndarray, expected
tests/annotators/test_utils.py:104
Methodtest_resolve_color_list_returns_expected
(self, colors, points_count, expected)
tests/key_points/test_annotators.py:488
Methodtest_resolve_color_list_wrong_length_raises
(self, colors, points_count)
tests/key_points/test_annotators.py:502
Methodtest_resolve_labels_raises
(self, labels, points_count, class_id, match)
tests/key_points/test_annotators.py:467
Methodtest_resolve_labels_returns_expected
( self, labels, points_count, class_id, expected )
tests/key_points/test_annotators.py:428
Methodtest_returns_crop_shape
(self)
tests/detection/test_compact_mask.py:301
Functiontest_rgba_to_hex
(rgba: tuple[int, int, int, int], expected_hex: str)
tests/annotators/test_utils.py:216
Functiontest_rgba_to_hex_invalid
(rgba: tuple[int, ...])
tests/annotators/test_utils.py:229
Functiontest_rle_counts_to_mask
_rle_counts_to_mask reconstructs the correct boolean mask from run lengths.
tests/detection/utils/test_converters.py:850
Functiontest_rle_to_mask
( rle: npt.NDArray[np.int_], resolution_wh: tuple[int, int], expected_mask: npt.NDArray[np.bool_],
tests/detection/utils/test_converters.py:582
Methodtest_round_trip
(self, num_masks: int, image_shape: tuple[int, int])
tests/detection/test_compact_mask.py:149
Methodtest_round_trip_random
Split then rejoin must reconstruct original mask for random inputs.
tests/detection/test_compact_mask.py:1013
Methodtest_round_trip_with_mask_to_xyxy
Round-trip must be lossless with inclusive xyxy from mask_to_xyxy.
tests/detection/test_compact_mask.py:156
Methodtest_roundtrip_parity_with_cv2
_rle_resize matches cv2.resize(INTER_NEAREST) within 1-pixel tolerance.
tests/detection/test_compact_mask.py:1381
Functiontest_run_callback_does_not_rewarn_on_second_call
Test that a second call to the same slicer instance does not re-emit the out-of-bounds warning even when detections are still out of bounds.
tests/detection/tools/test_inference_slicer.py:362
Functiontest_run_callback_no_warning_for_detection_exactly_at_slice_boundary
Test that a detection whose coordinates exactly equal the slice dimensions does not trigger the warning (boundary is exclusive: > not >=).
tests/detection/tools/test_inference_slicer.py:334
Functiontest_run_callback_no_warning_when_detections_inside_slice_bounds
Test that no warning is emitted when callback returns detections within the slice bounds.
tests/detection/tools/test_inference_slicer.py:252
Functiontest_run_callback_warns_only_once_for_out_of_bounds_detections
Test that the out-of-bounds warning is only emitted once even across multiple slices.
tests/detection/tools/test_inference_slicer.py:225
Functiontest_run_callback_warns_only_once_with_multiple_threads
Test that exactly one warning fires even with thread_workers > 1, validating that the threading.Lock makes the check-and-set atomic.
tests/detection/tools/test_inference_slicer.py:301
Functiontest_run_callback_warns_when_detections_have_negative_coordinates
Test that a warning is emitted when callback returns detections with negative coordinates, indicating wrong reference frame.
tests/detection/tools/test_inference_slicer.py:279
Functiontest_run_callback_warns_when_detections_outside_slice_bounds
Test that a warning is emitted when callback returns detections with coordinates outside the slice bounds.
tests/detection/tools/test_inference_slicer.py:206
Functiontest_save_coco_annotations_annotation_image_id_references_correct_image
Every annotation's image_id must reference an image id present in the same file, even when a non-default starting_image_id is used.
tests/dataset/formats/test_coco.py:1768
Functiontest_save_coco_annotations_defaults_start_at_one
(tmp_path)
tests/dataset/formats/test_coco.py:1660
Functiontest_save_coco_annotations_empty_dataset_returns_starting_ids
An empty dataset writes a valid (but empty) COCO file and returns the starting ids unchanged so chaining still composes around it.
tests/dataset/formats/test_coco.py:1735
Functiontest_save_coco_annotations_rejects_zero_starting_ids
starting_image_id and starting_annotation_id below 1 must raise ValueError.
tests/dataset/formats/test_coco.py:1868
Functiontest_save_coco_annotations_respects_starting_ids
(tmp_path)
tests/dataset/formats/test_coco.py:1676
Functiontest_save_coco_annotations_zero_annotation_images
Dataset with images but zero detections per image: image ids are assigned sequentially but annotation list stays empty.
tests/dataset/formats/test_coco.py:1790
Functiontest_scale_boxes
( xyxy: np.ndarray, factor: float, expected_result: np.ndarray, exception: Exception, )
tests/detection/utils/test_boxes.py:142
Methodtest_scale_shape_and_offsets
Resize scales shape and offsets proportionally.
tests/detection/test_compact_mask.py:1092
Methodtest_scenario_1_success_case_imperfect_match
Scenario 1: Success Case with imperfect match
tests/metrics/test_mean_average_precision.py:83
Methodtest_scenario_2_missed_detection
Scenario 2: GT Present, No Prediction (Missed Detection)
tests/metrics/test_mean_average_precision.py:137
Methodtest_scenario_3_false_positive
Scenario 3: No GT, Prediction Present (False Positive)
tests/metrics/test_mean_average_precision.py:175
Methodtest_scenario_4_no_data
Scenario 4: No GT, No Prediction (Category has no data)
tests/metrics/test_mean_average_precision.py:214
Methodtest_scenario_5_only_one_class_present
Scenario 5: Only 1 of 3 Classes Present (Perfect Match)
tests/metrics/test_mean_average_precision.py:264
Methodtest_self_comparison_is_symmetric_with_unit_diagonal
Comparing a set with itself yields a symmetric matrix and a 1.0 diagonal.
tests/detection/utils/test_iou_and_nms.py:1272
Methodtest_self_iou_diagonal
Self-IoU diagonal must be 1.0 for masks with at least one True pixel.
tests/detection/test_compact_mask_iou.py:458
Methodtest_shape
(self)
tests/detection/test_compact_mask.py:256
Methodtest_shape_and_len
len() and .shape must agree with the dense array.
tests/detection/test_compact_mask.py:820
Methodtest_shape_empty
(self)
tests/detection/test_compact_mask.py:261
Methodtest_single_class
Test precision calculation for single class with mixed results
tests/metrics/test_precision.py:198
Methodtest_single_class_missed_detections
Test recall calculation with some missed detections
tests/metrics/test_recall.py:116
Methodtest_single_class_mixed_results
Test F1 score calculation with mixed precision and recall
tests/metrics/test_f1_score.py:207
Functiontest_single_perfect_detection
Test that a single perfect detection yields 1.0 recall.
tests/metrics/test_mean_average_recall.py:362
Methodtest_single_perfect_detection
Test that single perfect detection gets 1.0 mAP (not 0.0 due to ID=0 bug)
tests/metrics/test_mean_average_precision.py:10
Methodtest_single_pixel_true_upscale
Single True pixel in a 3x3 mask upscaled preserves position.
tests/detection/test_compact_mask.py:1363
Methodtest_single_prediction_returns_singleton_group
A single OBB prediction should be returned as one singleton group.
tests/detection/utils/test_iou_and_nms.py:1550
Methodtest_skeleton_enum_values
Test skeleton enum has correct structure.
tests/key_points/test_skeletons.py:9
Methodtest_skeletons_by_edge_count
Test SKELETONS_BY_EDGE_COUNT dictionary mapping.
tests/key_points/test_skeletons.py:27
Methodtest_skeletons_by_vertex_count
Test SKELETONS_BY_VERTEX_COUNT dictionary population.
tests/key_points/test_skeletons.py:17
Methodtest_skeletons_by_vertex_count_mapping_behaviour
Test SKELETONS_BY_VERTEX_COUNT uses last-in-wins for duplicate counts.
tests/key_points/test_skeletons.py:47
Methodtest_slice_preserves_compact_mask
(self)
tests/detection/test_compact_mask_integration.py:78
Methodtest_slice_returns_compact_mask
(self)
tests/detection/test_compact_mask.py:207
Methodtest_smooth_does_not_crash_for_unique_point_counts
smooth=True must not crash for any unique-position count from 1 to 4. Each position is repeated twice to simulate brief holds between moves.
tests/annotators/test_core.py:997
Methodtest_smooth_fallback_matches_raw_when_fewer_than_four_unique_points
With <4 unique positions smooth=True output must match smooth=False. Verifies the dedup-then-fallback path: when unique_xy has ≤3 points,
tests/annotators/test_core.py:1018
Methodtest_smooth_false_stationary_tracker_does_not_crash
smooth=False with a stationary tracker must not crash (regression guard). Ensures the refactor did not accidentally alter the smooth=False co
tests/annotators/test_core.py:1061
Methodtest_smooth_trace_still_renders_for_moving_tracker
Moving tracker must produce a spline trace distinct from the raw polyline. Compares smooth=True output against smooth=False for the same move
tests/annotators/test_core.py:965
Methodtest_smooth_true_single_frame_does_not_crash
A single annotate() call with smooth=True must not crash. When len(xy) == 1 the drawing guard skips cv2.polylines entirely; the dedup
tests/annotators/test_core.py:1046
Methodtest_smoother_confidence_scenarios
Boxes average over window; confidence averages present values or None.
tests/detection/tools/test_smoother.py:38
Methodtest_smoother_multi_track_mixed_confidence_does_not_crash
Two tracks with different confidence presence must not raise on merge.
tests/detection/tools/test_smoother.py:68
Methodtest_smoother_tracker_id_none_warns_and_returns_unchanged
update_with_detections warns and returns input when tracker_id is None.
tests/detection/tools/test_smoother.py:88
Methodtest_smoother_window_full_averages_all_frames
Full window (length=3) averages all 3 frames, not just the last two.
tests/detection/tools/test_smoother.py:101
← previousnext →1,501–1,600 of 1,714, ranked by callers