MCPcopy Index your code

hub / github.com/roboflow/supervision / functions

Functions1,714 in github.com/roboflow/supervision

↓ 6 callersFunctionletterbox_image
Resize image and pad with color to achieve desired resolution while maintaining aspect ratio. Args: image: The image to resize a
src/supervision/utils/image.py:210
↓ 6 callersFunctionmask_non_max_merge
Perform Non-Maximum Merging (NMM) on segmentation predictions. Args: predictions: A 2D array of object detection predictions in
src/supervision/detection/utils/iou_and_nms.py:1030
↓ 6 callersMethodwith_nmm
Perform non-maximum merging on the current set of object detections. Dispatch order: (1) if mask data present, IoU mask is used; (2)
src/supervision/detection/core.py:2540
↓ 5 callersFunction_get_required_text
(element: Element, tag: str)
src/supervision/dataset/formats/pascal_voc.py:351
↓ 5 callersFunction_random_masks
Generate *num_masks* random boolean masks with at least one True pixel each.
tests/detection/test_compact_mask_iou.py:404
↓ 5 callersFunction_read_ids
(annotation_path)
tests/dataset/formats/test_coco.py:1652
↓ 5 callersFunction_rle_split_cols
Split a flat F-order RLE into per-column run lists. With F-order (column-major) RLE the flat pixel sequence visits all rows of column 0, then
src/supervision/detection/compact_mask.py:49
↓ 5 callersMethodannotate
Annotates the given scene with polygons based on the provided detections. Args: scene: The image where polygons will be
src/supervision/annotators/core.py:539
↓ 5 callersMethodannotate
Annotates the given scene with halos based on the provided detections. Args: scene: The image where the halo effect will
src/supervision/annotators/core.py:730
↓ 5 callersFunctionappend_class_names_to_data
Helper function to create or append to a data dictionary with class names if available. Args: class_ids: Array of class IDs.
src/supervision/detection/tools/transformers.py:224
↓ 5 callersFunctionapproximate_polygon
Approximates a given polygon by reducing a certain percentage of points. This function uses the Ramer-Douglas-Peucker algorithm to simplify
src/supervision/detection/utils/polygons.py:44
↓ 5 callersMethodclose
Close the CSV file.
src/supervision/detection/tools/csv_sink.py:111
↓ 5 callersMethodcompute
Calculate the Mean Average Recall metric based on the stored predictions and ground-truth, at different IoU thresholds and maximum de
src/supervision/metrics/mean_average_recall.py:352
↓ 5 callersFunctioncontains_holes
Checks if the binary mask contains holes (background pixels fully enclosed by foreground pixels). Args: mask: 2D binary mask whe
src/supervision/detection/utils/masks.py:151
↓ 5 callersFunctioncv2_to_pillow
Converts OpenCV image into Pillow image, handling BGR -> RGB conversion. Args: image: OpenCV image (in BGR format). Returns
src/supervision/utils/conversion.py:166
↓ 5 callersFunctiondetections_from_boxes
(boxes: list[list[float]])
tests/tracker/test_byte_tracker.py:42
↓ 5 callersFunctiondetections_to_tensor
Convert Supervision Detections to a numpy tensor for metric computation. Args: detections: Detections/Targets in the format of sv.De
src/supervision/metrics/detection.py:29
↓ 5 callersMethoddict
(self, **kwargs: object)
tests/detection/test_core.py:987
↓ 5 callersFunctionensure_pandas_installed
()
src/supervision/metrics/utils/utils.py:1
↓ 5 callersFunctionimages_to_cv2
Converts images provided either as Pillow images or OpenCV images into OpenCV format. Args: images: Images to be converted
src/supervision/utils/conversion.py:127
↓ 5 callersFunctionmove_masks
Offset the masks in an array by the specified (x, y) amount. Args: masks: A 3D array of binary masks corresponding to the
src/supervision/detection/utils/masks.py:12
↓ 5 callersFunctionobject_to_pascal_voc
Build a Pascal VOC ``<object>`` XML element for one detection. Coordinates are converted to 1-indexed Pascal VOC convention before writing. T
src/supervision/dataset/formats/pascal_voc.py:19
↓ 5 callersFunctionpolygon_to_xyxy
Converts a polygon represented by a NumPy array into a bounding box. Args: polygon: A polygon represented by a NumPy array of shape
src/supervision/detection/utils/converters.py:724
↓ 5 callersMethodput
(self, detections: Detections)
src/supervision/annotators/utils.py:347
↓ 5 callersMethodtrigger
Determines if the detections are within the polygon zone. Anchor points are calculated from original (unclipped) detection boxes to
src/supervision/detection/tools/polygon_zone.py:73
↓ 5 callersFunctionunify_to_bgr
Converts a color input in multiple formats to a standardized BGR format. Args: color: The color input to be converted, w
src/supervision/draw/color.py:547
↓ 5 callersMethodupdate
Add data to the metric, without computing the result. Return the metric itself to allow method chaining.
src/supervision/metrics/core.py:14
↓ 5 callersMethodupdate
Add new predictions and targets to the metric, but do not compute the result. Args: predictions: The predicted detection
src/supervision/metrics/mean_average_recall.py:321
↓ 5 callersFunctionwrap_text
Wrap `text` to the specified maximum line length, respecting existing newlines. Falls back to str() if `text` is not already a string. A
src/supervision/annotators/utils.py:159
↓ 4 callersFunction_base48_decode
Decode a COCO base-48 string to raw (delta-encoded) integers. Implements the variable-length base-48 codec from the COCO API (pycocotools). E
src/supervision/detection/utils/converters.py:332
↓ 4 callersMethod_compute
( self, predictions_list: list[Detections], targets_list: list[Detections] )
src/supervision/metrics/mean_average_recall.py:381
↓ 4 callersMethod_compute
( self, predictions_list: list[Detections], targets_list: list[Detections] )
src/supervision/metrics/recall.py:155
↓ 4 callersMethod_compute
Build per-image stats tuples and delegate to class-level computation. Each stats tuple is ``(matches, confidence, class_ids, true_class_ids)`
src/supervision/metrics/f1_score.py:152
↓ 4 callersMethod_compute
Build per-image stats tuples and delegate to class-level computation. Each stats tuple is ``(matches, confidence, class_ids, true_class_ids)`
src/supervision/metrics/precision.py:155
↓ 4 callersFunction_non_square_obb_detections
(confidence: bool = False)
tests/metrics/test_oriented_bounding_box_metrics.py:14
↓ 4 callersFunction_optional_array_equal
( first: npt.NDArray[np.generic] | None, second: npt.NDArray[np.generic] | None, )
src/supervision/key_points/core.py:42
↓ 4 callersFunction_regular_polygon
(num_points: int, radius: float = 40.0)
tests/detection/utils/test_polygons.py:108
↓ 4 callersMethod_resolve_color_list
Return a per-keypoint color list for a single instance.
src/supervision/key_points/annotators.py:960
↓ 4 callersFunction_rle_area
Return the number of ``True`` pixels in a run-length encoded mask. Args: rle: int32 array of run lengths as produced by :func:`_mask_to_r
src/supervision/detection/compact_mask.py:27
↓ 4 callersMethodannotate
Applies a colored overlay to the scene outside of the detected regions. Args: scene: The image where masks will be drawn
src/supervision/annotators/core.py:2978
↓ 4 callersMethodannotate
Draws stroke-only covariance ellipse outlines around each keypoint. Args: scene: The image to annotate. ``ImageType`` ac
src/supervision/key_points/annotators.py:504
↓ 4 callersMethodannotate
Draws radially-fading covariance ellipses around each keypoint. Args: scene: The image to annotate. ``ImageType`` accept
src/supervision/key_points/annotators.py:606
↓ 4 callersFunctioncoco_categories_to_classes
(coco_categories: list[CocoDict])
src/supervision/dataset/formats/coco.py:29
↓ 4 callersFunctioncontains_multiple_segments
Checks if the binary mask contains multiple unconnected foreground segments. Args: mask: 2D binary mask where `True` indicates foreg
src/supervision/detection/utils/masks.py:201
↓ 4 callersFunctiondenormalize_boxes
Convert normalized bounding box coordinates to absolute pixel coordinates. Multiplies each bounding box coordinate by image size and divides
src/supervision/detection/utils/boxes.py:105
↓ 4 callersMethodfrom_value
(cls, value: OverlapFilter | str)
src/supervision/detection/utils/iou_and_nms.py:39
↓ 4 callersFunctionget_detection_size_category
Get the size category of a detections object. Args: detections: The detections object. metric_target: Determines whether box
src/supervision/metrics/utils/object_size.py:214
↓ 4 callersFunctionget_image_resolution_wh
Get image width and height as a tuple `(width, height)` for various image formats. Supports both `numpy.ndarray` images (with shape `(H, W,
src/supervision/utils/image.py:434
↓ 4 callersFunctionget_video_frames_generator
Get a generator that yields the frames of the video. Args: source_path: The path of the video file. stride: Indicates the in
src/supervision/utils/video.py:231
↓ 4 callersFunctionis_md5_hash_matching
Check if the MD5 hash of a file matches the original hash. Note: MD5 is used here for file integrity checking (detecting corruption), no
src/supervision/assets/downloader.py:17
↓ 4 callersMethodlist
(cls)
src/supervision/detection/vlm.py:50
↓ 4 callersFunctionload_yolo_annotations
Loads YOLO annotations and returns class names, images, and their corresponding detections. Args: images_directory_path: The
src/supervision/dataset/formats/yolo.py:187
↓ 4 callersFunctionmask_to_rle
Converts a binary mask into a COCO run-length encoding (RLE). Produces RLE in the COCO format used by ``pycocotools``: pixels are counted
src/supervision/detection/utils/converters.py:649
↓ 4 callersFunctionmerge_metadata
Merge metadata from a list of metadata dictionaries. This function combines the metadata dictionaries. If a key appears in more than one
src/supervision/detection/utils/internal.py:302
↓ 4 callersFunctionobject_to_yolo
( xyxy: npt.NDArray[np.number], class_id: int, image_shape: tuple[int, int, int], polygon: npt
src/supervision/dataset/formats/yolo.py:274
↓ 4 callersFunctionoriented_box_non_max_merge
Perform Non-Maximum Merging on oriented bounding box predictions, grouped per category. Mirrors :func:`box_non_max_merge` but uses orien
src/supervision/detection/utils/iou_and_nms.py:1358
↓ 4 callersFunctionpad_boxes
Pads bounding boxes coordinates with a constant padding. Args: xyxy: A numpy array of shape `(N, 4)` where each row corr
src/supervision/detection/utils/boxes.py:52
↓ 4 callersMethodpredict
Run Kalman filter prediction step. Args: mean: The object state mean at the previous time step. covariance:
src/supervision/tracker/byte_tracker/kalman_filter.py:61
↓ 4 callersMethodrepack
Re-encode all masks using tight bounding boxes. When the original ``xyxy`` boxes are padded or loose — common with object-detector ou
src/supervision/detection/compact_mask.py:984
↓ 4 callersFunctionrle_to_mask
Converts a COCO run-length encoding (RLE) to a binary mask. Implements the COCO RLE format used by ``pycocotools``: pixels are counted i
src/supervision/detection/utils/converters.py:575
↓ 4 callersFunctionspread_out_boxes
Spread out boxes that overlap with each other. Args: xyxy: Numpy array of shape (N, 4) where N is the number of boxes. max_i
src/supervision/detection/utils/boxes.py:347
↓ 4 callersMethodtlwh_to_xyah
Convert bounding box to format `(center x, center y, aspect ratio, height)`, where the aspect ratio is `width / height`.
src/supervision/tracker/byte_tracker/single_object_track.py:161
↓ 4 callersFunctionxyxyxyxy_to_xyxy
Convert oriented bounding box corners to axis-aligned bounding boxes. Args: xyxyxyxy: OBB corner coordinates with shape `(N, 4, 2)` where
src/supervision/detection/utils/boxes.py:272
↓ 4 callersFunctionyolo_annotations_to_detections
( lines: list[str], resolution_wh: tuple[int, int], with_masks: bool, is_obb: bool = False, )
src/supervision/dataset/formats/yolo.py:138
↓ 3 callersMethod__init__
Args: color: The color to use for the edges. thickness: The thickness of the edges. edges: The edges to d
src/supervision/key_points/annotators.py:117
↓ 3 callersFunction_assert_supported_target
(metric_target: MetricTarget)
src/supervision/metrics/detection.py:22
↓ 3 callersFunction_base48_encode
Encode raw (delta-encoded) integers to a COCO base-48 string. The inverse of :func:`_base48_decode`. Applies the same variable-length base-48
src/supervision/detection/utils/converters.py:382
↓ 3 callersFunction_delta_decode
Undo COCO delta encoding: ``counts[i] += counts[i - 2]`` for ``i > 2``. The COCO compressed RLE format stores run lengths as deltas relative to
src/supervision/detection/utils/converters.py:418
↓ 3 callersFunction_delta_encode
Apply COCO delta encoding: ``d[i] = counts[i] - counts[i - 2]`` for ``i > 2``. The inverse of :func:`_delta_decode`. Converts absolute run length
src/supervision/detection/utils/converters.py:445
↓ 3 callersMethod_filter_predictions_and_targets_by_size
Filter predictions and targets by object size category.
src/supervision/metrics/mean_average_recall.py:688
↓ 3 callersMethod_filter_predictions_and_targets_by_size
Filter predictions and targets by object size category.
src/supervision/metrics/recall.py:457
↓ 3 callersMethod_filter_predictions_and_targets_by_size
Filter predictions and targets by object size category.
src/supervision/metrics/f1_score.py:490
↓ 3 callersMethod_filter_predictions_and_targets_by_size
Filter predictions and targets by object size category.
src/supervision/metrics/precision.py:499
↓ 3 callersMethod_get_line_angle
Calculate the line counter angle (in degrees). Args: line_zone: The line zone object. Returns: Line
src/supervision/detection/line_zone.py:456
↓ 3 callersMethod_iter_ellipse_params
Return ellipse params grouped by sigma level (outermost first).
src/supervision/key_points/annotators.py:330
↓ 3 callersFunction_mask_iou_batch_split
Internal function. Compute Intersection over Union (IoU) of two sets of masks - `masks_true` and `masks_detection`. Args:
src/supervision/detection/utils/iou_and_nms.py:672
↓ 3 callersFunction_mux_audio
Mux audio from `source_path` into `video_path` in-place using ffmpeg. Args: source_path: Path to the original video file containing the a
src/supervision/utils/video.py:140
↓ 3 callersMethod_prepare_targets
Transform targets into a dictionary that can be used by the COCO evaluator
src/supervision/metrics/mean_average_precision.py:1337
↓ 3 callersFunction_resize_crop
Resize one RLE crop to ``(new_h, new_w)``, choosing the fastest path. Dispatch order: 1. **All-False fast path** — returns a single False ru
src/supervision/detection/compact_mask.py:341
↓ 3 callersMethod_resolve_labels
Return the label list for a single instance.
src/supervision/key_points/annotators.py:930
↓ 3 callersFunction_rle_join_cols
Concatenate per-column run lists into a flat RLE, merging junctions. Each column run list starts with a ``False``-run count. Two junction types
src/supervision/detection/compact_mask.py:193
↓ 3 callersMethod_run_callback
Run detection callback on a sliced portion of the image and adjust coordinates. Args: image: The full image.
src/supervision/detection/tools/inference_slicer.py:275
↓ 3 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/csv_sink.py:119
↓ 3 callersFunction_validate_detections_fields
( xyxy: Any, mask: Any, class_id: Any, confidence: Any, tracker_id: Any, data: dict[st
src/supervision/validators/__init__.py:259
↓ 3 callersFunction_validate_input_tensors
Checks for shape consistency of input tensors.
src/supervision/metrics/detection.py:146
↓ 3 callersMethodannotate
Annotates the given scene by blurring regions based on the provided detections. Args: scene: The image where blurring wi
src/supervision/annotators/core.py:1914
↓ 3 callersFunctionapproximate_mask_with_polygons
( mask: npt.NDArray[np.bool_], min_image_area_percentage: float = 0.0, max_image_area_percentage:
src/supervision/dataset/utils.py:52
↓ 3 callersMethodas_rgb
Returns the color as an RGB tuple. Returns: RGB tuple. Example: ```pycon >>> import sup
src/supervision/draw/color.py:287
↓ 3 callersMethodas_yolo
Exports the dataset to YOLO format. This method saves the images and their corresponding annotations in YOLO format. Args:
src/supervision/dataset/core.py:504
↓ 3 callersFunctionbindCopyButtons
(root)
docs/javascripts/pycon_copy.js:59
↓ 3 callersFunctionbox_non_max_suppression
Perform Non-Maximum Suppression (NMS) on object detection predictions. Args: predictions: An array of object detection predictions i
src/supervision/detection/utils/iou_and_nms.py:938
↓ 3 callersFunctionbuild_coco_class_index_mapping
( coco_categories: list[CocoDict], target_classes: list[str] )
src/supervision/dataset/formats/coco.py:36
↓ 3 callersFunctioncallback
(frame, index)
tests/utils/test_video.py:108
↓ 3 callersFunctionclasses_to_coco_categories
Convert a list of class names to COCO ``categories`` entries. Category ids are emitted 1-indexed to comply with the COCO specification and to
src/supervision/dataset/formats/coco.py:48
↓ 3 callersFunctionclip_boxes
Clips bounding boxes coordinates to fit within the frame resolution. Args: xyxy: A numpy array of shape `(N, 4)` where each
src/supervision/detection/utils/boxes.py:10
↓ 3 callersFunctioncoco_annotations_to_detections
Convert COCO annotation dicts for a single image into a `Detections` object. .. warning:: The returned ``Detections.class_id`` contains *
src/supervision/dataset/formats/coco.py:145
↓ 3 callersFunctioncrop_image
Crop image based on bounding box coordinates. Args: image: The image to crop. xyxy: Bounding box coordinates in
src/supervision/utils/image.py:34
↓ 3 callersFunctioncross_product
Get array of cross products of each anchor with a vector. Args: anchors: Array of anchors of shape (number of anchors, detections, 2)
src/supervision/detection/utils/internal.py:396
↓ 3 callersFunctiondetections_from_xml_obj
Converts an XML object in Pascal VOC format to a Detections object. Expected XML format: <annotation> ... <object>
src/supervision/dataset/formats/pascal_voc.py:235
↓ 3 callersFunctiondetections_to_pascal_voc
Converts Detections object to Pascal VOC XML format. Args: detections: A Detections object containing bounding boxes, cl
src/supervision/dataset/formats/pascal_voc.py:84
← previousnext →101–200 of 1,714, ranked by callers