MCPcopy Index your code

hub / github.com/roboflow/supervision / functions

Functions1,714 in github.com/roboflow/supervision

↓ 3 callersFunctiondraw_polygon
Draw a polygon on a scene. Args: scene: The scene to draw the polygon on. polygon: The polygon to be drawn, given as a list of ve
src/supervision/draw/utils.py:166
↓ 3 callersFunctiondraw_rounded_rectangle
Draws a rounded rectangle on an image. Args: scene: The image on which the rounded rectangle will be drawn. rect: The rectan
src/supervision/draw/utils.py:114
↓ 3 callersMethodevaluate_detection_batch
Calculate confusion matrix for a batch of detections for a single image. Args: predictions: Batch prediction. Describes
src/supervision/metrics/detection.py:414
↓ 3 callersFunctionfill
Fill the sequence with padding elements until the sequence reaches the desired size. Args: sequence: The input sequence.
src/supervision/utils/iterables.py:45
↓ 3 callersFunctionfilter_polygons_by_area
Filters a list of polygons based on their area. Args: polygons: A list of polygons, where each polygon is represented by
src/supervision/detection/utils/polygons.py:8
↓ 3 callersMethodfrom_bgr_tuple
Create a Color instance from a BGR tuple. Args: color_tuple: A tuple representing the color in BGR format, where each
src/supervision/draw/color.py:177
↓ 3 callersFunctionfrom_google_gemini_2_5
Parse and scale bounding boxes and masks from Google Gemini 2.5 style [JSON output](https://ai.google.dev/gemini-api/docs/vision?lang=python)
src/supervision/detection/vlm.py:678
↓ 3 callersFunctionfrom_qwen_2_5_vl
Parse and rescale bounding boxes and class labels from Qwen-2.5-VL JSON output. The JSON is expected to be enclosed in triple backticks with
src/supervision/detection/vlm.py:305
↓ 3 callersMethodfrom_yolo_nas
Creates a Detections instance from a [YOLO-NAS](https://github.com/Deci-AI/super-gradients/blob/master/YOLONAS.md) inference
src/supervision/detection/core.py:336
↓ 3 callersFunctionget_stream_frames_generator
Generator function to yield frames from an RTSP stream. Args: rtsp_url (str): URL of the RTSP video stream. Yields: np.
examples/time_in_zone/utils/general.py:44
↓ 3 callersFunctionhex_to_rgba
Converts a hex color string (e.g. "#FF00FF" or "#FF00FF80") to an RGBA tuple. Args: hex_color: A hex color string. Returns:
src/supervision/annotators/utils.py:384
↓ 3 callersFunctionjoint_tracks
Joins two lists of tracks, ensuring that the resulting list does not contain tracks with duplicate internal_track_id values. Args:
src/supervision/tracker/byte_tracker/core.py:337
↓ 3 callersMethodlist
(cls)
examples/time_in_zone/rfdetr_naive_stream_example.py:28
↓ 3 callersMethodlist
(cls)
examples/time_in_zone/rfdetr_file_example.py:28
↓ 3 callersFunctionlist_files_with_extensions
List files in a directory with specified extensions or all files if no extensions are provided. Args: directory: The directo
src/supervision/utils/file.py:22
↓ 3 callersFunctionmap_detections_class_id
( source_to_target_mapping: dict[int, int], detections: Detections )
src/supervision/dataset/utils.py:108
↓ 3 callersFunctionmerge_inner_detection_object_pair
Merges two Detections objects into a single Detections object. Assumes each Detections contains exactly one object. A `winning` detectio
src/supervision/detection/core.py:2767
↓ 3 callersMethodnew_id
Get the current ID and increment the counter. Returns: The newly assigned ID.
src/supervision/tracker/byte_tracker/utils.py:24
↓ 3 callersFunctionoverlay_image
Overlay image onto scene at specified anchor point. Handles cases where overlay position is partially or completely outside scene bounds.
src/supervision/utils/image.py:283
↓ 3 callersFunctionresize_image
Resize image to specified resolution. Can optionally maintain aspect ratio. Args: image: The image to resize. resolution_wh:
src/supervision/utils/image.py:146
↓ 3 callersFunctionsave_dataset_images
(dataset: DetectionDataset, images_directory_path: str)
src/supervision/dataset/utils.py:128
↓ 3 callersFunctionshouldStripPrompts
(codeBlock, rawText)
docs/javascripts/pycon_copy.js:114
↓ 3 callersFunctionstripPythonPrompts
* Strips Python REPL prompts (>>> and ...) from code text. * Also removes output lines (lines that don't start with >>> or ...). * * NOTE: This is
docs/javascripts/pycon_copy.js:153
↓ 3 callersMethodtick
Adds a new time stamp to the deque for FPS calculation.
src/supervision/utils/video.py:499
↓ 3 callersFunctiontoggleTripleQuoteState
(sourceLine)
docs/javascripts/pycon_copy.js:158
↓ 3 callersFunctiontrain_test_split
Splits the data into two parts using the provided train_ratio. Args: data: The data to split. train_ratio: The ratio of the
src/supervision/dataset/utils.py:139
↓ 3 callersMethodupdate
Run Kalman filter correction step. Args: mean: The predicted state's mean vector. covariance: The state's co
src/supervision/tracker/byte_tracker/kalman_filter.py:160
↓ 3 callersFunctionxywh_to_xyxy
Converts bounding box coordinates from `(x, y, width, height)` format to `(x_min, y_min, x_max, y_max)` format. Args: xywh: A nu
src/supervision/detection/utils/converters.py:52
↓ 2 callersMethod__init__
Args: color: The color or color palette to use for annotating detections. thickness: Thickness of the
src/supervision/annotators/core.py:195
↓ 2 callersFunction_aabb_envelopes
Compute the axis-aligned bounding envelope of each oriented box. Args: polygons: ``(N, 4, 2)`` array of polygon corners. Returns:
src/supervision/detection/utils/iou_and_nms.py:378
↓ 2 callersMethod_adjust_labels_in_frame
Adjusts the position of labels to ensure they stay within the frame boundaries. Args: resolution_wh: The width and heigh
src/supervision/annotators/core.py:147
↓ 2 callersFunction_build_summary_df
Compute derived summary columns from scenario results. Returns a DataFrame with all ScenarioResult fields plus derived columns (ratios, speed
examples/compact_mask/benchmark.py:882
↓ 2 callersMethod_calculate_region_of_interest_limits
(vector: Vector)
src/supervision/detection/line_zone.py:217
↓ 2 callersFunction_cm_tight
Build a CompactMask using tight per-mask bounding boxes.
tests/detection/test_compact_mask_iou.py:40
↓ 2 callersFunction_coco_annotation_with_segmentation
( segmentation: list[list[int]], bbox: tuple[float, float, float, float] = (0, 0, 5, 5), area: flo
tests/dataset/formats/test_coco.py:1940
↓ 2 callersMethod_compute_f1
Broadcastable function, computing the F1 score from the confusion matrix. Args: confusion_matrix: shape (N, ..., 3), whe
src/supervision/metrics/f1_score.py:405
↓ 2 callersMethod_compute_precision
Broadcastable function, computing the precision from the confusion matrix. Args: confusion_matrix: shape (N, ..., 3), wh
src/supervision/metrics/precision.py:408
↓ 2 callersMethod_compute_recall
Broadcastable function, computing the recall from the confusion matrix. Args: confusion_matrix: shape (N, ..., 3), where
src/supervision/metrics/recall.py:364
↓ 2 callersMethod_detections_content
Return boxes, masks or oriented bounding boxes from detections.
src/supervision/metrics/mean_average_recall.py:629
↓ 2 callersMethod_detections_content
Return boxes, masks or oriented bounding boxes from detections.
src/supervision/metrics/recall.py:396
↓ 2 callersMethod_detections_content
Return boxes, masks or oriented bounding boxes from detections.
src/supervision/metrics/f1_score.py:434
↓ 2 callersMethod_detections_content
Return boxes, masks or oriented bounding boxes from detections.
src/supervision/metrics/precision.py:440
↓ 2 callersFunction_extract_annotator_tab_groups
Parse annotator tab structure from docs/detection/annotators.md. Returns: Mapping of category name to list of annotator tab labels within
tests/annotators/test_docs.py:38
↓ 2 callersFunction_extract_class_names
Return class names from a YOLO data.yaml file ordered by class index. Supports list and dict forms of the ``names`` field. Dict keys that are
src/supervision/dataset/formats/yolo.py:70
↓ 2 callersMethod_filter_detections_by_size
Return a copy of detections with contents filtered by object size.
src/supervision/metrics/mean_average_recall.py:662
↓ 2 callersMethod_filter_detections_by_size
Return a copy of detections with contents filtered by object size.
src/supervision/metrics/recall.py:431
↓ 2 callersMethod_filter_detections_by_size
Return a copy of detections with contents filtered by object size.
src/supervision/metrics/f1_score.py:464
↓ 2 callersMethod_filter_detections_by_size
Return a copy of detections with contents filtered by object size.
src/supervision/metrics/precision.py:473
↓ 2 callersFunction_generate_color_image
( shape: tuple[int, int], color: tuple[int, int, int] )
src/supervision/utils/image.py:918
↓ 2 callersMethod_generate_offset
Generate bounding boxes defining the coordinates of image slices with overlap. Args: resolution_wh: Image resolution `(w
src/supervision/detection/tools/inference_slicer.py:389
↓ 2 callersFunction_generate_random_boxes
Generate random bounding boxes within given image dimensions and size constraints. Creates `count` bounding boxes randomly positioned and si
tests/helpers.py:144
↓ 2 callersFunction_greedy_nmm_via_iou_callback
Greedy non-maximum merging loop, independent of how overlap is computed. ``iou_against_candidate(order_indices, candidate_idx)`` must return the
src/supervision/detection/utils/iou_and_nms.py:1105
↓ 2 callersFunction_group_overlapping_boxes
Apply greedy version of non-maximum merging to avoid detecting too many overlapping bounding boxes for a given object. Args: pre
src/supervision/detection/utils/iou_and_nms.py:1169
↓ 2 callersFunction_group_overlapping_masks
Apply greedy version of non-maximum merging to avoid detecting too many Args: predictions: An array of shape `(n, 5)` containing
src/supervision/detection/utils/iou_and_nms.py:973
↓ 2 callersFunction_image_name_to_annotation_name
(image_name: str)
src/supervision/dataset/formats/yolo.py:133
↓ 2 callersMethod_make_empty_content
(self)
src/supervision/metrics/mean_average_recall.py:647
↓ 2 callersMethod_make_empty_content
(self)
src/supervision/metrics/recall.py:414
↓ 2 callersMethod_make_empty_content
(self)
src/supervision/metrics/f1_score.py:452
↓ 2 callersMethod_make_empty_content
(self)
src/supervision/metrics/precision.py:458
↓ 2 callersFunction_make_iscrowd0_detections
Build a single-detection Detections with iscrowd=0 from a (1, H, W) mask.
tests/dataset/formats/test_coco.py:1026
↓ 2 callersMethod_mask_from_mask
( scene: npt.NDArray[np.uint8], detections: Detections )
src/supervision/annotators/core.py:3214
↓ 2 callersMethod_mask_from_obb
( scene: npt.NDArray[np.uint8], detections: Detections )
src/supervision/annotators/core.py:3199
↓ 2 callersMethod_mask_from_xyxy
( scene: npt.NDArray[np.uint8], detections: Detections )
src/supervision/annotators/core.py:3183
↓ 2 callersFunction_merge_detection_group
Merge a group of single-object Detections into one merged detection. Used internally by :meth:`Detections.with_nmm` to combine each merge group
src/supervision/detection/core.py:2678
↓ 2 callersFunction_merge_obb_corners
Merge multiple OBB corner arrays using winner-angle projection. The first entry in *corners_list* is the winner. Its orientation angle (deriv
src/supervision/detection/core.py:2635
↓ 2 callersFunction_nms_loop_from_iou_matrix
Greedy NMS suppression loop given a precomputed pairwise IoU matrix. Assumes `ious` is square with row/column order matching `categories`. De
src/supervision/detection/utils/iou_and_nms.py:916
↓ 2 callersFunction_non_max_merge_per_category
Dispatch NMM grouping per class, then translate local indices back to the global row positions of ``predictions``. ``group_within(global_indi
src/supervision/detection/utils/iou_and_nms.py:1136
↓ 2 callersFunction_polygon_areas
Compute the area of each oriented-box polygon using the shoelace formula. Args: polygons: ``(N, 4, 2)`` array of polygon corners. Re
src/supervision/detection/utils/iou_and_nms.py:363
↓ 2 callersFunction_polygons_to_masks
( polygons: list[npt.NDArray[np.number]], resolution_wh: tuple[int, int] )
src/supervision/dataset/formats/yolo.py:51
↓ 2 callersFunction_prepare_predictions_for_nms
Add an agnostic class column when missing, sort by descending score. Returns the score-descending sort index, the reordered predictions, and the
src/supervision/detection/utils/iou_and_nms.py:899
↓ 2 callersFunction_resize_dense_to_shape
Nearest-neighbour resize of (N, H, W) bool masks to (N, new_h, new_w). Uses floor-division indexing (``arange * src // dst``) to match the st
examples/compact_mask/benchmark.py:333
↓ 2 callersFunction_rotated_rect
( cx: float, cy: float, w: float, h: float, angle_deg: float )
tests/detection/tools/test_inference_slicer.py:437
↓ 2 callersMethod_slice_value
Return the i-th element when the value stores per-detection data. Dispatch rules: - np.ndarray with ndim == 0: return as
src/supervision/detection/tools/json_sink.py:122
↓ 2 callersFunction_validate_class_id
(class_id: Any, n: int)
src/supervision/validators/__init__.py:84
↓ 2 callersFunction_validate_confidence
Validate detection-level confidence: 1D ``np.ndarray`` with shape ``(n,)``.
src/supervision/validators/__init__.py:106
↓ 2 callersMethod_validate_custom_values
( custom_values: npt.NDArray[np.float64] | list[float] | None, detections: Detections, )
src/supervision/annotators/core.py:2751
↓ 2 callersFunction_validate_data
(data: dict[str, Any], n: int)
src/supervision/validators/__init__.py:191
↓ 2 callersFunction_validate_labels
Validates that the number of provided labels matches the number of detections. Args: labels: A list of labels, one for each detectio
src/supervision/annotators/utils.py:205
↓ 2 callersFunction_with_seg_mask
(lines: list[str])
src/supervision/dataset/formats/yolo.py:66
↓ 2 callersFunction_yolo_dataset_factory
Factory function to create synthetic YOLO-format datasets with custom parameters. Args: tmp_path: Pytest tmp_path fixture nu
tests/metrics/conftest.py:145
↓ 2 callersFunctionannotate
Annotate a frame with zone and box annotations based on given detections. Args: frame (np.ndarray): The original frame to be annotat
examples/count_people_in_zone/inference_example.py:96
↓ 2 callersFunctionannotate
Annotate a frame with zone and box annotations based on given detections. Args: frame (np.ndarray): The original frame to be annotat
examples/count_people_in_zone/ultralytics_example.py:95
↓ 2 callersMethodannotate
Annotates the given scene with oriented bounding boxes based on the provided detections. Args: scene: The image
src/supervision/annotators/core.py:301
↓ 2 callersMethodannotate
Annotates the given scene with box masks based on the provided detections. Args: scene: The image where bounding boxes w
src/supervision/annotators/core.py:630
↓ 2 callersMethodannotate
Annotates the given scene with ellipses based on the provided detections. Args: scene: The image where ellipses will be
src/supervision/annotators/core.py:830
↓ 2 callersMethodannotate
Annotates the given scene with box corners based on the provided detections. Args: scene: The image where box corners wi
src/supervision/annotators/core.py:926
↓ 2 callersMethodannotate
Annotates the given scene with circles based on the provided detections. Args: scene: The image where box corners will b
src/supervision/annotators/core.py:1019
↓ 2 callersMethodannotate
Annotates the given scene with dots based on the provided detections. Args: scene: The image where dots will be drawn.
src/supervision/annotators/core.py:1122
↓ 2 callersMethodannotate
Annotates the given scene with labels based on the provided detections, with support for Unicode characters. Args:
src/supervision/annotators/core.py:1569
↓ 2 callersMethodannotate
Annotates the given scene with triangles based on the provided detections. Args: scene: The image where triangles will b
src/supervision/annotators/core.py:2364
↓ 2 callersMethodannotate
Annotates the given scene with bounding boxes with rounded edges based on the provided detections. Args: scene:
src/supervision/annotators/core.py:2480
↓ 2 callersMethodannotate
Annotates the given scene with percentage bars based on the provided detections. The percentage bars visually represent the confidenc
src/supervision/annotators/core.py:2624
↓ 2 callersMethodannotate
Annotates the provided scene with scaled and cropped parts of the image based on the provided detections. Each detection is cropped f
src/supervision/annotators/core.py:2823
↓ 2 callersMethodannotate
Highlights the differences between two sets of detections. Args: scene: The image where detections will be drawn.
src/supervision/annotators/core.py:3081
↓ 2 callersFunctionassert_csv_equal
(file_name, expected_rows)
tests/detection/test_csv.py:518
↓ 2 callersFunctionbuild_class_index_mapping
Returns the index map of source classes -> target classes.
src/supervision/dataset/utils.py:90
↓ 2 callersFunctioncoco_annotations_to_masks
( image_annotations: list[CocoDict], resolution_wh: tuple[int, int] )
src/supervision/dataset/formats/coco.py:96
↓ 2 callersMethodcompute_average_precision
Compute the average precision using 101-point interpolation (COCO), given the recall and precision curves. Args:
src/supervision/metrics/detection.py:984
↓ 2 callersFunctionconvert_data
(data: dict[str, list[Any]])
tests/helpers.py:62
↓ 2 callersFunctioncreate_batches
Provides a generator that yields chunks of the input sequence of the size specified by the `batch_size` parameter. The last chunk may be
src/supervision/utils/iterables.py:7
← previousnext →201–300 of 1,714, ranked by callers