MCPcopy Create free account

hub / github.com/roboflow/supervision / functions

Functions1,714 in github.com/roboflow/supervision

Functiontest_detections_to_coco_annotations_data_area_overrides_bbox_with_mask
data["area"] should override computed bbox area even when a mask is present.
tests/dataset/formats/test_coco.py:1137
Functiontest_detections_to_coco_annotations_exports_all_polygons
All polygons from a multi-component mask must be exported, not just the first.
tests/dataset/formats/test_coco.py:1965
Functiontest_detections_to_coco_annotations_fallback_area_when_no_data
When detections have no area in data, area should fall back to bbox area.
tests/dataset/formats/test_coco.py:1159
Functiontest_detections_to_coco_annotations_handles_empty_approximated_polygons
()
tests/dataset/formats/test_coco.py:968
Functiontest_detections_to_coco_annotations_iscrowd_is_int_when_mask_provided
iscrowd should be stored as int (0 or 1), not as Python bool.
tests/dataset/formats/test_coco.py:1115
Functiontest_detections_to_coco_annotations_preserves_area_from_data
area stored in detections.data should be used instead of bbox area.
tests/dataset/formats/test_coco.py:1073
Functiontest_detections_to_coco_annotations_preserves_iscrowd_from_data_when_no_mask
iscrowd stored in detections.data should be used when no mask is present.
tests/dataset/formats/test_coco.py:1093
Functiontest_detections_to_coco_annotations_raises_when_class_id_is_none
Detections with no class_id must raise ValueError before +1 arithmetic.
tests/dataset/formats/test_coco.py:1887
Functiontest_detections_to_coco_annotations_round_trip_disjoint_mask
Two-part disjoint mask round-trips through COCO export and import unchanged.
tests/dataset/formats/test_coco.py:1060
Functiontest_detections_to_coco_annotations_segmentation_count
Non-crowd mask export produces one polygon list entry per connected component.
tests/dataset/formats/test_coco.py:1044
Functiontest_detections_to_pascal_voc_does_not_mutate_detections
Exporting detections must not shift the source xyxy, and must be repeatable.
tests/dataset/formats/test_pascal_voc.py:101
Methodtest_detections_to_tensor
Verify that Detections objects are correctly converted to NumPy tensors. Scenario: Converting Detections objects to NumPy tensors.
tests/metrics/test_detection.py:364
Functiontest_detections_to_yolo_annotations_obb_data_ignored_when_is_obb_false
OBB data in detections.data must be silently ignored when is_obb=False.
tests/dataset/formats/test_yolo.py:620
Functiontest_detections_to_yolo_annotations_obb_emits_nine_tokens
`is_obb=True` must serialize the 4 corners from `data['xyxyxyxy']`.
tests/dataset/formats/test_yolo.py:536
Functiontest_detections_to_yolo_annotations_obb_empty_emits_no_lines
`is_obb=True` on an empty `Detections` must not raise — image had no labels.
tests/dataset/formats/test_yolo.py:576
Functiontest_detections_to_yolo_annotations_obb_multiple_detections
OBB export must correctly serialize N>1 detections per image.
tests/dataset/formats/test_yolo.py:584
Functiontest_detections_to_yolo_annotations_obb_raises_without_corners
`is_obb=True` without `'xyxyxyxy'` in data must fail loudly, not silently.
tests/dataset/formats/test_yolo.py:564
Functiontest_detections_to_yolo_annotations_raises_for_non_integer_class_id
()
tests/dataset/formats/test_yolo.py:351
Methodtest_different_iou_thresholds
Test F1 score at different IoU thresholds
tests/metrics/test_f1_score.py:255
Methodtest_different_iou_thresholds
Test recall at different IoU thresholds
tests/metrics/test_recall.py:147
Methodtest_different_iou_thresholds
Test precision at different IoU thresholds
tests/metrics/test_precision.py:227
Methodtest_disjoint_boxes_score_zero
Boxes whose envelopes do not overlap are pruned by the gate to 0.0.
tests/detection/utils/test_iou_and_nms.py:1248
Methodtest_download_new_file
Test download_assets downloading a new file.
tests/assets/test_downloader.py:73
Methodtest_drop_extra_matches
( self, matches, expected_result: np.ndarray | None, exception: Exception,
tests/metrics/test_detection.py:581
Methodtest_dtype
(self)
tests/detection/test_compact_mask.py:270
Methodtest_dtype_cast
(self)
tests/detection/test_compact_mask.py:330
Functiontest_edit_distance
(string_1, string_2, case_sensitive, expected_result)
tests/detection/utils/test_vlms.py:63
Methodtest_empty_anchors_raises
(self, polygon, triggering_anchors, exception)
tests/detection/test_polygonzone.py:43
Methodtest_empty_compact_mask_to_dense
(self)
tests/detection/test_compact_mask.py:461
Methodtest_empty_detections_with_obb_data_returns_empty_array
Boundary case: empty Detections carrying an OBB data field must return an empty area array (matches the mask / box_area branches).
tests/detection/test_core.py:1826
Methodtest_empty_input_returns_correct_shape
Empty inputs trigger the early-return path; result is zero-filled.
tests/detection/utils/test_iou_and_nms.py:1348
Methodtest_empty_inputs
Empty CompactMask collections should return a zero-shaped matrix.
tests/detection/test_compact_mask_iou.py:172
Methodtest_empty_n0
Resize of an empty CompactMask returns empty with new image_shape.
tests/detection/test_compact_mask.py:1134
Methodtest_empty_predictions
Test F1 score with empty predictions but existing targets
tests/metrics/test_f1_score.py:99
Methodtest_empty_predictions
Test recall with empty predictions but existing targets
tests/metrics/test_recall.py:94
Methodtest_empty_predictions
Test precision with empty predictions but existing targets
tests/metrics/test_precision.py:95
Methodtest_empty_predictions
No OBB predictions should produce an empty boolean keep mask.
tests/detection/utils/test_iou_and_nms.py:1443
Methodtest_empty_predictions_and_targets
Test completely empty predictions and targets
tests/metrics/test_mean_average_precision.py:321
Methodtest_empty_predictions_returns_empty_groups
No OBB predictions should produce no merge groups.
tests/detection/utils/test_iou_and_nms.py:1539
Methodtest_empty_targets
Test F1 score with predictions but no targets
tests/metrics/test_f1_score.py:113
Methodtest_empty_targets
Test recall with predictions but no targets
tests/metrics/test_recall.py:105
Methodtest_empty_targets
Test precision with predictions but no targets
tests/metrics/test_precision.py:106
Methodtest_encode_agrees_with_mask_to_rle
_mask_to_rle_counts output matches the public mask_to_rle encoder.
tests/detection/test_compact_mask.py:128
Methodtest_encode_decode_round_trip
_mask_to_rle_counts -> _rle_counts_to_mask round-trip is lossless.
tests/detection/test_compact_mask.py:64
Methodtest_encode_matches_coco_f_order
_mask_to_rle_counts produces COCO-compatible F-order RLE for known masks.
tests/detection/test_compact_mask.py:113
Functiontest_ensure_cv2_image_for_processing_when_cv2_image_submitted
( empty_cv2_image: np.ndarray, )
tests/utils/test_conversion.py:51
Functiontest_ensure_cv2_image_for_processing_when_pillow_image_submitted
( empty_cv2_image: np.ndarray, empty_pillow_image: Image.Image )
tests/utils/test_conversion.py:12
Methodtest_envelope_overlap_without_polygon_overlap_scores_zero
Parallel rotated bars share an envelope but not a body, so they score 0. Exercises the path where a pair passes the axis-aligned gate yet has
tests/detection/utils/test_iou_and_nms.py:1282
Methodtest_eq_different
(self)
tests/detection/test_compact_mask.py:410
Methodtest_eq_identical
(self)
tests/detection/test_compact_mask.py:403
Methodtest_eq_with_dense_array
(self)
tests/detection/test_compact_mask.py:419
Functiontest_equal
( detections_a: Detections, detections_b: Detections, expected_result: bool )
tests/detection/test_core.py:716
Methodtest_equality_visible_none_vs_set
(self)
tests/key_points/test_core.py:616
Methodtest_equality_with_visible
(self)
tests/key_points/test_core.py:597
Methodtest_evaluate_detection_batch
( self, predictions, targets, num_classes, conf_threshold, iou
tests/metrics/test_detection.py:549
Methodtest_explicit_level
Logger uses the explicitly provided level.
tests/utils/test_logger.py:28
Functiontest_extract_class_names_sorts_numeric_string_keys
_extract_class_names returns class names sorted by class index.
tests/dataset/formats/test_yolo.py:268
Methodtest_falls_back_to_box_area_without_obb_data
Without ORIENTED_BOX_COORDINATES, area mirrors box_area (AABB).
tests/detection/test_core.py:1801
Methodtest_falls_back_without_obb_data
Non-OBB heavily-overlapping AABBs collapse to one under either method.
tests/detection/test_core.py:1050
Methodtest_false_positives_of_absent_class_counted
Predictions of absent class count as FPs under MICRO/MACRO; WEIGHTED excludes them by design (GT support=0 → weight=0, consistent with sklearn
tests/metrics/test_f1_score.py:170
Methodtest_false_positives_of_absent_class_counted
Predictions of absent class count as FPs under MICRO/MACRO; WEIGHTED excludes them by design (GT support=0 → weight=0, consistent with sklearn
tests/metrics/test_precision.py:161
Methodtest_false_positives_on_background_image_counted
Predictions on an image with no targets must count as false positives.
tests/metrics/test_f1_score.py:127
Methodtest_false_positives_on_background_image_counted
Predictions on an image with no targets must count as false positives.
tests/metrics/test_precision.py:118
Methodtest_false_positives_on_background_image_weighted_returns_zero
WEIGHTED F1 is 0.0 when all images are background (no GT anywhere).
tests/metrics/test_f1_score.py:193
Methodtest_false_positives_on_background_image_weighted_returns_zero
WEIGHTED precision is 0.0 when all images are background (no GT anywhere).
tests/metrics/test_precision.py:184
Methodtest_file_exists_matching_hash
Test is_md5_hash_matching when file exists and hash matches.
tests/assets/test_downloader.py:10
Methodtest_file_exists_not_matching_hash
Test is_md5_hash_matching when file exists but hash doesn't match.
tests/assets/test_downloader.py:21
Methodtest_file_not_exists
Test is_md5_hash_matching when file doesn't exist.
tests/assets/test_downloader.py:32
Functiontest_fill
(sequence, desired_size, content, expected)
tests/utils/test_iterables.py:41
Functiontest_filter_polygons_by_area
( polygons: list[np.ndarray], min_area: float | None, max_area: float | None, expected_result:
tests/detection/utils/test_polygons.py:92
Functiontest_filter_segments_by_distance_sweep
( mask: npt.NDArray, connectivity: int, mode: str, absolute_distance: float | None, relati
tests/detection/utils/test_masks.py:719
Methodtest_float64_promotion_for_large_float32_masks
float32 masks with pixel count > 2**24 must give exact IoU via float64.
tests/detection/utils/test_iou_and_nms.py:1711
Functiontest_florence_2
( florence_result: dict, resolution_wh: tuple[int, int], expected_results: tuple[ np.ndarr
tests/detection/test_vlm.py:921
Functiontest_from_clip_empty_output_dtypes
()
tests/classification/test_core.py:84
Functiontest_from_coco_loads_legacy_zero_indexed_category_ids
COCO files with 0-indexed category ids (written by supervision <=0.28.x) must still load and produce correct internal 0-indexed class_ids.
tests/dataset/formats/test_coco.py:1810
Functiontest_from_deepseek_vl_2
( exception, result: str, resolution_wh: tuple[int, int], classes: list[str] | None, expec
tests/detection/test_vlm.py:1271
Functiontest_from_google_gemini
( exception, result: str, resolution_wh: tuple[int, int], classes: list[str] | None, expec
tests/detection/test_vlm.py:565
Functiontest_from_google_gemini_2_5
( exception, result: str, resolution_wh: tuple[int, int], classes: list[str] | None, expec
tests/detection/test_vlm.py:1149
Functiontest_from_google_gemini_2_5_malformed_mask_keeps_confidence_aligned
A non-data-URI mask must not skip the item's confidence and desync arrays.
tests/detection/test_vlm.py:1302
Functiontest_from_inference_empty_class_name_dtype_matches_non_empty
Empty and non-empty results should produce string-kind class_name arrays.
tests/detection/test_core.py:946
Functiontest_from_inference_input
Test the from_inference method with valid input.
tests/key_points/test_core.py:905
Functiontest_from_inference_invalid_input
Test the from_inference method with invalid input.
tests/key_points/test_core.py:911
Functiontest_from_inference_sdk_dict_path_empty_preserves_class_name_dtype
SDK objects with .dict() and empty predictions produce string-kind class_name.
tests/detection/test_core.py:983
Functiontest_from_mediapipe_input
Test the from_mediapipe method with valid input.
tests/key_points/test_core.py:991
Functiontest_from_moondream
( exception, result: dict, resolution_wh: tuple[int, int], expected_results, )
tests/detection/test_vlm.py:679
Functiontest_from_paligemma
( exception, result: str, resolution_wh: tuple[int, int], classes: list[str] | None, expec
tests/detection/test_vlm.py:200
Functiontest_from_qwen_2_5_vl
( exception, result: str, input_wh: tuple[int, int], resolution_wh: tuple[int, int], class
tests/detection/test_vlm.py:410
Functiontest_from_sam
( sam_result: list[dict], expected_xyxy: np.ndarray, expected_mask_shape: tuple[int, ...] | None,
tests/detection/test_from_sam.py:100
Functiontest_from_sam3
( sam3_result: dict, resolution_wh: tuple[int, int], expected_xyxy: np.ndarray, expected_confi
tests/detection/test_from_sam.py:179
Functiontest_from_sam3_invalid_resolution
()
tests/detection/test_from_sam.py:195
Methodtest_from_tensors
( self, predictions, targets, classes, conf_threshold, iou_thr
tests/metrics/test_detection.py:505
Functiontest_from_timm_empty_output_dtypes
()
tests/classification/test_core.py:92
Functiontest_from_ultralytics_boxes_branch_maps_fields_and_class_names
()
tests/detection/test_from_adapters.py:36
Functiontest_from_ultralytics_segmentation_only_branch_uses_masks_and_arange
( monkeypatch: pytest.MonkeyPatch, )
tests/detection/test_from_adapters.py:57
Functiontest_from_yolo_nas_handles_empty_and_non_empty
( bboxes: np.ndarray, conf: np.ndarray, labels: np.ndarray, expected_len: int, )
tests/detection/test_from_adapters.py:94
Functiontest_from_yolo_nas_input
Test the from_yolo_nas method with valid input.
tests/key_points/test_core.py:948
Functiontest_from_yolov5_maps_columns_correctly
()
tests/detection/test_from_adapters.py:18
Functiontest_fuzzy_match_index
( candidates, query, threshold, case_sensitive, expected_result )
tests/detection/utils/test_vlms.py:106
Functiontest_generate_offset
( resolution_wh: tuple[int, int], slice_wh: tuple[int, int], overlap_wh: tuple[int, int], expe
tests/detection/tools/test_inference_slicer.py:189
Functiontest_get_anchor_coordinates
( detections: Detections, anchor: Position, expected_result: np.ndarray, exception: Exception,
tests/detection/test_core.py:660
← previousnext →1,201–1,300 of 1,714, ranked by callers